Skip to content

#906 Connect the needs-input and prompt pills - #924

Merged
ivanfenenko merged 2 commits into
mainfrom
feature/906-connect-needs-input-pills
Nov 1, 2026
Merged

ivanfenenko merged 2 commits into
mainfrom
feature/906-connect-needs-input-pills

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of #899. Final wiring of the floating pill system.

  • Needs-input pill → panel (both apps). When the bottom-left background work pill is in its needs-input state ("general needs input · 2 running"), tapping it opens the permission or question panel instead of the Subagents sheet. The panel expands if collapsed, pages to the waiting subagent's request, and pulses briefly. When no subagent waits, the pill still opens the Subagents sheet.
    • Which request opens is decided by a pure function, SessionChatBackgroundWork.needsInputTarget. It picks the first waiting subagent (spawn order, the same as the top row of the Subagents panel), then that subagent's permission, else its question. A request from the subagent's own subagent counts. A question waits behind any permission, so in that case the shown permission opens. If the request is already gone, the tap falls back to the Subagents sheet.
    • The inbox gets focus(target) (page, un-collapse, pulse). The Screen Model exposes openWaitingSubagentRequest() and an inboxPanelPulse counter that the view watches.
  • Pulse after the prompt pills. "Review permission" and "Answer question" now pulse the panel too. The pulse is a small spring scale from the bottom edge. With Reduce Motion on, iOS fades instead. With Remove animations on, Android skips it.
  • Collapsed prompt pills. These were already on the shared pill with the needs-attention state and no ✕ (Session Chat: corner slots for floating pills #903), so no change was needed.
  • Android TalkBack double speech. OpenCodeFloatingPill used semantics(mergeDescendants = true), so TalkBack read the visible label again after a custom accessibilityLabel. It now uses clearAndSetSemantics, which keeps the click action, role and live region from clickable on the same node.

Shells are out of scope (#907). Old pill components are untouched; that cleanup is a separate PR.

Fixes #906

Checks

  • iOS: SessionChatBackgroundWorkTests, SessionChatViewModelTests, SessionChatPillSlotsTests, SessionChatPlaygroundTests: 285 of 286 pass. The failing test, sendPrompt_postSendReloadMatchingUser_dropsOptimistic, fails the same way on unchanged main (b89dd17), so it was already broken.
  • Android: ./gradlew :app:testDebugUnitTest passes. ktlintCheck reports nothing for the changed files. The new instrumented OpenCodeFloatingPillSemanticsTest passes on an emulator: the merged node has the custom description, a click action and no Text.
  • New unit tests on both platforms:
    • resolver: subagent permission, grandchild question, question behind a permission, nil cases
    • view model: collapsed → tap → paged, expanded, pulse counter bumps; show-dock pulse
  • End to end with the scenario harness against real servers, opencode v1 1.19.5 and v2 dev. Screenshots are in the comment below.
iOS v1 iOS v2 Android v1 Android v2
Needs input, subagent permission: tap pill, pages to it ✅ ✅ ✅ ✅
Same, from the collapsed panel ✅ ✅ ✅ ✅
Needs input, subagent question ✅ ✅ — ✅
Review permission pill pulses and expands ✅ — — —
Keyboard up (needs-input pill keeps its label, other corners hide) ✅ — ❌ not captured ❌ not captured
Busy run ✅ — ✅ —
Steering shown in the timeline ✅ — ✅ —
Scrolled up during a run (round ↓) ✅ — — —

Risks / Follow-ups

  • When several subagents wait, the tap opens the first one in spawn order. Its request may not be on page 1 of the panel, because the server orders requests differently.
  • Not checked:
    • Android keyboard-up: the emulator's soft keyboard did not come up under automation.
    • The "↓ N new" counter while scrolled up: only the round ↓ was seen.
    • The v2 queued → Up next → Steer flow: the harness gate was already released, so the turn did not hold.
    • TalkBack by ear. The semantics tree is covered by the instrumented test instead.
  • Stills don't show the pulse well. The two GIFs show the tap → expand.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Tapping the background work pill while a subagent waits now opens the
permission or question panel on that subagent's request, expanding it
if collapsed, instead of the Subagents sheet. The panel pulses briefly
after that tap and after "Review permission" / "Answer question"
(a fade with Reduce Motion on iOS, skipped with animations off on
Android). The Android floating pill now speaks only its description.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

End-to-end evidence (scenario harness, real opencode v1 1.19.5 and v2 dev)

Harness data only. Scenarios: permission-in-parallel-subagents, question-in-parallel-subagents, queued-prompt-while-busy, tool-long-turn.

Needs input: subagent permission

iOS v1: panel on 1 of 3 iOS v1: tap pill, pages to general (3 of 3) Android v2: panel on 1 of 3 Android v2: tap pill, pages to general

From the collapsed panel (collapsed on the session's own request)

iOS v1 collapsed + stack iOS v1 after tap iOS v2 collapsed iOS v2 after tap
Android v1 collapsed Android v1 after tap Android v2 collapsed Android v2 after tap

Tap → expand and pulse

iOS v1 Android v2

Needs input: subagent question

iOS v1 collapsed iOS v1 opened iOS v2 collapsed iOS v2 opened Android v2 collapsed Android v2 opened

Keyboard up, busy run, steering, scrolled up

iOS v1 keyboard up iOS v1 busy run iOS v1 steer in timeline iOS v1 scrolled up (↓) Android v1 busy run Android v1 steer in timeline

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: no finding that 2+ of 3 passes agreed on.

8 finding(s) from a single pass, not posted
  • android/app/src/main/java/dev/opencode/mobile/ui/components/chrome/OpenCodeFloatingPill.kt:275 high: clearAndSetSemantics after clickable strips click and role (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/SessionChatViewModel.kt:1763 medium: openWaitingSubagentRequest returns true when focus no-ops (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/SessionChatViewModel.swift:1411 medium: openWaitingSubagentRequest returns true when focus no-ops (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/view/SessionChatPanelPulse.kt:27 low: Panel pulse caches animator-scale and never observes it (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/SessionChatScreen.kt:968 low: Needs-input pill still announces "Open subagents" but now opens the request panel (deepseek-v4.1-flash)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/SessionChatView.swift:585 low: iOS needs-input pill still says "Open subagents" after changing its action (deepseek-v4.1-flash)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/region/SessionChatInbox.kt:168 low: Focus can silently skip paging while the click handler still reports success (deepseek-v4.1-flash)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/timeline/SessionChatBackgroundWork.kt:208 low: Question fallback opens another session's permission instead of the named subagent's request (deepseek-v4.1-flash)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.131 · 1 pass(es) stopped early

The pill now pages to the waiting request, so its spoken label says
"Open request" instead of "Open subagents" while a subagent waits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Follow-up on the review's single-pass notes:

  • Fixed (d738ced): iOS and Android needs-input pill still said "Open subagents". While a subagent waits, the spoken label now ends "Open request". Otherwise it still says "Open subagents". Tests updated on both apps.
  • Not a bug, clearAndSetSemantics after clickable: the click and role come from the outer modifier on the same node, and clearAndSetSemantics only clears what is inside it. TalkBack still reports a button with the click action.
  • Not a bug, openWaitingSubagentRequest returns true when focus no-ops (both apps) / focus skips paging: the target is computed from the same inbox snapshot focus reads, on the main thread, so the request can't vanish in between. Not paging while a reply is in flight is intentional (documented on focus). The panel still un-collapses and pulses.
  • Intended, question fallback opens the shown permission: a question waits behind any permission in the panel, so the permission the user would see first opens (documented on needsInputTarget).
  • Kept, pulse reads the animator scale once: it's read per composition of the panel. Changing Remove animations mid-session takes effect the next time the panel enters composition, which is fine for a 140 ms pulse.

@ivanfenenko
ivanfenenko merged commit 27fcb02 into main Nov 1, 2026
@ivanfenenko
ivanfenenko deleted the feature/906-connect-needs-input-pills branch November 1, 2026 15:26
@ivanfenenko ivanfenenko mentioned this pull request Nov 1, 2026
11 tasks done
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.

Session Chat: connect needs-input pill and prompt pills

1 participant