Repository navigation
feat(mobile): sort chats needing attention first on Workspaces home - #388
Conversation
Chats waiting on an approval or a question now sort above working chats, which sort above idle chats, in both the per-workspace sections and the Recent list on iOS and Android. Tiers mirror the desktop Needs attention view and rank by the existing displayRowState, so stale server attention on an idle chat never promotes it. The sort is stable, so rows within a tier keep their recency order. Workspace section order is unchanged; its newest-activity time now uses the newest chat rather than the first row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
very-hermes-bot
left a comment
There was a problem hiding this comment.
Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.
| let regularChats = aidenNeedsAttentionFirst( | ||
| chats | ||
| .filter { workspaceByID[$0.workspaceId] != nil } | ||
| .sorted { left, right in | ||
| left.updatedAt == right.updatedAt ? left.id < right.id : left.updatedAt > right.updatedAt | ||
| } | ||
| ) |
There was a problem hiding this comment.
[P2 · logic] Shipping target test scripts/check-ios-shipping-target.test.mjs fails due to exact regex match on let regularChats = chats
Confidence: 0.95
In scripts/check-ios-shipping-target.test.mjs:862, the test asserts /var chats: \[AidenChatSummary\][\s\S]*?let regularChats = chats[\s\S]*?filter \{ workspaceByID\[\$0\.workspaceId\] != nil \}/u, which fails because chats is now wrapped in aidenNeedsAttentionFirst(...).
Repair: Update the regex in scripts/check-ios-shipping-target.test.mjs:862 to match let regularChats = aidenNeedsAttentionFirst( so npm run test:ios-release passes in CI.
Hermes Review BotConfidence: 5 Engine: SummaryMobile chat lists across the iOS and Android Workspaces home are now triaged into urgency tiers ( Confidence Score: 5/5Both Android and iOS implementations, pure sorting functions, projection models, call sites, and unit test suites were traced and verified end-to-end against desktop parity and edge cases. 📁 Important Files Changed
FindingsNo findings. Sequence DiagramUnchanged or not applicable for this change. []
|
There was a problem hiding this comment.
Important
The iOS projection change breaks npm run test:ios-release through a stale source-pattern assertion. Fix that validation failure before merging; no sorting correctness issues were found.
Reviewed changes across both native clients, including the sidebar projections, screen consumers, and behavioral tests.
- Attention ordering: Approval, input, and working chats precede idle chats, preserving recency within each tier and using the existing activity-authoritative display state.
- Sidebar integration: Workspace previews and Recents inherit the ordering, while maximum chat timestamps preserve workspace section order. Search, ownership filtering, and pagination storage remain unchanged.
- Coverage and validation: Both clients add four behavioral tests. The focused Android suites report 34 passing tests; iOS release validation fails on the assertion noted inline. Native XCTest execution was unavailable on this Linux runner.
gpt-6.1-sol | 𝕏
…attention-sort # Conflicts: # android/app/src/main/java/sbtbiswas/AidenOnTheGo/features/workspaces/AidenChatRowStatus.kt
Apply the attention ordering to a separate triagedChats binding so the existing iOS shipping-target contract still finds the owned-chat filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review, focusing on the iOS validation fix and the intervening merge from main.
- Restored shipping validation: Kept the recency-sorted
regularChatsintermediate and applied attention ordering throughtriagedChats, preserving the ordering in both workspace sections and Recents. - Integrated main changes: Updated the Android activity-indicator import and test accessor without changing attention ranking.
- Verified the fix: Ran
npm run test:ios-release; all 20 Ruby tests and 32 Node tests passed. Inspected the existing behavioral projection tests; native XCTest execution remains unavailable on this Linux runner.
gpt-6.1-sol | 𝕏

Summary
Item P1 #5 from the Hermex ↔ Aiden Mobile deep dive (matrix #23). This change is client-only. There is no server or protocol change and no contract revision bump.
On the iOS and Android Workspaces home, chats are now ordered by triage tier. Within each tier they keep the existing recency order.
The tiers mirror desktop's
SIDEBAR_ATTENTION_TIERSfrom #311. The Unread tier is left out, so idle chats stay in plain recency order.aidenNeedsAttentionFirstplusattentionRank.AidenChatRowStatus.ktModels/AidenChat.swiftdisplayRowStatefrom feat(chats): chat row states and honest unread markers #280. Localactivitydecides whether a chat is idle, so a stale server attention state on a finished chat never promotes it.sortedisn't guaranteed to be stable.projectAidenWorkspaceSidebar/AidenWorkspaceSidebarProjection.make).newestActivityAtnow uses the newest chat time, because the first row is no longer always the newest.This diff avoids the screen files touched by #374 and #377. It changes only the pure functions, the projection, and tests.
Tests
AidenChatRowStatusTestadds 4 tests. They check that:newestActivityAtfix.AidenAppearanceTestsinAidenChatTests.swiftadds the same 4 tests../gradlew :app:testDebugUnitTest(full Android unit suite) passes.xcodebuild testwith Xcode-beta on the iPhone 17 Pro simulator: theAidenChatTestsandAidenAppearanceTestsclasses pass (the 4 new tests included).CI notes
scripts/check-ios-shipping-target.test.mjs, which expectslet regularChats = chats … filter. Commit0f4fa2e95fixes it without changing behaviour by applying the ordering to a separatetriagedChatsbinding.npm run test:ios-releasepasses locally.0f4fa2e95, each time on a different test that this PR doesn't touch. It is listed here per the flaky-test policy. The rerun was used, so I did not rerun again.AidenNativeIntegrationTests.testBinaryContractRejectionsEmitExactlyOneDiagnosticEach()(0.054s, no assertion text in the log): https://github.com/sambitcreate/aiden-agent/actions/runs/37724264025/job/113139113108. It passed 3 out of 3 times locally (Xcode-beta, iPhone 17 Pro simulator).AidenChatTests.testDraftRestorationDoesNotResumeAfterRemovingAnUploadedAttachment(): https://github.com/sambitcreate/aiden-agent/actions/runs/37724264025/job/113147980239.🤖 Generated with Claude Code
CI flake log
iOS build and simulator testsfailed on0f4fa2e95:AidenNativeIntegrationTests.testBinaryContractRejectionsEmitExactlyOneDiagnosticEach()after the simulator reported "Failed to launch app with identifier: sbtbiswas.AidenOnTheGo" (same symptom as feat(remote): let phones observe and control runs started elsewhere #359). Unrelated to this diff. Reran failed jobs once: https://github.com/sambitcreate/aiden-agent/actions/runs/37724264025Rerun (attempt 2) failed on a different pre-existing test:
AidenChatTests.testDraftRestorationDoesNotResumeAfterRemovingAnUploadedAttachment()—XCTAssertFalse failed - The held read must be released by the test(AidenChatTests.swift:3687, 18.7 s; the held-disk-read helper timed out on the CI simulator), again followed by "Failed to launch app". Neither test touches the sidebar projection. Same run link, attempt 2. Rerun budget used; not rerunning again.