Repository navigation
Improve presentation, citation, and embed editing - #251
HamptonMakes wants to merge 3 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91d93a6278
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be235a0efb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // content, so it must not turn its entire paragraph or list into a source card. | ||
| const tokenizer = defaultMarkdownParser.tokenizer | ||
| tokenizer.inline.ruler.before("link", "coplan_footnote", (state, silent) => { | ||
| const match = /^\[\^([^\]\s]+)\]/.exec(state.src.slice(state.pos)) |
There was a problem hiding this comment.
Normalize footnote labels before matching citations
When existing Markdown uses a fold-equivalent label such as [^STRASSE] with [^straße]: ..., or a valid label containing collapsed whitespace, Commonmarker resolves the citation but this tokenizer either preserves the unmatched case or rejects the marker; citationDefinitions and openCitation then compare literal labels. The first case opens an empty dialog and saving appends a competing definition, while the whitespace case never gets citation controls. Normalize labels using the renderer's case-folding and whitespace rules while preserving the original source spelling.
Useful? React with 👍 / 👎.
| return { dom, update(next) { | ||
| if (next.type !== node.type || next.attrs.kind !== "presentation") return false | ||
| node = next | ||
| const content = presentationContent(node.attrs.source).content | ||
| if (input.value !== content) { |
There was a problem hiding this comment.
Refresh an open presentation preview after source updates
When a presentation is showing Preview and its node changes through Undo/Redo or a live merged revision, this update path refreshes only the hidden textarea and neither invalidates nor regenerates the visible preview. An older in-flight preview request can consequently populate stale HTML after the source has changed, leaving the user looking at outdated slides until they toggle back and preview again; invalidate the request and rerender whenever the preview body is visible.
AGENTS.md reference: AGENTS.md:L76-L82
Useful? React with 👍 / 👎.
What changed and why
The inline editor treated presentation fences as separate Markdown blocks and hid citation definitions in a large source field. Nested tables could also turn a whole bullet list into a table editor.
Presentations now have one Markdown field, a slide icon, and a preview that uses the existing slideshow renderer. Citations open a centered dialog. Tables inside lists keep their own editing field. A new + menu inserts Presentation or Embed blocks.
Embedded pages use a self-closing Markdown block with URL, accessible title, width, and height. Administrators approve exact HTTPS domains. The sandbox supports external providers while blocking the app's own host, top navigation, and device permissions. Frame redirects remain constrained by the domain policy.
Expired sign-in keeps the draft and explains how to retry. An uncached editor snapshot refreshes the security token after signing in again.
This adds an engine migration and its host copy. Hosts must install and run the engine migrations. No iframe domains are approved by default.
Evidence
How to try it
Start
bin/dev -p 3107and edit a plan. Click + → Presentation, edit the slide Markdown, and switch to Preview. Click an inline citation to edit its definition. Click + → Embed to edit a URL and dimensions; unapproved hosts display an unavailable message. Approve the exact host in Administration → Iframe domains, then reload the document to update its frame policy.The local tryout is http://localhost:3107/hampton/editor-tryout-presentation?edit=1. A second demo at http://localhost:3107/hampton/editor-tryout-embedded-page-and-nested-table shows a table nested in bullets and an OpenStreetMap embed.
Testing
bundle exec rspecrun had one macOS Ctrl+A assertion failure; that case passed on rerun. CI runs the full suite on MySQL and PostgreSQL.Generated with Codex