Repository navigation
Rank activity status groups by attention level - #19329
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe change centralizes activity thread status classification in Merge Risk: ⚪ Minimal · up to Activity status groups now prioritize attention-needing states and fresh working activity is reflected in threads and unread counts. Monitoring snapshots are excluded from activity events, removing the previously identified misleading monitoring-event presentation risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, solution, scope, visual impact, tests, and compatibility considerations. However, the required Linked Issue entry is empty, and the required validation commands are not confirmed as passing or covered by CI. Resolution Add a valid issue reference after
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Centralized status classification —
activityThreadStatusId()inactivity-thread-presentation.tsbecomes the single predicate for interrupted detection, withthreadAgentState()andthreadAgentStateLabel()deriving from it. Theinterrupted → doneglyph mapping (#2569) is preserved. - Rank-based group ordering —
ACTIVITY_STATUS_GROUP_RANKreplaces the old order array, andbuildActivityThreadGroups()now sorts status-mode groups deterministically rather than relying on thread recency. Relative ordering for reachable states matches the prior array (waiting < blocked < interrupted < working < monitoring < done). - Header/row state agreement —
getActivityThreadGroup()status branch now emitsstate: threadAgentState(thread), so status group headers mirror their row dots (previously headers in status mode never carried astate). - Cleanup — dead
groupActivityThreadsByStatus(),threadStatusGroupId(),ActivityStatusGroupId, and theid/done:interruptedkey are removed;isClearableActivityThreadnow uses the shared classifier with unchanged semantics.
Verified with no dangling references to any removed symbol, and ran the affected suites (47 tests across 4 files, all green) plus check:code-quality:changed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
aa447e2 to
69fd8d3
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 1fe97971-2f96-4822-afbf-a3a3ff5f2f22
📒 Files selected for processing (8)
src/renderer/src/components/activity/ActivityPrototypePage.test.tssrc/renderer/src/components/activity/activity-event-build-cache.tssrc/renderer/src/components/activity/activity-event-builder.bounded-history.test.tssrc/renderer/src/components/activity/activity-event-builder.identity-reuse.test.tssrc/renderer/src/components/activity/activity-event-builder.tssrc/renderer/src/components/activity/activity-pane-events.tssrc/renderer/src/components/activity/activity-thread-presentation.tssrc/renderer/src/components/activity/activity-thread-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Important
Monitoring/background agents (workingMode: 'monitoring') now emit a working activity event — see the inline comment on activity-pane-events.ts:106. This re-introduces the row/header disagreement the PR is otherwise removing and should be fixed before merge.
Reviewed changes
- Emit
workingevents for fresh live turns —ActivityEventStatewas widened to the fullAgentStatusStateunion and aliveStateinput was threaded throughbuildPaneActivityEvents/resolvePaneBuildso a fresh liveworkingturn now produces a feed event with working read receipts. isHistoricalActivityStatereplacesisActivityEventState— history reconstruction stays bounded to done/blocked/waiting, soworkingliveness is established only from the current entry rather than from history.- Cache liveness guard —
resolvePaneBuildnow comparesrequest.liveStateandstateStartedAt(liveMatchesCache) so live-state transitions rebuild events instead of serving stale cached ones. - Working branches in presentation helpers —
agentTitle/agentSummary/agentMetagainedworkingbranches (search-text surface only). - Tests — added identity-reuse and bounded-history coverage for working-event read receipts and live-turn event counts.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Establishes consistent group ordering by introducing an attention-based ranking system, ensuring status groups maintain a fixed order regardless of thread recency. Consolidates thread status classification logic into `activityThreadStatusId` and simplifies group key naming.
Activity events now emit working state for current turns, enabling attention ranking above historical states.
- Remove working-state events from cap logic so live turns stay visible - Count fresh working/monitoring as unread in Activity badge - Extract state-checking to activity-event-state module - Use agentStatusEpoch for freshness-based invalidation
The unread receipt is keyed on turn boundaries (stateStartedAt), not heartbeats (updatedAt). Only the epoch matters; read the status map directly via getState() to avoid wasteful re-renders on same-turn heartbeats.
Monitoring turns should surface only via the 'monitoring' snapshot in the live state, not as separate working events that would contradict the snapshot signal.
69fd8d3 to
4b2e3dd
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Monitoring turns no longer emit a
workingevent —buildPaneActivityEventsnow keys the live branch onargs.liveState === 'working'rather than!== null, so background/monitoring turns surface only through their'monitoring'snapshot. The prior row/header-disagreement finding is resolved and pinned by a regression assertion (expect(result.events).toHaveLength(0)for a monitoring turn). - Fresh working/monitoring turns count as unread —
countActivityUnreadnow counts fresh live turns alongside historical done/blocked/waiting, with receipts keyed onstateStartedAtand freshness decay delegated to the sharedfreshActivityLiveAgentState. - Titlebar badge subscribes to
agentStatusEpoch— the hook swappedsortEpochforagentStatusEpoch, the signal the live reducer and freshness scheduler actually bump for the count's invalidation needs; a real-slice freshness test covers same-turn heartbeats, stale-boundary decay, and revive. - Working events bypass the history caps —
capActivityEventsfiltersworkingevents out of the per-pane/global caps before re-sorting them back in, so live turns never evict retained done/blocked/waiting history. - Extracted
activity-event-state.ts—freshActivityLiveAgentStateandisHistoricalActivityStateare consolidated into a shared module used by the builder, pane-events, and unread count.
Verified the 8 changed/added test files locally (55 tests, all green).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Problem
The activity view's status group ordering relied on array position, which caused attention-needing statuses (waiting, blocked, interrupted) to be buried under newer Done/Working threads. The interrupted status logic was scattered across multiple functions, making it hard to maintain.
Solution
Replaced the array-based group order with a numeric ranking system (
ACTIVITY_STATUS_GROUP_RANK) that assigns consistent priorities regardless of thread recency. Centralized the interrupted predicate intoactivityThreadStatusId()as the single source of truth for status classification. Status group headers now mirror row states to prevent visual disagreement.What Changed
activityThreadStatusId()inactivity-thread-presentation.tsas the single classifier for all status-related logicACTIVITY_STATUS_GROUP_ORDERarray withACTIVITY_STATUS_GROUP_RANKRecord for deterministic orderingbuildActivityThreadGroups()to rank groups only in status mode'done:interrupted'to'interrupted'for clarityVisual Proof
N/A — reordering of existing UI elements; no new components or styling changes.
Testing
Added
activity-thread-grouping.status-order.test.tswith comprehensive ordering tests: verifies attention-needing statuses rank above Done even when newer, confirms fixed group order regardless of recency, validates thread order within groups remains newest-first, tests header state consistencyUpdated existing tests in
ActivityPrototypePage.test.tsandActivityPrototypePage.thread-grouping.test.tsto match new APII manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Rank ordering is applied deterministically in status-grouping mode only. Other grouping modes (project, worktree, agent) preserve thread-recency ordering. No platform-specific logic added.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)