feat(coordination): reachability-split worklist + uniform hoisted layout - #174
Conversation
Split the unified worklist's "Needs you" into reachability buckets: Awake (act now) for live/sessionless actionable agents and Asleep (wake to act) for offline ones, then Handled and Unreachable. Bucket now dominates the worklist sort so each group renders contiguously. Make offline visually distinct: add a dormant `sleep` tone (the old `offline` tag used `attn`, byte-identical to the gold selection accent) and encode reachability in the leading dot (● awake / ◐ asleep / ○ gone). De-jank entering an offline agent: switch to the dashboard screen before the resume runs, so its renderDashboard() is coherent instead of painting the dashboard under a "coordination" screen-state. Footer says [Enter] wake for asleep rows (and drops Enter for gone rows). Unify the subscreen top header with the dashboard's (version tag, runtime dot, dev badge, full-width rule); only the descriptor changes per screen. Add breathing room between worklist bucket groups. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract the dashboard's body composition — centered content block, scrolling main column with ▲/▼ affordances, whitespace-separated right details pane, and full-width footer rule — into composeScreenFrame, and route the dashboard and all five subscreens through it. Removes the central vertical "│" divider on the subscreens (they now use the dashboard's 3-space separator) and makes every screen's chrome uniform. Delete the now-dead composeSplitScreen / composeTwoPaneLines host methods and their dashboard-ops implementations, plus the orphaned test stubs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 2 hours, 47 minutes, and 30 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR splits the coordination worklist "needs-you" bucket into ChangesReachability Buckets & Screen Frame Refactor
Sequence Diagram(s)sequenceDiagram
participant UI as TUI Renderer
participant openCoordinationNotification
participant composeScreenFrame
participant activateSession as activateSession/Service
UI->>openCoordinationNotification: notification selected (Enter)
openCoordinationNotification->>openCoordinationNotification: compute targetState
alt target missing
openCoordinationNotification-->>UI: flash "missing" footer, render coordination screen
else target offline
openCoordinationNotification->>UI: switch to dashboard screen
openCoordinationNotification->>activateSession: activate (wake)
activateSession-->>openCoordinationNotification: failure
openCoordinationNotification-->>UI: failOpen → flash error, render dashboard/coordination
else target live
openCoordinationNotification->>activateSession: activate (open)
activateSession-->>openCoordinationNotification: failure
openCoordinationNotification-->>UI: failOpen → flash error
end
sequenceDiagram
participant Renderer as SubscreenRenderer
participant buildCoordinationWorklist
participant composeScreenFrame
participant composeTwoPane
Renderer->>buildCoordinationWorklist: sessions, notifications
buildCoordinationWorklist-->>Renderer: needsYou (awake/asleep rows), tail (handled/unreachable rows)
Renderer->>Renderer: map rows to reachabilityDot + bucketRule labels
Renderer->>Renderer: compute footerLines (wake / open / no-enter by reachability)
Renderer->>composeScreenFrame: header, content, footerLines, focusLine, scrollOffset, twoPane, rightPanel
composeScreenFrame->>composeTwoPane: leftLines, rightPanel renderer
composeTwoPane-->>composeScreenFrame: merged body
composeScreenFrame-->>Renderer: ScreenFrameResult (frame, scrollOffset)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Switch to the dashboard screen only just before activating an offline target, and render the dashboard (not coordination) on activation failure, so failure feedback lands on the screen we end up on. Also compute the worklist tail by explicit bucket membership instead of an O(n²) exclusion scan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/coordination-model.ts`:
- Around line 271-278: The secondary urgency calculation in the
notificationUrgency function can grow unbounded and exceed the 1,000,000 bucket
stride, causing buckets to interleave and break contiguous group rendering. Cap
the secondary value to ensure it remains less than the bucket stride of
1,000,000 by either clamping the individual component factors or using Math.min
to limit the total secondary value to a maximum that preserves the bucket
boundaries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 85c9b018-852c-4488-9450-ef7fb81aa9ed
📒 Files selected for processing (12)
docs/mockups/coordination-view.htmlsrc/coordination-model.test.tssrc/coordination-model.tssrc/multiplexer/dashboard-ops.tssrc/multiplexer/dashboard-tail-methods.tssrc/multiplexer/notifications.test.tssrc/multiplexer/notifications.tssrc/tui/render/screen-frame.tssrc/tui/render/theme.tssrc/tui/screens/dashboard-renderers.tssrc/tui/screens/subscreen-renderers.test.tssrc/tui/screens/subscreen-renderers.ts
💤 Files with no reviewable changes (3)
- src/tui/screens/subscreen-renderers.test.ts
- src/multiplexer/notifications.test.ts
- src/multiplexer/dashboard-tail-methods.ts
Cap the within-bucket secondary term below the 1,000,000 bucket stride so a high unread/pending/attention total can never push an item past its bucket boundary and fragment the contiguous group rendering. Unify the notification and thread urgency through one bucketUrgency helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Continues the Coordination/TUI polish arc. Three changes:
Reachability-split worklist — the unified Coordination "Needs you" group now splits by reachability into Awake · act now (live/sessionless actionable) and Asleep · wake to act (offline actionable), then Handled and Unreachable. Bucket now dominates the worklist sort so each group renders as one contiguous run.
Offline is visually distinct + Enter is honest — added a dormant
sleeptone (the oldofflinetag usedattn=\x1b[1;33m, byte-identical to the gold selection accent, so offline read as selection). Reachability is encoded in the leading dot (●awake /◐asleep /○gone). Entering an offline agent no longer breaks: it switches to the dashboard screen before the resume runs (soresumeOfflineSessionWithFeedback'srenderDashboard()is coherent instead of painting the dashboard under acoordinationscreen-state), and the footer says[Enter] wakefor asleep rows.Hoisted shared layout — extracted the dashboard's body composition (centered content block, scrolling column with ▲/▼, whitespace-separated details pane, full-width footer rule) into
composeScreenFrame, and routed the dashboard + all five subscreens through it. This removes the central vertical│divider from the subscreens and makes every screen's chrome uniform (top header and bottom footer). DeadcomposeSplitScreen/composeTwoPaneLineshost methods removed.Subscreen top headers also now mirror the dashboard exactly (version tag, runtime dot, dev badge, full-width rule).
Test plan
yarn typecheck✅yarn lint✅yarn vitest run— 1466 tests ✅yarn build✅0.1.21-tui-iabuild across all screens.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Refactor
Documentation