Repository navigation
feat(editor): read and check a document with the page's parser options - #404
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Important
Two P1 regressions need attention before merging: renderer-only builds now emit the chart parsers, and safe HTML documents can incorrectly open read-only. A separate P2 issue causes repeated charts to lose clipping beside a closed disclosure.
Reviewed changes — Reviewed both commits covering host-parser-aware editor conversion and deterministic chart SVG IDs.
- Parser options: Added
PageParserand threadedregisterDefaultPluginsthrough Markdown conversion, the collaboration codec, and Vue bindings. - Save verification: Replaced the page-text comparison with AST/frontmatter comparison, masking source-derived identifiers and rejecting lossy TeX examples.
- Chart IDs: Added drawing-hash-based SVG resource names and repeat-render coverage.
- Documentation and validation: Updated the editor guide; build, typecheck, changed-file lint, and 245 focused tests pass. The preset suite reproduces CI’s failure at
packages/ui/test/ui.test.ts:427; the repeated-chart clipping issue was also verified in Chromium.
gpt-6.1-sol(xhigh) | 𝕏
There was a problem hiding this comment.
ℹ️ No new defects found in
209ba87. Approval remains pending on the existing unresolved review threads.
Reviewed changes — Reviewed the chart bundling fix added since the prior review at 2e3349b.
- Moved SVG ID normalization: Applied deterministic renaming in the chart parse plugin after drawing, removing the dependency that retained chart parsers in renderer-only bundles.
- Verified the fix: Rebuilt the workspace and passed all 61 chart/preset tests, including the renderer-only bundling regression, plus workspace typechecking and lint for both changed files.
gpt-6.1-sol(xhigh) | 𝕏
comark-annotate
comark-badge
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
Important
The new JSON masking can throw on valid numeric frontmatter, preventing affected documents from loading in the editor.
Reviewed changes — Reviewed the source-key masking refactor in f2fd22d since the prior review at 209ba87.
- Replaced recursive masking: Serialized page trees and frontmatter to JSON, replaced the source hash in that JSON text, and parsed the result before comparison.
Validation: the workspace build, typecheck, changed-file lint, and all 190 focused editor tests passed. A separate public-API reproduction confirms the new exception with both comark-tabs and the standard preset.
gpt-6.1-sol(xhigh) | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Session Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks. Session Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks. Session Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks. Session Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks. Session Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks. Session Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks. Session Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks. Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks. Pushed 44ee33a fixing Pullfrog P1 numeric-frontmatter masking, P1 page-parser unwrapping, and P2 duplicate chart clip IDs. All three regressions reproduced before repair. Package-local tests passed: 169 editor tests, 44 chart tests, and the renderer-only bundle regression. Builds and changed-file lint passed. Resolved all three open threads; awaiting hosted checks. Session Waiting for review checks before the next pass. |
There was a problem hiding this comment.
✅ No new issues found; no P0 or P1 findings remain.
Reviewed changes — Reviewed 44ee33a, covering the fixes added since the prior review at f2fd22d.
- Restored page-parser defaults: Removed editor-only parser settings from page-equivalence checks, keeping the reported safe HTML document editable and room-writable.
- Confined source-key masking to strings: Preserved numeric frontmatter and property names while normalizing source-derived identifiers.
- Namespaced chart resources by occurrence: Gave identical charts separate clip paths while retaining repeatable output, with regression coverage for an earlier copy inside a closed disclosure.
Validation: the workspace build, typecheck, changed-file lint, and all 254 focused editor/chart/preset tests passed. Independent checks through built public exports also confirmed both reported editor regressions are fixed.
gpt-6.1-sol(xhigh) | 𝕏

On a page that parses with
registerDefaultPlugins: false, the editor turns every bare URL into a link on the first save. Drop renders that way: across its 57 public Markdown docs, 8 change what readers see after one save withcreateEditorCodec({ plugins }), and each one is a bare URL.The reader always parses with Comark's defaults, so
linkifyreadshttps://…as a link and the writer stores<https://…>. The page doesn't link bare URLs, but it does read<…>as an autolink.checkMarkdown()misses it for two reasons. Its page pass can't expressregisterDefaultPlugins: false, and it compares only the text, which is the same before and after.This PR adds
registerDefaultPluginsnext topluginsoncheckMarkdown(),fromMarkdown(),createEditorCodec()anduseComarkEditor()/<ComarkEditor>. When it'sfalse, the reader follows the page onlinkifyandhtml, and always keeps frontmatter, task lists, components and attributes, which the schema models. The page pass now compares the page's trees before and after a save, not their text. It masks the key that comark-tabs, details and the other plugins derive ids from (hash(state.markdown)), so a rewrite alone doesn't count.Comparing whole trees turned up two things the text check let through:
$$ \frac{n(n-1)}{2} $$as text, so{2}reads as attributes and a save drops it.math-inline-and-displayandmath-aligned-stepsnow open read-only. Keeping TeX as an atomic node would make them editable again, as a follow-up.mainThe five new tests in
editor.test.tsand the chart test fail onmain. I ran the editor and chart tests,tsrs --noEmitand lint. I didn't run the e2e suite, and haven't tried it in a browser.