Repository navigation
Split resource usage status responsibilities - #17244
Conversation
Greptile SummaryThe PR splits the monolithic Resource Usage status component into focused controller, action, derived-model, metric, tree, row, trigger, popover, summary, and dialog modules while retaining the existing facade and behavior.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx | Reduced to a facade that retains the popover composition and public row exports while delegating state and rendering. |
| src/renderer/src/components/status-bar/use-resource-usage-status-controller.ts | Owns the extracted store subscriptions, local state, polling effects, focus refs, derived model, and action composition. |
| src/renderer/src/components/status-bar/use-resource-usage-actions.ts | Encapsulates navigation, workspace cleanup, session termination, refresh sequencing, and post-kill focus restoration. |
| src/renderer/src/components/status-bar/use-resource-usage-derived-model.ts | Encapsulates resource merging, classification, counts, metrics, labels, and error-state derivation. |
| src/renderer/src/components/status-bar/resource-usage-popover-body.tsx | Extracts the resource popover body and footer composition with controller-provided state and callbacks. |
| src/renderer/src/components/status-bar/resource-usage-session-rows.tsx | Houses the preserved public session and worktree row components and their interaction affordances. |
| src/renderer/src/components/status-bar/resource-usage-resource-tree.tsx | Extracts repository and worktree sorting, grouping, collapse state, and row composition. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Segment[ResourceUsageStatusSegment facade] --> Controller[useResourceUsageStatusController]
Controller --> Derived[useResourceUsageDerivedModel]
Controller --> Actions[useResourceUsageActions]
Segment --> Trigger[Status trigger]
Segment --> Summary[Popover summary]
Segment --> Body[Popover body]
Body --> Tree[Resource tree]
Tree --> Rows[Worktree and session rows]
Segment --> Dialog[Kill confirmation dialog]
Actions --> Bridge[Preload PTY and workspace APIs]
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
…-bottom-4-prune-resolved
…-bottom-5-pane-tree-ops
…bottom-6-mobile-troubleshoot
…lines-bottom-7-external-manager
…es-bottom-8-attach-services
…s-bottom-9-hosted-review-creation
…ax-lines-bottom-10-automation-dispatch-events
… ra/max-lines-bottom-11-settings-navigation
…-lines-bottom-12-daemon-init
…ottom-13-gitlab-item-dialog
…lines-bottom-14-relay-dispatcher
…nes-bottom-15-mobile-host-screen
…lines-bottom-16-runtime-file-client
…-lines-bottom-17-ports-panel
…ottom-18-runtime-environments-pane
…ra/max-lines-bottom-19-local-pty-provider
…lines-bottom-20-cdp-bridge # Conflicts: # src/main/browser/cdp-bridge.ts
…ttom-21-git-handler
…ottom-22-linear-item-drawer
…lines-bottom-23-telemetry-events
…nes-bottom-24-resource-usage-status
…4-resource-usage-status # Conflicts: # src/renderer/src/hooks/automation-dispatch-completion.ts
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughThe resource usage status-bar component was refactored into a thin composition layer. New hooks manage state, derived resource data, polling, scan readiness, and actions. New modules render metrics, resource trees, session rows, popover sections, the trigger, and kill confirmation dialog. Existing source-based tests now inspect the extracted controller, derived model, and session-row files. ✨ Finishing Touches 💡 2⚔️ Resolve merge conflicts 💡
🛠️ Fix failing CI checks 💡
📝 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 |
* Split speech session lifecycle * Split terminal output scheduler pipeline * Split mobile browser pane modules * Prune resolved max-lines suppressions * Split pane tree equalization logic * Extract mobile troubleshoot screen styles * Split external automation manager * Split main window service attachments * Split hosted review creation checks * Split automation dispatch event handling * Split settings navigation metadata * Split daemon initialization lifecycle * Split GitLab item dialog * Split relay dispatcher layers * Split mobile host screen * Retarget mobile view settings source test * Split runtime file client layers * Split ports panel layers * Split runtime environments pane layers * Split local PTY provider responsibilities * Split CDP bridge responsibilities * Split relay Git handler responsibilities * Track moved relay Git fetch audit * Split Linear item drawer responsibilities * Split telemetry event schema responsibilities * Split resource usage status responsibilities * Fix F3-speech for stablyai#17123 * Fix F1-cycle for stablyai#17131 * Fix F4-navtest for stablyai#17157 * Fix F2-allowlist for stablyai#17161
Summary
Stacked on #17235.
Validation
pnpm tcpnpm tc:webpnpm run check:code-quality:changedpnpm check:max-lines-ratchet— 62 grandfathered suppressionspnpm run check:runtime-electron-ratchetgit diff --checkElectron validation
Validated through the real Resource Manager surface in the intended worktree. Live CPU/RSS values rendered; Orca expanded to Main/Renderer/Other; CPU sort state persisted across close/reopen; restart-daemon Cancel returned to the popover; and Clean up workspaces opened the real cleanup modal. Backing IPC returned the matching live RSS snapshot and zero PTY sessions. Renderer console: zero errors and one dev-only React Grab warning.
Visual proof attachment is N/A because this is an exact-parity refactor with no intended visual change; the rendered UI was exercised directly through Electron/CDP.