DocumentProfile comment summary + comments-toggle count badge (bd-0rsk07il) - #601
Merged
Merged
Conversation
…k07il) Plan draft covering profile field shape (per-comment text + span + in-band author/date attr interpretation), version bump rationale, WASM RenderResponse surfacing, and the hub-client comment-toggle badge as first consumer. Awaiting review before execution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Entries+spans confirmed (cache privacy verified: .quarto/ is gitignored by q2 create scaffolding); active-page-only first cut; single badge location; author=/date= with ISO 8601 UTC and display-name identity, write-side stamping as follow-up strand. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds comments: Vec<ProfileComment> to the profile — every editorial
comment ([>> ... ] / [...]{.quarto-edit-comment}) in the body, in
source order, with plain-text projection, source span, typed in-band
author=/date= attrs, and remaining-kv passthrough. The walk keys on
the quarto-edit-comment span class (the reader's postprocess rewrites
EditComment nodes into that form) with a defensive EditComment arm,
and mirrors LinkResolutionStage's traversal; comment marks are leaves.
Version bump 12 -> 13: the field is serde-additive, but a cached v12
profile would silently report 'no comments' — the semantic misread
the version check exists for. Cached entries regenerate automatically
(version is in the cache-key hash domain).
Tests: 5 unit tests (TDD, verified failing first) + include-splice
pipeline integration test. Contract doc updated (version tag,
guarantees row, change log). Full workspace suite green (13395).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…7il) Retention: UnwrapProfileStage moves the Pass-1 profile onto StageContext.document_profile instead of discarding it; run_pipeline bridges it to RenderContext.document_profile; both WASM Pass-2 renderers copy it onto WasmPassTwoOutput (same seam as theme_fingerprint). The q2-preview pipeline keeps both checkpoint stages, so single-doc and project-active branches populate alike. Transport: JsonComment (quarto-core, natively tested) carries text, in-band author/date, kv passthrough, the mapped source file, and 1-based Monaco positions with diagnostic_to_json's end-position fallback. RenderResponse gains comments: Option<Vec<JsonComment>> (absent = zero). TS: RenderComment + RenderResponse.comments in preview-renderer's diagnostic.ts, the shared definition. TDD: 4 new tests verified failing first. Workspace suite green (13399); npm run build:wasm compiles the WASM side cleanly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…k07il) ReactPreview reports RenderResponse.comments through a new onCommentsChange callback after each successful preview-pipeline render (absent-on-wire maps to []; parse-only formats and render failures preserve the last-good count, matching the AST and theme- fingerprint semantics). PreviewRouter threads it to Editor, which keeps the count and hands it to ReplayDrawer; CommentsModeToggle renders a single count pill on the toggle group (both drawer states), hidden at zero. TDD: ReplayDrawer.commentsBadge.test.tsx verified failing first. build:all (strict tsc -b), unit (1005) and wasm-tier (133) suites green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Full verify green except pre-existing KaTeX \tag failure (also red on main; filed bd-kn7ln981). Real-browser e2e against local-prod: badge 2 -> 3 -> 4 (UI add writes the mark to source) -> 3 (UI resolve deletes it). Follow-ups bd-juei440d, bd-lh3lgb20 filed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #445.
Teaches Pass-1's
DocumentProfileabout editorial comments so downstream tooling gets comment-awareness without processing the whole document, and ships the first consumer: a count badge on hub-client's comment-display toggle.What's here
DocumentProfilev13 — newcomments: Vec<ProfileComment>: every[>> … ]/[…]{.quarto-edit-comment}mark in the body, in source order, each carrying its plain-text projection, source span, typed in-bandauthor=/date=attributes ([>> text ]{author="…" date="…"}is now an interpreted convention; ISO 8601 UTC), and remaining attr kvs. Comments in included files count toward the host. The version bump is deliberate even though the field is serde-additive: a cached v12 profile would deserialize cleanly and silently report "no comments" — cached entries regenerate automatically (the version is in the cache-key hash domain).Response surface —
UnwrapProfileStagenow moves the profile ontoStageContextinstead of discarding it;run_pipelinebridges it toRenderContext, both WASM Pass-2 renderers carry it onWasmPassTwoOutput(same seam astheme_fingerprint), andRenderResponse.comments(newJsonCommenttransport type in quarto-core: 1-based Monaco positions, mapped source file) is populated on both the single-doc and project-active branches.hub-client badge —
ReactPreviewreportsRenderResponse.commentsvia a newonCommentsChangecallback →PreviewRouter→Editor→ReplayDrawer; a single count pill on the comments-mode toggle group, hidden at zero.Design decisions, review notes, and the phase log:
claude-notes/plans/2026-08-25-document-profile-comments.md.Verification
build:all, unit (1005), and wasm-tier (133) green.npm run local-prod: badge shows 2 for a doc with two marks; an edit makes it 3; adding a comment through the bubble UI writes the mark to source and shows 4; resolving via ✓ deletes it and shows 3.cargo xtask verify's ts-packages leg fails on a pre-existing KaTeX\tag{N}test that is red onmaintoo (.katex-tagmissing) — filed as bd-kn7ln981.Follow-ups filed
author=/date=(write side of the convention this PR reads).🤖 Generated with Claude Code