GeezerVison is showing github.com — id(web): footnote documents open as an empty doc in the web editor — footnote_reference/footnote_definition missing from richSchema (PR #1013) · Issue #1347 · developing-today/code
id(web): footnote documents open as an empty doc in the web editor — footnote_reference/footnote_definition missing from richSchema (PR #1013) #1347DescriptionFinding
PR #1013 (merged, merge commit 554dc37) taught the Rust markdown codec to emit two new ProseMirror node types — footnote_reference (inline atom, pkgs/id/src/web/markdown.rs:545) and footnote_definition (block, pkgs/id/src/web/markdown.rs:558) — but never added those node types to the web editor's ProseMirror schema.
The parallel change in the same batch did this correctly: PR #1009 added the html_inline node type to BOTH the codec and pkgs/id/web/src/editor.ts (current main: editor.ts:216). For footnotes, grep footnote pkgs/id/web/src/editor.ts on current main returns nothing.
Why it matters
pkgs/id/web/src/editor.ts parses the initial document with Node.fromJSON(editorSchema, initialDoc) (editor.ts ~line 375). ProseMirror throws Unknown node type for a node type absent from the schema, and the catch block in initEditor replaces the ENTIRE document with an empty one:
} catch (err) {
console.error("[editor] Failed to parse initial doc JSON, using empty doc:", err);
doc = editorSchema.topNodeType.createAndFill() ?? editorSchema.node("doc");
}
So opening any markdown file that contains a footnote in the web editor shows an empty document instead of the file's contents — and a subsequent save risks persisting that empty doc over the real file. The codec round-trip tests added by #1013 (and the follow-up #1031) all pass because they never go through the editor schema; the bug is only visible at the codec/editor boundary. Verified still present on current main (2026-10-27): codec emits the types, editor schema does not define them.
Evidence
Acceptance criteria
-
richSchema in pkgs/id/web/src/editor.ts defines footnote_reference (inline atom carrying label) and footnote_definition (block carrying label and inline content), mirroring the html_inline pattern from fix(id-web): html_inline passthrough — inline HTML round-trips unescaped (#943) #1009 / PR fix(id-web): html_inline passthrough — inline HTML round-trips unescaped (#943) #1009, with inert toDOM rendering (label as text, never innerHTML).
- Opening a markdown document containing
Text.[^1] + [^1]: Body. in the web editor displays the full document (no "Failed to parse initial doc JSON" fallback, no empty doc).
- A round-trip through the editor (open -> save with no edits) preserves the footnote reference and definition byte-identically.
- A test or e2e check covers a footnote document going through
Node.fromJSON(richSchema, ...) so a future codec node type cannot silently miss its schema entry again.
Activitydeveloping-today commented on Oct 27, 2026 dezren39 commented on Oct 27, 2026 🤖 Agent note · filed
- Agent: pr-diff-review job
- Session / ID: pr-diff-review cron run 2026-10-27T07:28:52Z
- Found via: filed this run
- Task: Triage this PR-diff-review finding against current main (queued as a repo-task/v1 triage packet)
- Expectation: effort class s — verify the finding against current main, then scope the fix
- Links: source PR and evidence in the issue body
dezren39 commented on Nov 4, 2026 🤖 Agent note · handed off
- Agent: fleet monitor (repo-fleet-monitor)
- Session / ID: task 7232 · repo-fleet-monitor run 2026-11-03 20:12 CST
- Found via: monitor reconciliation
- Task: Claim evaporated — task 7232 returned to queued and unclaimed in repo-health-code-pilot after the holding run ended without a terminal verb (checkpoint stage: handed_off). Labels reset to the truth: queue/queued + status/needs-triage. The task cap was also raised this run where it had sat dead-in-queue, so it is claimable again.
- Expectation: next claimant picks up from the checkpoint stage named above.
dezren39 commented on Nov 4, 2026 agent-note:v1
state: picked-up
queue: repo-health-code-pilot
task: 7232 (small_fix, worker repo-worker-code, lane 7b47536b-c162-444c-be8a-3a9538cc4cb5)
by: openchamber-scheduled-lane
at: 2026-11-04T03:12:23Z
Resuming as shepherd of the bound PR #4640 only; no reimplementation. Fresh checks: issue #1347 is OPEN with no hard-stop labels; PR #4640 is OPEN, not draft, and matches the footnote-schema issue. Its visible check is green (OpenCode metered-provider guard); CodeRabbit is skipped/neutral; no review comments or reviews are present, though the codeowners team is requested. PR description records 120 targeted editor tests passing and clean-tree evidence for the pre-existing full-suite/typecheck failures. I am checking merge readiness before taking a terminal action. dezren39 commented on Nov 4, 2026 agent-note:v1
state: done (fixed_merged)
queue: repo-health-code-pilot
task: 7232 (small_fix, worker repo-worker-code, lane 7b47536b-c162-444c-be8a-3a9538cc4cb5)
by: openchamber-scheduled-lane
at: 2026-11-04T03:13:52Z
PR #4640 merged with merge commit 3dd03c2; issue #1347 is CLOSED. The scoped schema and round-trip diff matched the issue. Visible PR check passed (metered-provider guard); CodeRabbit skipped. PR records 120 targeted editor tests passed; broader web-suite/typecheck failures were verified pre-existing on a clean tree and were not rerun in this shepherd claim. Removed this task's in-flight labels.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|