Skip to content

fix(mobile): make the session context circle tappable in every state - #6190

Merged
iscekic merged 1 commit into
mainfrom
kwf/context-circle-always-tappable-33a0
Sep 16, 2026
Merged

iscekic merged 1 commit into
mainfrom
kwf/context-circle-always-tappable-33a0

Conversation

@iscekic

@iscekic iscekic commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Changelog for users

  • The context circle in a session header now opens the Context usage sheet in every session state, including while the transcript is loading and after a failed load.
  • Tapping the circle always reaches the session's Auto-approve setting; the setting no longer disables itself while the session is still connecting.
  • A session known to be read-only still shows Auto-approve as unavailable.
  • The circle keeps its position and hit area, so no state leaves an invisible, untappable placeholder in the header.
  • The header layout stays put when usage data or transcript rows arrive.

Changelog for maintainers

  • canAutoApprovePermissions (session-auto-approve.ts) treats an unresolved transport (null) as available; only a session known to be read-only is unavailable.
  • getContextSheetMountState (context-usage-display.ts) mounts the sheet once it has been opened for the current session, even before usage or permission controls are known; visibility still requires the matching session identity.
  • SessionContextMetrics (session-context-metrics.tsx) bases pressability on onPress != null; hidden now applies only to the no-onPress placeholder.
  • SessionDetailContent (session-detail-content.tsx) always passes the sheet-opening onPress; it no longer gates the callback on context info or auto-approve availability.
  • The states that swallowed the tap were data-gated pressability and an unmounted sheet, not an overlay, a disabled parent, or a zero-size hit area.
  • Review first: sheet mount/unmount when the open session changes, and that read-only sessions still render the unavailable Auto-approve row.
  • No schema, API, environment, or navigation changes.

E2E proof

Owner request

Surface: the mobile app (apps/mobile).

The context circle at the top right is not always tappable, and settings now
live behind it, so a state that swallows the tap locks the user out of them.

Reproduce it first: find the states where the tap does not register -- an
overlay above it, a disabled prop, a parent that stops touches, a zero-size
hit area -- and name each one. Then make the control tappable in every state.
Fix the cause that covers all of them if there is one.

Verify live: tap the circle and reach settings from every screen that shows
it, including the states that used to swallow the tap. Capture the ones that
were broken.

The bar is best-in-class UX. A change that works but feels worse than
the rest of the app is not done: the states, the spacing, the motion and
the wording match what the app already does well.

[e4] While the offline banner is visible (airplane mode), tap the context circle: the sheet still opens (proves the banner overlay does not swallow the tap). — android emulator-5554; offline banner raised with fault.sh down nextjs plus wifi/data off, then restored (up nextjs + radio enable). e4-run.log line 1 'SCENE e4 OK' with no MISS lines, and its closing digest carries both 'No internet connection' [0,128][1080,223] and the pill 'Context 17,763 of 1,310,720 tokens, 1% used, cost 1 cent. Tap to view context details.'; the ordered steps asserted the banner before tapping that pill and asserted 'Context usage' and 'Auto-approve' after, so the context sheet opened while the banner was up (e4-offline-banner.log holds the same banner+pill digest as a…

e4-offline-tap.mp4.trim.mp4

[e4] While the offline banner is visible (airplane mode), tap the context circle: the sheet still opens (proves the banner overlay does not swallow the tap). — android emulator-5554; offline banner raised with fault.sh down nextjs plus wifi/data off, then restored (up nextjs + radio enable). e4-run.log line 1 'SCENE e4 OK' with no MISS lines, and its closing digest carries both 'No internet connection' [0,128][1080,223] and the pill 'Context 17,763 of 1,310,720 tokens, 1% used, cost 1 cent. Tap to view context details.'; the ordered steps asserted the banner before tapping that pill and asserted 'Context usage' and 'Auto-approve' after, so the context sheet opened while the banner was up (e4-offline-banner.log holds the same banner+pill digest as a…

[e4] While the offline banner is visible (airplane mode), tap the context circle: the sheet still opens (proves the banner overlay does not swallow the tap). — prior/e4-offline-banner.png

[e4] On a read-only session, tap the context circle: the sheet opens with usage details and the Auto-approve row shown as unavailable. — android emulator-5604: after the circle on the read-only fixture was tapped, e4-scene.log (lines 146-182) holds 'android.view.View Context usage', 'android.view.ViewGroup session-auto-approve-row', 'android.widget.TextView Auto-approve', 'android.widget.TextView This session cannot receive permission asks.' and 'android.widget.TextView 1,375 of 1,000,000 tokens' beside 'android.widget.TextView Mobile sheet fixtures'/'ses_000000000001RootFixture001'; the run's only MISS was its end anchor 'Agents, tab, 2 of 3' (the sheet hides the tab bar), no assertion failed, replay banked at e4.replay.json…

[e4] On a read-only session, tap the context circle: the sheet opens with usage details and the Auto-approve row shown as unavailable. — e2e-mobile-app/e4.png

[e3] Context usage sheet opens on a loaded session showing a PR badge next to the circle — android emulator-5554: e3c-scene.log line 7 shows 'android.widget.Button open pull request #1' beside the circle on the loaded session, and after tapping the circle e3d-scene.log shows 'android.view.View Context usage' with 'session-auto-approve-row' and 'Auto-approve' (stills e3c.png/e3d.png left for the visual reviewer); no functional UX defect observed in the states visited.

[e3] Context usage sheet opens on a loaded session showing a PR badge next to the circle — prior/e3d.png

[e4] On a read-only session, tap the context circle: the sheet opens with usage details and the Auto-approve row shown as unavailable. — android emulator-5604: after the circle on the read-only fixture was tapped, e4-scene.log (lines 146-182) holds 'android.view.View Context usage', 'android.view.ViewGroup session-auto-approve-row', 'android.widget.TextView Auto-approve', 'android.widget.TextView This session cannot receive permission asks.' and 'android.widget.TextView 1,375 of 1,000,000 tokens' beside 'android.widget.TextView Mobile sheet fixtures'/'ses_000000000001RootFixture001'; the run's only MISS was its end anchor 'Agents, tab, 2 of 3' (the sheet hides the tab bar), no assertion failed, replay banked at e4.replay.json…

[e4] While the offline banner is visible (airplane mode), tap the context circle: the sheet still opens (proves the banner overlay does not swallow the tap). — e4.png

Follow-ups (not changed here)

  • not proved live: - [e2] empty session that already reports context usage: tap the context circle: reported not_applicable, so nothing proves it (android emulator-5604: plan defect, not a repair — no fixture or live flow produces a session that reports context usage with zero transcript rows (the app deri) — reported not_applicable: the plan names a branch the product does not contain
  • not proved live: - [e2] On an empty session that already reports context usage (no transcript rows), tap the context circle: the Context usage sheet opens with the usage details.: reported not_applicable, so nothing proves it (android emulator-5604: plan defect, not a repair — no fixture or live flow produces a session that reports context usage with zero transcript rows; e2probeB.log) — reported not_applicable: the plan names a branch the product does not contain

Open findings (not fixed here)

  • [e1] Open a remote/cloud-agent session whose transcript is still loading (no messages yet) and tap the context circle at the top right: the Context usage sheet opens and the Auto-approve row is operable (this state used to swallow the tap).
  • [e1] $KILO_WORKFLOW/e2e/appium.sh script /home/igor_kilocode_ai/.local/share/kwf/sections/context-circle-always-tappable-33a0/e2e-mobile-app/repro-e1.json --out /home/igor_kilocode_ai/.local/share/kwf/sections/context-circle-always-tappable-33a0/e2e-mobile-app/repro-e1
  • [e1] Open a remote/cloud-agent session whose transcript is still loading (no messages yet) and tap the context circle: android emulator-5554: stalled remote ses_f58f9defbffeqQ021yyhnzmEAj mounted with no messages as 'Couldn't load this session' / 'Failed to load session details' and no context circl
  • [e3] Context usage sheet opens on a loaded session showing a PR badge next to the circle
  • [e3] On a loaded session that shows a PR badge next to the circle, tap the circle: the Context usage sheet opens (happy-path regression guard).
  • [e3] $KILO_WORKFLOW/e2e/appium.sh script /home/igor_kilocode_ai/.local/share/kwf/sections/context-circle-always-tappable-33a0/e2e-mobile-app/repro-e3.json --out /home/igor_kilocode_ai/.local/share/kwf/sections/context-circle-always-tappable-33a0/e2e-mobile-app/repro-e3
  • [e3] Context usage sheet opens on a loaded session showing a PR badge next to the circle: proof audit: the capture does not show the claim (e3d.png): Context usage sheet shown, but capture lacks the claimed PR badge. (original note: android emulator-5554: e3c-scene.log line 7 shows 'android.widget.B
  • the '## E2E proof' section links a file path, which 404s on GitHub
e4-offline-tap.mp4

@iscekic
iscekic marked this pull request as draft September 15, 2026 22:31
Comment thread apps/mobile/src/components/agents/context-usage-display.ts Outdated
Comment thread apps/mobile/src/components/agents/session-auto-approve.ts
@kilo-code-bot

kilo-code-bot Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The follow-up commit addresses both prior findings on changed lines: an open request recorded before usage is reported no longer dismisses the sheet, and auto-reply eligibility is now split from settings reachability. No new defects found in the changed code.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Files Reviewed (5 files)
  • apps/mobile/src/components/agents/context-usage-display.ts - prior warning resolved; isOpenIdentityForModel keeps an identity without provider/model matching when usage arrives, and still unmounts for a different session/model
  • apps/mobile/src/components/agents/context-sheet-mount-state.test.ts - new coverage matches the fixed mount rule
  • apps/mobile/src/components/agents/session-auto-approve.ts - prior suggestion resolved; canAutoApproveReply adds the resolved-transport requirement for reply eligibility
  • apps/mobile/src/components/agents/session-auto-approve.test.ts - new coverage for the reply gate
  • apps/mobile/src/components/agents/session-detail-content.tsx - reply hook now receives canAutoApproveReply; row state still uses canAutoApprovePermissions

Notes

  • canAutoApproveReply rejects activeSessionType === null, so an unresolved transport can no longer auto-answer a permission ask, while the settings row stays reachable.
  • No new subscriptions, listeners, timers, or effects were added; the memory-leak check remains clean.
  • No .md documentation files were changed in this PR.
Previous Review Summary (commit 2d23c92)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 2d23c92)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

The new "open the sheet in every state" path stores an identity without provider/model, so on a read-only session the sheet dismisses itself the moment usage data arrives.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/components/agents/context-usage-display.ts 249 Pressing the circle before usage is reported stores providerID/modelID as undefined; once usage arrives the provider/model equality fails, visible flips to false, the reset effect clears the identity, and the sheet closes itself (read-only sessions, where autoApproveAvailable is false).

SUGGESTION

File Line Issue
apps/mobile/src/components/agents/session-auto-approve.ts 40 The same boolean feeds planAutoApproveReply's available ("can receive permission asks"), so an unresolved transport now counts as answerable; consider separating settings reachability from reply eligibility.
Files Reviewed (8 files)
  • apps/mobile/src/components/agents/context-sheet-mount-state.test.ts - test updates aligned with the new mount rule
  • apps/mobile/src/components/agents/context-usage-display.ts - 1 issue
  • apps/mobile/src/components/agents/session-auto-approve.test.ts - test updates only
  • apps/mobile/src/components/agents/session-auto-approve.ts - 1 issue
  • apps/mobile/src/components/agents/session-context-metrics.test.ts - test updates only
  • apps/mobile/src/components/agents/session-context-metrics.tsx - pressability now follows onPress; no new defect found
  • apps/mobile/src/components/agents/session-detail-content.test.ts - new coverage only
  • apps/mobile/src/components/agents/session-detail-content.tsx - always passes onPress; no new defect found

Notes

  • The sheet stays mounted more often (autoApproveAvailable is true while the transport is null), but the invisible sheet does not enable its activeSessions.listInstances query (session-context-sheet.tsx:371-376), and clearAllAtoms still clears the sheet's inputs, so no leak or stray polling was introduced.
  • No new subscriptions, listeners, timers, or effects were added, so the memory-leak check is clean.
  • Comment at session-detail-content.tsx:276 ("an unresolved transport is unavailable, so the row shows disabled without a fetch") now contradicts the new behavior; it is on an unchanged line, so it is noted here rather than commented inline.

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

@iscekic
iscekic force-pushed the kwf/context-circle-always-tappable-33a0 branch from 2d23c92 to 1b8ab24 Compare September 15, 2026 23:08
@iscekic
iscekic marked this pull request as ready for review September 15, 2026 23:28
@iscekic iscekic added the human-ready The PR is ready for human review. label Sep 15, 2026
@iscekic iscekic self-assigned this Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants