Skip to content

feat(question-card): click the session row to focus the asking terminal - #325

Open
mutoe wants to merge 1 commit into
wxtsky:mainfrom
mutoe:feat/question-card-click-to-jump
Open

feat(question-card): click the session row to focus the asking terminal#325
mutoe wants to merge 1 commit into
wxtsky:mainfrom
mutoe:feat/question-card-click-to-jump

Conversation

@mutoe

@mutoe mutoe commented Aug 25, 2026

Copy link
Copy Markdown

Problem

The question card offers no way back to the conversation that asked the question.

When an AskUserQuestion / plan-mode prompt pops up, the only exits are answering an option or Skip. Skip is not "hide this for now" — it denies the request and drops it from the queue (as explained in #210), so there is no safe way to say "let me go read the terminal first."

The approval card already solves exactly this: clicking it focuses the owning terminal. The question card just never got wired up. QuestionBar receives only session?.source and session?.cwd as plain strings, even though the construction site one screen away already has the full SessionSnapshot:

case .questionCard(let sid):
    let session = appState.sessions[sid]   // ← the session is right here
    QuestionBar(
        sessionSource: session?.source,    // ← but only two strings go down
        sessionContext: session?.cwd,
        ...

So TerminalActivator.activate had exactly two call sites: ApprovalBar and SessionCard.

Change

1. Extract the shared jump driver. ApprovalBar.handleCardClick() held ~60 lines — activate terminal, poll 3× with increasing delays to see whether the jump landed, collapse on success, error sound + shake on failure. Rather than paste a third copy, it moves to startNotchCardJump(kind:session:sessionId:appState:autoCollapseAfterJump:shakeOffset:). ApprovalBar behaviour is preserved line for line; SessionCard is untouched (its jump has slightly different semantics around remote sessions, so it stays as it is).

The only thing that differed between the two cards is which surface may auto-collapse, now a NotchCardKind.

2. Wire up QuestionBar. It gains session / sessionId / appState, and the "CLI icon + project folder" row becomes the jump target — with a hover highlight and an glyph, so the affordance is discoverable rather than an invisible hit area. The row now also renders when the session has no cwd, so a jumpable session always has an entry point.

I deliberately did not make the question text clickable, the way the approval card's tool-name row is. That line is what the user is reading; a misclick there would yank them to another app mid-thought. The session-identity row carries the clearer meaning anyway: click which session this is → go to that session.

3. Fixed a doc comment that had drifted onto shortcutHint (it documents handleCardClick).

Behaviour

  • Click the session row → the asking terminal comes to the front, exactly like the approval card.
  • With Auto-Collapse After Jump on, the notch folds once the jump is verified. The question stays queued and answerable — in the terminal, or back on the card via ⌘⇧I / hovering the notch. This is the important distinction from Skip.
  • Remote sessions have no local terminal, so the glyph and hover affordance stay hidden rather than presenting a dead control.
  • Jump fails (terminal gone) → the existing error sound + shake, unchanged.

Tests

NotchPanelViewTests

AppStateQuestionFlowTests

  • testCollapsingAQuestionCardAfterAJumpKeepsItAnswerable — collapse the surface the way a successful jump does, then assert the question is still queued and still answers correctly through its continuation. This pins the property that separates a jump from a Skip.

Full suite green locally on macOS 26.4 / Xcode 26 (Swift 6.3.3): 890 tests, 2 skipped, 0 failures. swift build is clean — no new warnings from these files.

Notes

CHANGELOG is left alone since it looks like it's written at release time.

The question card offered no way back to the conversation. When an
AskUserQuestion / plan-mode prompt pops up, the only exits are answering an
option or Skip — and Skip denies the request and drops it from the queue
rather than deferring it, so there was no safe way to say "let me read the
terminal first".

The approval card already does this: clicking it focuses the owning
terminal. QuestionBar simply never received the session to do it with — it
got session?.source and session?.cwd as plain strings, even though the
construction site already holds the full SessionSnapshot.

Extract the driver both cards need — activate terminal, poll to verify the
jump landed, collapse on success, error sound + shake on failure — into
startNotchCardJump, parameterised by NotchCardKind so a jump only collapses
the surface it started from. ApprovalBar behaviour is unchanged; SessionCard
is left alone.

QuestionBar's session-context row becomes the jump target, with a hover
highlight and an arrow glyph so the affordance is discoverable. The question
text stays unclickable on purpose: that line is what the user is reading.

Collapsing after a jump does not answer or discard the question — it stays
queued and answerable, in the terminal or back on the card.
nguyenvanduocit pushed a commit to nguyenvanduocit/CodeIsland that referenced this pull request Aug 26, 2026
…badge, T-088 question card jump)

New open PRs on wxtsky/CodeIsland (Aug 25, 2026):
- T-088: PR wxtsky#325 — click question card to jump to asking terminal (medium, S; depends on T-036)
- T-087: PR wxtsky#326 — multiplexer badge chip on session cards (low, XS; depends on T-055)

Both gated on upstream merge. Upstream otherwise quiet 11 days since v1.0.32.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UXGjprGYFRNkJMwaYmddBJ
nguyenvanduocit pushed a commit to nguyenvanduocit/CodeIsland that referenced this pull request Aug 29, 2026
…1.0.32)

No new commits on wxtsky/CodeIsland or vibeislandapp/vibe-island since
Aug 26. Issues wxtsky#327 (Qoder) and wxtsky#328 (Codex) are non-Claude CLI specific.
PRs wxtsky#314, wxtsky#323, wxtsky#325, wxtsky#326 remain open and watching. No actionable items.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T4KU8w1bHuFtRzeNAvW1bn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant