Repository navigation
feat(mobile): show persistent context controls - #5715
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryReviewed the follow-up react-test-renderer type-cast corrections in mounted context-control tests with high confidence and no blocking defects. Files Reviewed (7 files)
Previous Review Summaries (2 snapshots, latest commit 4d3ec77)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 4d3ec77)Status: No Issues Found | Recommendation: Merge Executive SummaryReviewed the follow-up save/restore busy-state wiring ( Files Reviewed (8 files)
Previous review (commit 48c4842)Status: No Issues Found | Recommendation: Merge Executive SummaryReviewed persistent mobile account-context controls, organization restore/save guards, and session display-scope wiring with high confidence and no blocking defects. Files Reviewed (19 files)
Reviewed by grok-4.6 · Input: 77.5K · Output: 3.5K · Cached: 78.5K Review guidance: REVIEW.md from base branch |
Summary
Maintainer changes
OrganizationContextValueaddsisSaving,error(restoreorsave), andretry; failed restoration keepsisLoadedfalse.Save failures retain the chosen account; Retry saves the latest choice, while
OrganizationState.token, generations, and authentication epochs prevent stale publication.setOrganizationIdkeeps its signature, andORGANIZATION_STORAGE_KEYstill stores an organization string or no value for Personal.Files
apps/mobile/src/lib/organization-context.tsx— Source; M; 145 changed lines; retains save warnings through retries and rejects outdated results after selection, authentication changes, or unmount.apps/mobile/src/lib/organization-context.mounted.test.tsx— Test; A; 317 changed lines; adds a mounted provider suite.ContextControlintroduces global account selection and read-onlyContextDisplayScopelabels;organizationId: nullexplicitly means Personal, andisResolvedprevents premature labels.useContextPickeruses supplied memberships and the native action sheet, including Personal for an empty result; cancellation changes nothing.Loading placeholders, accessible states, and Retry separate restoration, save, and membership failures; missing organizations stay selected and show an unavailable warning.
Files
apps/mobile/src/components/context-control.tsx— Source; A; 164 changed lines; adds scoped labels, membership loading, accessible selection and recovery, and safe-area spacing for the shared picker.apps/mobile/src/components/context-control.mounted.test.tsx— Test; A; 323 changed lines; adds a mounted context-control suite.SessionDetailContentProps.displayScopebecomes required so every session label describes that session, not the active global account.SessionDetailScreenresolves it from the route'sorganizationIdor fetchedorganization_id; loading and error headers retain the same read-only control.Unresolved session metadata keeps a placeholder, while the existing
AgentSessionProvidercontinues to own the session independently.Files
apps/mobile/src/app/(app)/agent-chat/[session-id].tsx— Source; M; 13 changed lines; supplies the resolved session scope to the pending, failed, and loaded presentations.apps/mobile/src/components/agents/session-detail-content.tsx— Source; M; 4 changed lines; requires the display scope and renders its account label beneath the session title.apps/mobile/src/app/(app)/agent-chat/[session-id].mounted.test.tsx— Test; M; 149 changed lines; revises mounted session-route coverage.apps/mobile/src/components/agents/session-detail-content.test.ts— Test; M; 71 changed lines; revises the session-detail suite.ScreenHeaderProps.contextadds optional content below the title, keeping account controls fixed on Home, Agents, and Quick Chat.Existing title actions, Back, history, filters, and right-side controls remain separate from the selector.
Callers that omit the slot keep the title-only layout.
Files
apps/mobile/src/components/screen-header.tsx— Source; M; 5 changed lines; accepts and renders the optional account-control slot beneath the title.apps/mobile/src/components/home/home-screen.tsx— Source; M; 9 changed lines; adds the shared selector outside the scrolling Home body.apps/mobile/src/components/agents/session-list-screen.tsx— Source; M; 2 changed lines; mounts the selector in the header independently of list loading, errors, and results.apps/mobile/src/components/quick-chat/quick-chat-screen.tsx— Source; M; 7 changed lines; mounts the selector before the keyboard-adjusted transcript and composer.apps/mobile/src/components/home/home-screen.mounted.test.tsx— Test; M; 57 changed lines; revises the mounted Home suite.apps/mobile/src/components/home/home-screen.test.ts— Test; M; 1 changed line; updates the Home test setup.apps/mobile/src/components/agents/session-list-screen.mounted.test.tsx— Test; M; 63 changed lines; revises the mounted Agents suite.apps/mobile/src/components/quick-chat/quick-chat-screen.mounted.test.tsx— Test; M; 58 changed lines; revises the mounted Quick Chat suite.CreditsCardreusesuseContextPickerand no longer hides account selection when the membership query returns an empty list.A save failure adds an accessible Retry with busy and disabled states; balance queries and billing permissions retain their existing rules.
Files
apps/mobile/src/components/profile-credits-card.tsx— Source; M; 66 changed lines; replaces the local picker implementation, labels its account button, and renders save recovery.apps/mobile/src/components/profile-credits-card.mounted.test.tsx— Test; M; 244 changed lines; revises the mounted credits-card suite.The mobile continuous integration (CI) workflow
kilo-app CIaccepts pull requests against any target branch, so stacked changes receive checks.It removes only
pull_request.branches;pull_request.paths, thepush.branchesrestriction tomain, jobs, permissions, and concurrency remain intact.Files
.github/workflows/kilo-app-ci.yml— Source; M; 1 changed line; removes the pull request target restriction without changing the push trigger.Tests: 9 files, 1,283 changed lines; added
organization-context.mounted.test.tsx,context-control.mounted.test.tsx; modified[session-id].mounted.test.tsx,session-detail-content.test.ts,session-list-screen.mounted.test.tsx,home-screen.mounted.test.tsx,home-screen.test.ts,quick-chat-screen.mounted.test.tsx,profile-credits-card.mounted.test.tsx.Generated: 0 changed files.
Verification
Local end-to-end verification on an iOS simulator, 2026-09-01. Seven of eleven checks passed. Four have partial coverage.
This section covers the stack's three PRs together: #5715, #5719, and #5721.
No product bug was found. No product source changed. The worktree stayed clean.
Test-harness limits, not defects
simctl biometric. Native simulator enrollment, match, and failure notifications were used instead.Setup
mobile-context-unlock-a61f-s3, simulator iOS 26.5.xcrun simctl io <udid> screenshot. Full report and images:/Users/igor/Projects/.scratch/local-e2e-context/.