Skip to content

Stream Deck: the Scroll dial can't scroll a spec/plan under review (canvas webview, not a text editor) #1501

Closed

Description

@amrmelsayed

Problem

The Scroll dial rotates to scroll the focused editor's viewport (keyboard-free reading), but it does nothing when the reviewer is looking at a spec or plan — the exact long document where scrolling without the keyboard is most useful. Its two neighbours (Review: Files / Headings and Review: Changes / Blocks) can navigate a spec/plan; the Scroll dial cannot.

Discovered during #1498's dev-approval hardware testing. #1498 deliberately left rotation unchanged and scoped itself to apps/streamdeck only, so this is a separate follow-up rather than part of that lane.

Root cause

The Scroll dial's rotation relays the scroll verb, which maps to VSCode's built-in editorScroll command (apps/vscode/src/command-relay.ts:59). editorScroll acts only on the active text editor's viewport.

A spec/plan under review is not a text editor — it opens in the artifact-canvas, a WebviewPanel (apps/vscode/src/markdown-preview/preview-provider.ts, the shared artifact-canvas surface). When that canvas is focused there is no active text editor, so editorScroll has nothing to act on and silently no-ops.

The review dials work on a spec/plan because they switch channels by phase: in canvas mode ReviewNav stops sending editor/diff verbs and drives the canvas over sendCanvasCommand (heading-next, block-next, etc.). The Scroll dial has only the single editorScroll channel, so it can never reach the canvas.

Proposed direction

Give the canvas a viewport-scroll capability and phase-switch the Scroll dial's rotation the way the review dials already switch:

  • Add a canvas command that scrolls the artifact-canvas viewport by N lines (up/down) — the canvas currently exposes heading/block/comment navigation and composer commands, but no raw viewport pan.
  • In ScrollNav.onDialRotate, when the selected builder's phase is canvas mode (reviewMode(...) === 'canvas'), route rotation to that canvas command via sendCanvasCommand instead of editorScroll; keep editorScroll for diff/text-editor mode. This mirrors the existing ReviewNav mode split.
  • Leave revealCursor: false semantics intact (viewport move only).

What "fixed" means — the two gestures have different scopes

Discovered while absorbing the canvas-mode honesty into #1498: the Scroll dial's two gestures do not share a scope, so a canvas viewport-scroll capability would only half-fix the dial on a canvas.

  • Rotation is any-text-editor (editorScroll). This issue would revive it on a canvas via a new canvas viewport-scroll command.
  • The press (feedback-selection) is builder-diff-only: its anchor (selectionAnchor() → activeEntry(), apps/vscode/src/review-queue/feedback.ts:48-90) requires a tracked builder-diff entry, which a spec/plan in the artifact-canvas never has. So the press stays inert on a canvas by design, even after this lands.

Consequence: even with this issue fixed, the Scroll dial is half-live on a canvas (rotation works, press does not). #1498's Scroll · editor only label therefore cannot simply collapse back to Scroll · send/queue when this lands. Making the press work on a spec/plan too would be a separate, larger change (a spec/plan feedback path that isn't diff-anchored), not part of this issue.

Scope note

Unlike #1498 (which was apps/streamdeck-only), this needs a new canvas viewport-scroll command, which likely touches the artifact-canvas surface, the wire/types contract, and the VSCode relay in addition to the deck. Sizing/protocol is for the architect to decide; flagging the cross-surface nature so it isn't mistaken for a deck-only change.

Out of scope

Activity

  1. added
    area/streamdeck
    on Aug 18, 2026
  2. added 3 commits that reference this issue on Aug 18, 2026
  3. amrmelsayed commented on Aug 18, 2026

    @amrmelsayed
    CollaboratorAuthor

    Architect scoping — running this as a PIR lane

    Owner has stated the need directly: the Scroll dial must scroll a spec/plan under review.
    Findings below are verified at source, not inferred — they narrow the scope from what this
    issue's original body assumed.

    Root cause, exactly

    apps/vscode/src/command-relay.ts:59 maps the canonical verb straight to a built-in:

    'scroll': 'editorScroll',
    

    editorScroll acts only on a focused text editor. A spec/plan opens in the
    markdown-preview webview (apps/vscode/src/markdown-preview/preview-provider.ts), which is
    not a text editor, so the relayed command arrives and does nothing.

    What is ALREADY correct — do not touch these

    • The deck already sends it. ScrollNav.onDialRotate relays the scroll verb
      unconditionally; it never consults reviewMode. So rotation already leaves the dial and
      reaches VS Code in canvas mode. No Stream Deck change is needed to make rotation function.
    • The wire already carries what is needed. The verb args already include
      to / by / value / revealCursor. No wire or protocol change.
    • The webview channel already exists, bidirectionally. preview-provider.ts:134 does
      panel.webview.postMessage, and the webview listens at
      markdown-preview/webview/main.ts:144.

    So this is a VS Code + webview change, NOT the three-surface change the issue body assumed.

    Scope

    1. apps/vscode — the scroll verb stops being a direct alias to a built-in and becomes a
      Codev command that branches: canvas/preview panel focused, post a scroll message into the
      webview; otherwise delegate to editorScroll exactly as today. The existing text-editor
      behaviour must not regress.
    2. The preview webview — handle that message and move the viewport by the requested amount.
    3. apps/streamdeck — the canvas-mode label, see the decision below.

    DECISION FOR THE PLAN GATE — do not guess this

    Once rotation works on a canvas, the current canvas label Scroll · editor only becomes
    false. But it must NOT simply collapse back to send / queue, because the press stays
    diff-bound by design
    : feedback-selection needs a builder-diff anchor, and a spec/plan is
    not one. So on a canvas the dial becomes half-live in the OPPOSITE direction from the
    no-builder case just settled in #1505: rotation live, press inert.

    Surface the wording options in the plan with a recommendation and let the owner rule at the
    plan gate. Note the precedent from #1505: the owner chose the minimal honest form (a bare
    Scroll) over a more talkative qualifier, because line 2 already carries the context.

    Do not treat #1505 / PR #1508 as a dependency — it is unrelated code in the same method's
    neighbourhood. If it has merged by the time you touch renderTo, rebase; if not, leave that
    branch alone.

    Verification

    The payoff is viewport movement inside a webview, so tests alone cannot close this. The
    dev-approval gate is the point: get it running, then the owner exercises the real dial
    against a real spec/plan. Do not claim hardware or deck observation yourself.

  4. amrmelsayed commented on Aug 18, 2026

    @amrmelsayed
    CollaboratorAuthor

    Architect scoping — running this as a PIR lane

    Owner has stated the requirement directly: the Scroll dial must scroll a spec/plan under
    review. Findings below are verified at source, and they NARROW the scope from what this
    issue's body assumes.

    Root cause, exactly

    apps/vscode/src/command-relay.ts:59 maps the canonical verb straight to a VS Code built-in:

    'scroll': 'editorScroll',
    

    editorScroll acts only on a focused text editor. A spec/plan opens in the
    markdown-preview webview (apps/vscode/src/markdown-preview/preview-provider.ts), which is
    not a text editor, so the relayed command arrives and does nothing. That is the whole bug.

    What ALREADY works — do not "fix" these

    • The deck already sends it. ScrollNav.onDialRotate relays the scroll verb
      unconditionally; it never consults reviewMode. Rotation already leaves the dial and
      reaches VS Code in canvas mode. No Stream Deck change is needed to make rotation FUNCTION.
    • The wire already carries what is needed — the args already include
      to / by / value / revealCursor. No wire or protocol change.
    • The webview channel already exists, both directions: preview-provider.ts:134 does
      panel.webview.postMessage, and the webview listens at
      markdown-preview/webview/main.ts:144.

    So this is a VS Code + webview change, not the three-surface change the issue body
    assumed. Scope your plan accordingly and say so if you find otherwise.

    Scope

    1. apps/vscode — the scroll verb stops being a direct alias to a built-in and becomes a
      Codev command that branches: preview/canvas panel focused, post a scroll message into the
      webview; otherwise delegate to editorScroll exactly as today. The existing
      text-editor behaviour must not regress
      — that is the main risk in this lane.
    2. The preview webview — handle that message and move the viewport by the requested amount.
    3. apps/streamdeck — the canvas-mode label; see the decision below.

    DECISION FOR THE PLAN GATE — surface it, do not guess it

    Once rotation works on a canvas, the current canvas label Scroll · editor only becomes
    false. It must NOT simply collapse back to send / queue, because the press stays
    diff-bound by design
    : feedback-selection needs a builder-diff anchor and a spec/plan is
    not one. So on a canvas the dial becomes half-live in the OPPOSITE direction from the
    no-builder case just shipped in #1505 (PR #1508, merged): there, rotation live + press
    inert with no qualifier; here, rotation live + press inert on a canvas.

    Present the wording options in the plan with a recommendation and let the owner rule at the
    plan gate. Precedent worth weighing: for #1505 the owner chose the minimal honest form (a
    bare Scroll) over a more talkative qualifier, because line 2 already carried the context.

    Note #1505 is already merged into your base, so ScrollNav.renderTo now has the
    no-builder early return. Build on it; do not revert or duplicate it.

    Verification

    The payoff is viewport movement inside a webview, so tests alone cannot close this — that is
    exactly why this is PIR and not AIR. The dev-approval gate is the point: get it running,
    then the owner exercises the real dial against a real spec/plan. Do NOT claim hardware or
    deck observation yourself; report what you ran and hand the observation to the architect.

  5. added
    area/cross-cutting
    and removed
    area/streamdeck
    on Aug 18, 2026
  6. amrmelsayed commented on Aug 18, 2026

    @amrmelsayed
    CollaboratorAuthor

    On it! Working on this with the PIR protocol (plan + dev-approval gates before PR).

  7. added 13 commits that reference this issue on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cross-cutting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions