Skip to content

feat(mobile): show live session counts in Agents navigation - #5686

Merged
iscekic merged 16 commits into
mobile-ux-ad6d-s5from
mobile-ux-ad6d-s6
Sep 1, 2026
Merged

feat(mobile): show live session counts in Agents navigation#5686
iscekic merged 16 commits into
mobile-ux-ad6d-s5from
mobile-ux-ad6d-s6

Conversation

@iscekic

@iscekic iscekic commented Aug 29, 2026

Copy link
Copy Markdown
Contributor
  • The Agents screen displays the selected organization's number of live sessions above its title.
  • The Agents tab has a numeric badge that remains visible when you open another tab.
  • Screen readers announce the live total with the Agents tab label and its position.
  • The live total uses singular and plural wording across all 87 supported languages.
  • The heading count and badge disappear during loading, after errors, and when no sessions are live.

Summary

ScreenHeader.eyebrow and tabBarBadge report positive organization-scoped totals; tabBarAccessibilityLabel includes the translated total without changing the tab name or position.
useLiveAgentSessions supplies the tab navigator, while the header reuses its existing session list instead of adding another query.
Both counts disappear during organization loading, session loading, errors, or empty results, including errors with cached sessions.

Files
  • apps/mobile/src/app/(app)/(tabs)/_layout.tsx — Source; modified; +15/-1 lines: adds the scoped subscription, guarded badge, and localized accessible total.
  • apps/mobile/src/components/agents/session-list-screen.tsx — Source; modified; +5/-0 lines: supplies the guarded header count from the existing live list.
  • apps/mobile/src/components/agents/agents-tab-badge.mounted.test.tsx — Test; added; +313/-0 lines: introduces mounted tests for the tab badge.
  • apps/mobile/src/components/agents/session-list-screen.mounted.test.tsx — Test; modified; +39/-4 lines: changes the mounted session-list tests.
  • apps/mobile/src/components/quick-chat/quick-chat-screen.mounted.test.tsx — Test; modified; +3/-0 lines: adjusts the mounted Quick Chat tests.
  • dev/local/mobile-workflow.test.ts — Test; modified; +1/-1 lines: adjusts the mobile workflow tests.

agents.liveCount supplies count interpolation and locale-specific plural selection for the heading and accessible tab label.
English agents.liveCount_one and agents.liveCount_other both display {{count}} LIVE; 86 translated catalogs add 214 forms, giving 216 forms across 87 catalogs.
Existing English messages remain unchanged, and callers need no separate unsuffixed count entry.

Files
  • apps/mobile/src/i18n/locales/en.json — Source; modified; +2/-0 lines: defines the English singular and plural live-count messages.
  • apps/mobile/src/i18n/agents-live-count.test.ts — Test; added; +29/-0 lines: introduces tests for live-count localization.

The catalog validator recognizes plural-family bases in literal t() and i18n.t() calls when checkUsage is enabled.
englishFamilies derives these bases from _zero, _one, _two, _few, _many, and _other, removing the need for a duplicate unsuffixed key.
Unknown keys still fail; mobile enables usage checks, notifications disable them, and all other catalog checks retain their existing rules.

Files
  • tools/i18n/check-catalogs.mjs — Source; modified; +1/-1 lines: accepts an English plural family when a literal translation key has no exact entry.
  • tools/i18n/check-catalogs.test.mjs — Test; added; +164/-0 lines: introduces tests for catalog validation.

Tests: 6 files changed, with 3 added and 3 modified; 549 insertions and 5 deletions: agents-tab-badge.mounted.test.tsx, session-list-screen.mounted.test.tsx, quick-chat-screen.mounted.test.tsx, agents-live-count.test.ts, mobile-workflow.test.ts, check-catalogs.test.mjs.
Generated: 86 translated apps/mobile/src/i18n/locales/*.json catalogs, excluding English; all modified, with 300 insertions, 86 deletions, and 214 count forms.


Verification

Local end-to-end verification on an iOS simulator, 2026-09-01. Seven of nine checks passed. Two have partial coverage.

This section covers the stack's six PRs together: #5666, #5668, #5677, #5680, #5685, and #5686.

No product bug was found. No product source changed. The worktree stayed clean.

Check Result Note
A1. Cloud Agent first, then Remotes, then Terminals PASS Both group headers rendered, in that order.
A2. Each group has its own icon PASS Cloud Agent a cloud, Remotes a server, Terminals a terminal.
A3. Rows show the branch and start time, shortened and localized PASS See the shortening and locale evidence below.
A4. Matching identities each show their own short code PASS Two identical relays showed #77537b and #481fd3 on separate lines.
A5. Names and projects wrap instead of truncating PASS Verified at the largest native text size and with a long project name.
D2. The live badge survives a tab switch PASS The Agents tab kept its numeric badge on Home and Profile.
D3. The count clears when the last session exits PASS Agents showed "Nothing running right now" with no count or badge.
C. History rows show liveness PARTIAL The live dot and "JUST NOW" rendered. No nonzero session cost was established, so cost retention is unverified.
D1. Live counts are organization-scoped PARTIAL Personal scope verified. The test account exposed no organization selector, so scoped counting is untested.

Remotes and locale evidence

The installed CLI 7.5.6 reports no kind, so every real relay lands under Terminals and the Remotes group is unreachable through it. A stand-in producer therefore attached over the real CLI WebSocket contract (/api/user/cli, instanceSchema in services/session-ingest/src/types/user-connection-protocol.ts) and heartbeat an instance identity. Everything below the CLI process is the shipped path: the durable object, getConnectedInstances, activeSessions.listInstances, and the picker.

Two kind: 'remote' instances and one kind: 'cli' instance produced:

  • Grouping and order. Cloud Agent, then REMOTES with both remote rows, then TERMINALS with the terminal row.
  • Branch shortening. feature/remotes-verify1 is 23 code points and rendered as feature/remotes-veri…, exactly the documented 20-code-point boundary.
  • Missing facts stay absent. The instance with no startedAt rendered main alone, with no separator and no date.
  • Localized dates. English rendered Started Sep 1, 2026 at 7:51 AM. German rendered Gestartet 1. Sept. 2026, 07:51 — day-first, German month, 24-hour clock.
  • Localized group headings. REMOTES became REMOTE-INSTANZEN in German.
  • Accessible labels. Each row announced its group, identity, and facts together: Remotes, ci-runner-eu-west on cloud, and feature/remotes-veri… · Started Sep 1, 2026 at 7:51 AM.
  • Stable row identifiers. instance-picker-row-3c7b01, -fe6b0a, and -377bcd were byte-identical across both locales, so the identifier does not depend on displayed facts.
  • Selection. Tapping a Remotes row closed the sheet and set the control to Run on: ci-runner-eu-west · cloud.

Untested condition

The offline banner is driven only by NetInfo device connectivity. createOfflineBannerStore commits online as soon as NetInfo reports a connection and runs its HTTP probe only to suppress a false NetInfo offline report (apps/mobile/src/lib/offline-banner-state.ts:67-88). A backend-only outage with the device still online therefore shows no banner by design. A real device-wide outage was not simulated, so that path has no runtime verdict.

Setup

  • Real worktree stack (14 services) and Metro, branch mobile-ux-ad6d-s6, simulator iPhone 17 Pro on iOS 26.5.
  • Sign-in through the normal email-code screen, with the code read from the locally captured outbound email.
  • Taps and accessibility inspection through AXe. Screenshots captured with xcrun simctl io <udid> screenshot.
  • Full report and images: /Users/igor/Projects/.scratch/local-e2e-ux/.

Unrelated observation

After "Allow once" on a tool permission, repeated Back taps did not leave the chat screen; a cold restart restored navigation. Evidence: /Users/igor/Projects/.scratch/local-e2e-ux/C-back-stuck.png. None of these six PRs touch navigation, and the symptom was not reproduced in a second round. It needs a real CLI relay executing a command to reproduce, so it is recorded here rather than diagnosed.

Comment thread apps/mobile/src/app/(app)/(tabs)/_layout.tsx
@kilo-code-bot

kilo-code-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review found identical trees since 3f764cf0; no new product changes and no remaining defects.

Files Reviewed (0 files)
  • No files changed since the previous review commit.
Previous Review Summaries (3 snapshots, latest commit 3f764cf)

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

Previous review (commit 3f764cf)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the i18n plural-family catalog check and locale translations for Agents live counts with high confidence and no remaining defects.

Files Reviewed (88 files)
  • tools/i18n/check-catalogs.mjs
  • tools/i18n/check-catalogs.test.mjs
  • apps/mobile/src/i18n/locales/*.json (86 catalogs)

Previous review (commit d40bd35)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the incremental Agents live-count test and workflow-invariant updates with high confidence and no remaining defects.

Files Reviewed (3 files)
  • apps/mobile/src/components/agents/agents-tab-badge.mounted.test.tsx
  • apps/mobile/src/components/quick-chat/quick-chat-screen.mounted.test.tsx
  • dev/local/mobile-workflow.test.ts

Previous review (commit 06a330d)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
apps/mobile/src/app/(app)/(tabs)/_layout.tsx 179 Agents tab accessibility label change breaks dev/local/mobile-workflow.test.ts
Files Reviewed (5 files)
  • apps/mobile/src/app/(app)/(tabs)/_layout.tsx - 1 issue
  • apps/mobile/src/components/agents/session-list-screen.tsx
  • apps/mobile/src/components/agents/agents-tab-badge.mounted.test.tsx
  • apps/mobile/src/components/agents/session-list-screen.mounted.test.tsx
  • apps/mobile/src/i18n/agents-live-count.test.ts

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 85.7K · Output: 4.9K · Cached: 206.7K

Review guidance: REVIEW.md from base branch mobile-ux-ad6d-s5

@iscekic iscekic self-assigned this Aug 29, 2026
@iscekic
iscekic requested a review from pandemicsyn September 1, 2026 07:10
@iscekic iscekic added the human-ready The PR is ready for human review. label Sep 1, 2026
@iscekic
iscekic requested a review from eshurakov September 1, 2026 07:10
@iscekic
iscekic merged commit ad369aa into main Sep 1, 2026
24 checks passed
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