Repository navigation
Stream Deck: Scroll dial scrolls a spec/plan under review (canvas viewport-scroll) - #1513
Merged
Merged
Conversation
… scroller, count-aware)
… mode In canvas mode (a spec/plan under review) rotation drives the new viewport-down/up canvas command instead of editorScroll, keyed on reviewMode 'canvas' specifically so 'none' still takes the editor path. Canvas-mode touchstrip label becomes 'read only' (rotation scrolls, press stays diff-bound and inert).
…e diff-mode coverage The old :638 'scrolls the editor on rotate' rode the default pir-1 fixture, which is CANVAS mode, through then-mode-independent code — so diff-mode rotate had no real coverage. Repointed to pir-2 (diff mode) with the mode stated, so it now asserts byte-for-byte editorScroll on an actual diff-mode builder. Added a canvas-mode rotate test (viewport-down/up, count = |ticks|, MRU target) and a canvas-error touchstrip test.
…tract note 3-way cmap (gemini APPROVE, codex COMMENT, claude REQUEST_CHANGES): - Update the ScrollNav CLASS-level doc comment (renderTo's was updated, the class header was not) — it still described 'editor only' / both gestures inert on a canvas. - Update apps/streamdeck/README.md Scroll bullet with the phase-aware split, matching the sibling dials, and note the press stays diff-only (half-live on a canvas). - Make scrollViewport's host contract explicit (document is the vertical scroller, same assumption as viewportStartLine); drop the dead cancelWheelGlide call (glide is horizontal-only) and its misleading comment. - ternary -> if/else in ScrollNav.onDialRotate.
…viations 3-way review consult = 3x APPROVE (no REQUEST_CHANGES). Addressed Claude's non-blocking comments: add a Playwright test pinning viewport-scroll inert in horizontal mode (mirror of column-paging-inert-in-vertical); document in the review the horizontal no-op, the deliberately-dropped wheel-glide cancel, and the synchronous-loop safety of the count-loop signature change.
… via version skew
The old comment claimed invalid-request was unreachable ('we only ever send valid
commands'), which this PR's own lessons-learned entry contradicts: a stale Tower whose
canvas-relay allowlist predates a newly added command rejects it as invalid-request, and
the deck renders 'Error'. Point the reader at the stale-Tower lesson instead of sending
them looking in the wrong place. Comment-only; no behaviour change.
amrmelsayed
added a commit
that referenced
this pull request
Aug 18, 2026
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.
PIR Review: Scroll dial scrolls a spec/plan under review (canvas viewport-scroll)
Closes #1501
Summary
The Stream Deck Scroll dial's rotation relayed VSCode's
editorScroll, which acts only on atext editor — so it did nothing when the reviewer was reading a spec/plan in the artifact-canvas
webview, the one long document where keyboard-free scrolling matters most. This adds a
viewport-down/viewport-upcanvas command (a raw viewport pan, distinct from the existingblock/heading focus moves) and phase-switches
ScrollNav.onDialRotateto drive it oversendCanvasCommandin canvas mode — mirroring the mode split the review dials already use —while keeping
editorScrollfor diff/text-editor mode. The press stays builder-diff-only bydesign (#1498), so on a canvas the dial is half-live: rotation scrolls, press is inert.
Files Changed
packages/types/src/canvas-command.ts(+18 / -3) — newviewport-down/viewport-upin theCanvasCommandunion andTraversalCommand.packages/types/type-tests/canvas-command.type-test.ts(+2 / -0) — classification (drift guard).packages/codev/src/agent-farm/servers/canvas-relay.ts(+4 / -0) — Tower relay allowlists.apps/vscode/src/markdown-preview/canvas-view-registry.ts(+2 / -0) — VSCode host allowlist.packages/artifact-canvas/src/components/ArtifactCanvas.tsx(+48 / -2) —scrollViewport(pans the host-page scroller),
VIEWPORT_SCROLL_STEP_PX, count-loop signature extension.apps/streamdeck/src/actions.ts(+66 / -15) —ScrollNavmode split +Scroll · read only.apps/streamdeck/src/__tests__/actions.test.ts(+40 / -4) — diff/canvas rotate tests.packages/artifact-canvas/playwright/remote-commands.spec.ts(+66 / -0) — real-browser scroll tests.apps/streamdeck/README.md(+8 / -2) — Scroll dial doc, phase-aware split.(Plus the plan, this review, the builder thread, and porch
status.yaml.)Commits
126000771[PIR Stream Deck: the Scroll dial can't scroll a spec/plan under review (canvas webview, not a text editor) #1501] Add viewport-down/up to the canvas command wire contract7c2f4393a[PIR Stream Deck: the Scroll dial can't scroll a spec/plan under review (canvas webview, not a text editor) #1501] Allow viewport-scroll commands through the Tower relay and VSCode hosta4df4b4aa[PIR Stream Deck: the Scroll dial can't scroll a spec/plan under review (canvas webview, not a text editor) #1501] Scroll the canvas viewport on viewport-down/up (host page scroller, count-aware)be3e5b55a[PIR Stream Deck: the Scroll dial can't scroll a spec/plan under review (canvas webview, not a text editor) #1501] Route the Scroll dial to canvas viewport-scroll in canvas modea2836b23f[PIR Stream Deck: the Scroll dial can't scroll a spec/plan under review (canvas webview, not a text editor) #1501] Test Scroll dial rotation in both modes; add first genuine diff-mode coverage56db55602[PIR Stream Deck: the Scroll dial can't scroll a spec/plan under review (canvas webview, not a text editor) #1501] Address impl-review: fix stale Scroll dial docs, host-contract noteTest Results
pnpm -r build, porchbuildcheck 7.2s)#1501, real Chromium), codev canvas-relay 30, vscode registry 17; allcheck-types+type-tests. Porchtestscheck 30.9s.dial scrolls a spec/plan in the artifact-canvas; the
Scroll · read onlylabel and the 60pxstep were confirmed on the dial. (One
Errortouchstrip appeared first — diagnosed as a staleglobally-installed Tower rejecting the new command as
invalid-request, not a code defect; seeLessons.)
Architecture Updates
COLD (
codev/resources/arch.md): appended one clause to the #1380 artifact-canvas host-contractentry recording that in vertical reading mode the host page (document scrolling element) is the
vertical scroll container, not the canvas body — the invariant
viewportStartLinealready encodesand that the new viewport-scroll command now also depends on.
No HOT arch change: this adds no new module boundary. The viewport-scroll command follows the
existing spec-1401 pattern exactly — a closed command vocabulary mirrored across four drift-guarded
allowlists (types union/
TraversalCommand, Towercanvas-relay, VSCodecanvas-view-registry,canvas-local
TRAVERSAL_COMMANDS) plus the type-test classification map.Lessons Learned Updates
COLD (
codev/resources/lessons-learned.md, Testing), two entries:The host-scroller find (the most valuable catch in this lane). The approved plan said pan
root.scrollTop; the canvas body is not the vertical scroller (in vertical mode the host pagescrolls —
viewportStartLinemeasures against the window, and the VSCode host leaves bodyoverflow default), so that would have silently no-oped in the real webview while passing every
jsdom test. Generalizable shape: a DOM assumption that unit tests cannot falsify (which element
actually scrolls) needs a real-browser test, and an approved plan is not evidence about runtime.
Caught and proven in real Chromium before writing the code, not argued.
The stale-Tower
Errorsharpens Stream Deck SD+: Automatic diff press should open the builder's first file diff (dial-ready), not the aggregate #1414: a canvas-command Stream Deck feature spans a thirdindependently-versioned artifact — Tower (the codev server validates the command in
canvas-relay). A stale global Tower rejects a new command asinvalid-request, which the deckrenders as
Erroron the touchstrip, even with the deck bundle and VSCode extension bothon-branch.
No HOT lesson: (1) sharpens the existing hot lesson "'tests pass' is not 'it works' — verify the
real user path" rather than displacing a capped entry; both are spec-adjacent recipes that belong cold.
Things to Look At During PR Review
ArtifactCanvas.tsx,runCanvasCommand): the progresssignature gained the document scroller's
scrollTop(originLine:scrollLeft:scrollTop). This isshared by every canvas command's repeat loop — verify it still edge-stops for block/heading/column
commands (it does: at an edge nothing moves; when focus moves
originLinealready differs). Thehuge-count Playwright test pins the bound (
count: 1_000_000finishes < 5s at the bottom).'canvas'-specific keying inScrollNav.onDialRotate: the branch isreviewMode === 'canvas',never "not diff", so
none(no builder / unknown phase) keepseditorScroll. The Stream Deck: Scroll dial names a delivery mode with no builder selected (press is inert) #1505empty-state guard pins this.
:638test repoint (ruled by the architect): it moved to a diff-mode builder (pir-2)and is the first genuine diff-mode rotate coverage — the old test rode the canvas-mode default
fixture through then-mode-independent code. Not an accommodation of a regression.
Codex COMMENT, Claude REQUEST_CHANGES. All addressed — the substantive one was a stale ScrollNav
class-level doc comment (the
renderTodoc was updated, the class header was missed).(via
runCanvasCommand, accepted after hardware use) and the ~5-line overlap withReviewNav.runCanvas(extracting a shared helper would couple two actions with different semantics).How to Test Locally
afx dev pir-1501. Note this is a cross-surfacechange — hardware testing needs Tower + the VSCode extension + the deck plugin all built from this
branch, not the installed package (a stale Tower renders
Erroron the dial).plan/spec in the artifact-canvas, rotate the Scroll dial → the page scrolls up/down; spin faster →
proportional; at the bottom it stops. On a diff-phase builder the dial still scrolls the diff
editor and the press still submits/queues the selection.