Comments v1 - #441
Merged
Merged
Conversation
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. |
vezwork
commented
Jul 30, 2026
Comment on lines
-15
to
-19
| #root { | ||
| width: 100%; | ||
| height: 100vh; | ||
| overflow: auto; | ||
| } |
Member
Author
There was a problem hiding this comment.
this was causing there to be multiple scroll bars on the preview. It is necessary for revealjs tho, so that format adds this style programmatically now.
vezwork
commented
Jul 30, 2026
Comment on lines
+1503
to
+1509
| // The replacer strips every pool-index-carrying key: `s` (node | ||
| // SourceInfo), `a` (AttrSourceInfo), and `targetS` (Link/Image | ||
| // URL+title source refs — missing it caused InvalidSourceInfoRef | ||
| // on any subtree containing a link). | ||
| const commitSubtreeEdit = (destinationSourceInfoJson: string, modifiedBlock: BlockNode) => { | ||
| const stripped = JSON.parse(JSON.stringify(modifiedBlock, (key, value) => | ||
| key === 's' || key === 'a' ? undefined : value, | ||
| key === 's' || key === 'a' || key === 'targetS' ? undefined : value, |
Member
Author
There was a problem hiding this comment.
don't know what is going on here, but I believe it fixed a bug where I could not edit or comment on anything that had a link in it.
Closed
cscheid
added a commit
that referenced
this pull request
Jul 30, 2026
…(bd-ddaqjb91) (#443) * fix(preview): strip captionS and citationIdS sidecars in commitSubtreeEdit (#442) Extract the commitSubtreeEdit stripping replacer into a shared stripSourceInfoFields util and extend it to remove the two remaining bare-pool-index sidecar keys: captionS (Table/Figure captions) and citationIdS (Cite citation objects). Subtrees cloned from the untransformed AST carry pool indices that apply_node_edit cannot resolve (the replacement doc has no pool), so any surviving sidecar fails the whole edit with InvalidSourceInfoRef — the same failure PR #441 fixed for targetS on links. The test file now imports the real util instead of re-declaring a copy, and gains coverage for targetS (Link/Image), captionS (Figure), and citationIdS (Cite). Table-internal sidecars (headS/footS/bodiesS/ rowsS/cellsS/bodyS) are left as-is: their pool-carrying leaves are s/a keys the recursive replacer already removes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * plan: diagnosis + fix plan for bd-ddaqjb91 (CommentBlock crash in s0 tests) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(preview): CommentBlock tolerates malformed ResolvedSource; honest s0 stub (bd-ddaqjb91) The Comments v1 merge (a6fc44b) made CommentBlock the registry's Block wrapper, so every block render now consults resolveSource and passes resolved.sourceNode to sameCommentableKind without checking it exists. The s0-list-item-surfaces harness's resolveSource stub predates the current ResolvedSource shape (no sourceNode, invalid 'Reachable' class, bogus sourceIndex prop), so 18/23 tests crashed with "TypeError: Cannot read properties of undefined (reading 't')". Two fixes, TDD'd: - CommentBlock treats a resolved entry without sourceNode like an unresolvable block (passthrough render), in both the chrome gate and resolveCommittable. New defensive test proves passthrough for the malformed shape and that the guard is not over-broad. - The s0 stub now satisfies ResolvedSource for real (sourceNode: node, reachabilityClass 'Descendable', typed sourceEntry). s0: 23/23 pass. Production was likely unaffected: the real resolveSource in PreviewRoot.tsx always supplies sourceNode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test(ts): type-check test files in preview-renderer + preview-runtime (bd-ddaqjb91) The s0 breakage was invisible because nothing type-checks test files: the package tsconfigs exclude *.test.* and vitest transforms with esbuild. Close the gap: - tsconfig.tests.json in both packages (extends base, noEmit; noUnusedLocals/noUnusedParameters off — lint-grade, not drift detection), exposed as `npm run typecheck:tests`. - cargo xtask verify step 11 runs both typechecks before the suites. - Fix the pre-existing type errors the new gate surfaced: - preview-renderer (6 test files): typed vi.fn generics, Mock import, missing setLocalAst props, a useContext type typo, tuple-typed pool fixtures, two documented narrow casts. - preview-runtime: MockSyncClient's interface was missing applyEditorOperations (the impl had it); typed the handler mocks; cast once at the _setClientForTesting test seam. Reintroducing the stale s0 stub now fails the typecheck (TS2322: '"Reachable"' is not assignable to 'ReachabilityClass'). Also updates the plan doc checkboxes (claude-notes/plans/2026-07-30-commentblock-defensive-resolvesource.md). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
This PR adds a default block render component for q2-preview and revealjs formats that
Kapture.2026-07-30.at.13.51.44.mp4
Notes