Skip to content

feat(mobile): two-row home header and session order by message activity - #595

Merged
huichen merged 3 commits into
mainfrom
claude/mobile-compact-header
Sep 13, 2026
Merged

huichen merged 3 commits into
mainfrom
claude/mobile-compact-header

Conversation

@huichen

@huichen huichen commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Mobile home: two-row toolbar

The home screen used to stack three rows (device bar, category tabs, search + select). The tab row and the search/select row are now one row.

Default (two rows)

[monitor  device name v]        (badge) (gear)
[ Workspace | Conversations ]     (search) (select)
  • Device selector, connection badge and settings keep row 1 unchanged.
  • Row 2 is the category switch plus search and multi-select buttons; "new conversation" stays on the existing FAB.
  • Search replaces the toolbar in place (autofocus + cancel) instead of adding a third row; it stays scoped to the current category.
  • Selection replaces the toolbar in place (select-visible, count, delete, cancel). Cancel stays enabled while offline so selection can always be exited.
  • Android back closes search or selection instead of leaving a hidden filter.
  • Every control keeps a >= 44pt touch target and the toolbar keeps a stable height, so the list does not jump between modes.

SessionsScreen no longer renders a tab row; onTabChange is delegated to SessionList, which owns the single toolbar.

Session ordering by last message activity

Ordering already used COALESCE(last_message_at, updated_at, created_at) DESC, but last_message_at was only stamped when a run was created (a user prompt). Assistant output therefore never moved a conversation. The desktop observer now records activity on message content and run terminals too, so a reply that lands in a background conversation brings it to the top.

  • Source time, never receipt time: last_message_at is written from the event's authoritative RFC3339 timestamp; a projection snapshot derives it from agent_start.started_at_ms + agent_end.duration_ms (a snapshot has no per-event timestamps). Replay attaches after a reconnect therefore cannot bump a conversation that has newer real activity, or corrupt the shared desktop/mobile order with local clock skew.
  • Monotonic and idempotent: the update is guarded by last_message_at IS NULL OR last_message_at < ?1, so an older event, a duplicate cursor or a re-delivered sequence is a no-op.
  • Bounded writes: token deltas are coalesced to at most one write per second; prompts and terminals (user_message / agent_end / error) always flush so a settled reply keeps its exact final time.
  • Not activity: opening a conversation (last_opened_at), renaming, pinning and settings/heartbeat events (model_changed, usage, stream_retry, ...) leave ordering alone. Pinned threads still sort first.
  • A changed activity timestamp marks the shared catalog dirty, so the desktop sidebar and the pushed mobile snapshot converge on the same order.

Tests

  • store::threads: new assistant_activity_reorders_threads_without_replay_or_metadata_bumps (assistant output beats a newer prompt; older/duplicate replay ignored; rename/open do not reorder; pins still win; deleted thread untouched; updated_at preserved).
  • agent_bridge::observer: new message_activity_uses_source_time_and_ignores_settings_and_missing_timestamps and message_activity_advances_on_output_and_flushes_terminal_without_replay_bumps.
  • Mobile: new toolbar/search/selection tests in SessionList.test.ts (mode switching in place, no extra row, cancel restores the filter, Android back closes search, selection stays cancellable offline) and updated SessionsScreen.test.ts (no tab row; category switching delegated).
  • Ran: mobile tsc --noEmit + eslint + full jest (882 passed); desktop cargo fmt --check, cargo clippy --all-targets -D warnings, cargo clippy --no-default-features --all-targets -D warnings, plus the store/observer/runs/remote_host test modules under both GUI and headless feature sets. The Windows-only pre-existing failures in git_review / shadow_review::repository / transfer_loop_* / best_effort_canonical* / is_desktop_chat_cwd* are unchanged (CI runs these on Linux).

@huichen
huichen enabled auto-merge (squash) September 13, 2026 10:38
@huichen
huichen merged commit cacd626 into main Sep 13, 2026
12 checks passed
@huichen
huichen deleted the claude/mobile-compact-header branch September 13, 2026 10:45
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