Skip to content

Stream Deck: hands-free comment submit/cancel in review mode (dictation workflow) #1420

Closed

Description

@amrmelsayed

Context

Surfaced during hardware testing of #1400 (phase-aware review dials). In canvas/review mode the
Stream Deck can now navigate an artifact and open the comment composer at the focused block
(composer-open on a dial press). But committing the comment still requires the keyboard
(Cmd+Enter to submit, Esc to cancel).

Reviewers working in this mode typically dictate the comment body, so the keyboard round-trip
just to submit or cancel breaks an otherwise hands-free flow. This issue makes submit and cancel
reachable from the deck.

#1400 deliberately scoped out any bridge/canvas change ("no bridge changes"), so this was split off
rather than folded in. The wire commands themselves already exist — composer-submit and
composer-cancel are in the CanvasCommand vocabulary (#1401), forwarded by the host, and handled
by the canvas — so the gap is purely: (a) the deck has no gesture for them, and (b) making it feel
like one control needs the canvas to decide open-vs-submit.

The design constraint

Only the canvas knows whether a composer is currently open — the deck never learns composer
state back over sendCanvasCommand (the result carries {ok, target} only). So a deck that "guesses"
the state (remembering it sent composer-open) desyncs the moment the composer is submitted/cancelled
via the keyboard or closes itself, and a wrong guess is not harmless: composer-open re-anchors the
composer and unmounts the in-progress draft (ArtifactCanvas.tsx openComposer), so a mis-fire can
discard a dictated comment. The deck must not be the party that decides.

Proposed behavior — one dial owns the composer, the other cancels

Add a single context-aware canvas command, resolved canvas-side against the state it already
tracks (composingLine):

  • composer-open-or-submit: if no composer is open → open at the focused block; if a composer is
    open → submit it. Because the canvas makes the call, it is always correct and can never eat a draft.

Deck gesture mapping in canvas/review mode (reuses the existing review dial presses — no new keys):

  • Fine dial (Review: Changes / Blocks) press → composer-open-or-submit. Press to open at the
    focused block, dictate, press again to submit.
  • Coarse dial (Review: Files / Headings) press → composer-cancel. Discard the open composer
    (already a guarded no-op when none is open).

This supersedes #1400's decision that both review-dial presses fire composer-open (they were
redundant), and it reverses #1400 requirement 6's "deck-driven submit/cancel — default no", now
justified by the dictation workflow.

Requirements

  1. New canvas command composer-open-or-submit (or equivalent name): canvas-side resolution of
    open-vs-submit from composingLine; a defined no-op is not applicable (it always does one or the
    other), but it must never discard an existing draft.
  2. Add it to the closed CanvasCommand union (packages/types), the host allowlist
    (apps/vscode/.../canvas-view-registry.ts CANVAS_COMMANDS), and the canvas action map
    (packages/artifact-canvas/.../ArtifactCanvas.tsx).
  3. Remap the two review-dial presses in canvas mode (apps/streamdeck/.../actions.ts): fine →
    composer-open-or-submit, coarse → composer-cancel. Diff-mode presses (forward file/hunk)
    unchanged.
  4. Touchstrip legibility (the Stream Deck: phase-aware review dials — canvas navigation reuses the diff dials (deck half; bridge is #1401) #1400 hard requirement) must still hold: the strip should make the
    press meaning discoverable in review mode.
  5. Text entry itself stays dictation/keyboard — this issue is submit/cancel only, not typing.

Layout note

The Stream Deck + profile is full (8/8 keys, 4/4 dials). This design adds no keys — it reuses the
two review-dial presses — so it does not reintroduce the key-budget pressure #1400 was built to avoid.
Coordinate with #1410 (fleet layout / two-zone grammar) so the composer-control mapping is consistent
with whatever Row-2 / palette work lands there.

Out of scope

Sequencing

Follows #1400 (the dial-navigation half, which ships the composer-open press). Builds on #1401's
sendCanvasCommand bridge. Coordinate the deck mapping with #1410.

Activity

  1. added
    area/cross-cutting
    on Aug 12, 2026
  2. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

    Cross-lane split (agreed, main + streamdeck architects):

    Deck-stakeholder spec interests to resolve when the command is specced (streamdeck architect):

    1. Exact open-or-submit behavior in each composer state (closed → open; open with content → submit; open empty → ?).
    2. The empty-draft edge case.
    3. Failure verdicts stay in the closed error union (CanvasCommandClientErrorCode) so the dial can render them.

    No bridge changes were made in #1400 (PR #1419); this reverses #1400's req-6 'default no' on deck submit/cancel. Unassigned/queued pending owner prioritization.

  3. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

    Bridge-extension lane scoping (main; PIR spawn imminent). This lane covers the bridge half of the agreed split only:

    In scope: requirement 1 (new composer-open-or-submit command, canvas-side resolution from composingLine, never discards a draft) and requirement 2 (closed CanvasCommand union in packages/types, host allowlist in canvas-view-registry.ts, action map in ArtifactCanvas.tsx).

    Out of scope: requirement 3 (deck dial remapping) and requirement 4 (touchstrip legibility) — those are streamdeck's follow-on lane, sequenced after this command merges. Requirement 5 stands (submit/cancel only, no text entry).

    Deck-stakeholder rulings and interests to honor in the plan (streamdeck architect, pre-gate):

    1. Define exact behavior per composer state: closed → open at focused block; open with content → submit.
    2. Empty-draft press must NOT submit (ruling on the open-empty edge case — pick and document the safe behavior, e.g. no-op or cancel, but never a submit of an empty comment and never a draft-discarding re-open).
    3. Failure verdicts stay inside the existing closed CanvasCommandClientErrorCode union — no new error channel — so the dial can render them.
    4. Existing composer-cancel is reused unchanged.

    Process: the plan's command-semantics section routes to the streamdeck architect for review BEFORE the plan-approval gate.

  4. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

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

  5. added 9 commits that reference this issue on Aug 12, 2026
  6. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

    Deck-mapping lane scoping (streamdeck architect; spawn pending bridge-lane cleanup). Build-time call per the agreed split: this half rides #1420 — folding into #1410 would sequence it behind #1049 panel stability and strand the prioritized hands-free flow. #1410 keeps the broader two-zone layout work.

    In scope: requirement 3 — remap the canvas/review-mode review-dial presses in apps/streamdeck (fine dial press → composer-open-or-submit, coarse dial press → composer-cancel), superseding #1400's both-presses-fire-composer-open decision (actions.ts:605); requirement 4 — touchstrip legibility for the new press meanings. Requirement 5 stands: submit/cancel only, no text entry.

    Not in scope: any bridge/canvas/types change (all landed in PR #1424); reading-mode toggle and palette layout (#1410).

    Protocol: PIR — dial semantics must be verified on hardware at dev-approval before a PR exists (deck is currently sideloaded from the pir-1400 worktree build; the dev-approval session will need the lane's own build linked).

  7. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

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

  8. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

    Closing: the bridge half (requirements 1, 2, 5) merged in PR #1424 — composer-open-or-submit is live in the canvas command vocabulary, resolved canvas-side, across all four allowlists. The deck half (requirements 3–4: dial remapping + touchstrip legibility) continues in #1425 — it moved to a fresh issue because a completed porch lifecycle (project 1420, plan/review artifacts on main) can't share its issue number with a second lane.

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