Repository navigation
Description
Symptom
While reviewing a spec/plan on the artifact canvas, stepping forward one block (the Stream Deck fine review dial, or the n key) from the paragraph that introduces a list selects the whole list rather than its first item, and the next step lands on item 2. The first list item is never individually selectable: it can only be reached as part of the whole-list selection. Items 2..n each select individually, so the asymmetry is immediately visible while reviewing. The same holds for blockquotes and nested lists: the first child of any container is swallowed by its container.
Observed live while reviewing a spec document: paragraph ("...That creates two problems:") -> whole ordered list -> item 2, with item 1 skipped.
Root cause
Two rules interact:
-
The renderer stamps containers and their first children with the same line.
packages/artifact-canvas/src/renderer/renderer.ts:75stampsdata-lineon every block-open token that carries a source map. A list container (ordered_list_open) starts on the same source line as its firstlist_item_openand that item's innerparagraph_open, so all three carry the samedata-line. -
Navigation dedupes to the outermost element per line.
collectBlocks(packages/artifact-canvas/src/components/ArtifactCanvas.tsx:589) keeps only the first element perdata-linein tree order, i.e. the outermost. For the first item's line that is the<ol>/<ul>itself, so the navigable block for that line is the whole list, and the first item has no slot of its own.
The Stream Deck dial is not a separate code path: block-next/block-prev (apps/streamdeck/src/actions.ts:1073) run the same focusMatchingBlock walk as the keyboard, so keyboard review reproduces this identically.
Note the outermost-wins dedupe is deliberate: it mirrors the marker-decoration guard (ArtifactCanvas.tsx:407) that anchors comment-card stacks to the outermost element per line (duplicate-stack / invalid-DOM fix from an earlier review iteration). Navigation and marker anchoring are intentionally coupled ("n/p land where the class is"), so a fix must keep them consistent rather than flipping only one side.
Fix shape (hypothesis to validate in the lane)
Stop stamping data-line on pure container open tokens (bullet_list_open, ordered_list_open, and likely blockquote_open) in the renderer. Consequences:
- The outermost element for the first item's line becomes the
<li>, so navigation visits item 1 like every other item. - Marker anchoring becomes consistent rather than changed: markers on items 2..n already anchor to their
<li>today; first items join that existing behavior instead of ambiguously decorating the whole list. - The card-insertion DOM question (
el.after()on an<li>placing the card<ul>directly inside an<ol>) is pre-existing for non-first items, not a new cost; the lane can address it once (e.g. append the stack inside the<li>). renderer/__tests__/data-line.test.tspins the current stamping and needs deliberate updating, plus a regression test that a paragraph -> list step sequence visits item 1.
Activity
amrmelsayed commentedon Sep 28, 2026
On it! Working on a fix now.
Fix #1738: stop stamping data-line on list/blockquote container token…
Fix #1738: preserve the CSS row identity of list/blockquote wrappers …
Fix #1738: correct stale comments and table rationale, tighten tests …
[Bugfix #1738] Update builder thread: CMAP rounds + pr gate
Merge pull request #1741 from cluesmith/builder/bugfix-1738
docs(release-notes): #1738 canvas block navigation reaches a containe…
amrmelsayed commentedon Sep 28, 2026
Shipped. PR #1741 merged to main 2026-09-28T23:00:00Z as merge commit f010ba0 (owner admin-bypass merge, pr gate approved by the owner at 22:55Z).
What landed (packages/artifact-canvas only): the renderer no longer stamps
data-line/tabindexonbullet_list_open,ordered_list_openandblockquote_open, so a container's first child owns its line and is individually navigable and markable like items two onward. Containers get a CSS-onlydata-rowattribute so the row model, gutter and in-row "+" affordance keep working. Marker cards for list items now live inside the<li>, fixing the pre-existing invalidul > ulDOM. Two CMAP rounds; 183/183 unit and 44/44 Playwright green; CI 7/7 on the merged head.Deliberately out of scope: tables have the same first-child asymmetry (the
<table>shares its line with the header row,<tbody>with the first body row) but need a row-versus-cell navigation decision plus<tr>/<td>card-DOM handling. Follow-up issue to be filed on the owner's word. Other non-blocking follow-ups from review are listed in the PR body.Release notes:
docs/releases/UNRELEASED.mdOther fixes updated ondocs/vscode-changelog. No extension CHANGELOG entry, since no extension code changed.