Skip to content

Split resource usage status responsibilities - #17244

Merged
nwparker merged 55 commits into
mainfrom
ra/max-lines-bottom-24-resource-usage-status
Aug 30, 2026
Merged

nwparker merged 55 commits into
mainfrom
ra/max-lines-bottom-24-resource-usage-status

Conversation

@nwparker

@nwparker nwparker commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2083 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1614 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​469

Summary

  • split the 1,658-line Resource Usage status component into focused controller, action, derived-model, metrics, tree, row, trigger, popover, summary, and dialog modules
  • preserve the original component fiber, hook/effect ownership and order, public three-export facade, callbacks, rendered element signatures, strings, comments, and user-visible behavior
  • reduce the max-lines baseline from 63 entries to 62; the largest new TSX module is 266 lines and the largest new TS module is 241 lines

Stacked on #17235.

Validation

  • pnpm tc
  • pnpm tc:web
  • full status-bar suite: 45 files, 298 tests
  • post-audit-fix focused suite: 6 files, 19 tests
  • direct Oxlint and changed-file formatting check
  • pnpm run check:code-quality:changed
  • pnpm check:max-lines-ratchet — 62 grandfathered suppressions
  • pnpm run check:runtime-electron-ratchet
  • git diff --check
  • exact runtime-literal, JSX signature, comment, hook-order, callback-body, call-count, and module-cycle reconciliation
  • two independent refactor audits: clean
  • real-commit move-check: 49 adjudicated vanished lines, 410 module-boundary/import/formatting/stable-dependency appearances

Electron 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.

@greptile-apps

greptile-apps Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

The 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.

  • Moves state, polling, subscriptions, and lifecycle coordination into a dedicated controller hook.
  • Moves navigation, cleanup, and session termination callbacks into an actions hook.
  • Separates derived resource models from presentation modules.
  • Preserves the ResourceUsageStatusSegment, SessionRow, and WorktreeRow exports.
  • Updates structural tests and removes the component from the max-lines baseline.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

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]
Loading

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

…ax-lines-bottom-10-automation-dispatch-events
…lines-bottom-20-cdp-bridge

# Conflicts:
#	src/main/browser/cdp-bridge.ts
…4-resource-usage-status

# Conflicts:
#	src/renderer/src/hooks/automation-dispatch-completion.ts
@nwparker
nwparker changed the base branch from ra/max-lines-bottom-23-telemetry-events to main August 30, 2026 03:20
@nwparker
nwparker merged commit 80a6bd6 into main Aug 30, 2026
4 of 20 checks passed
@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5add752c-5266-4c80-9681-4696da00f079

📥 Commits

Reviewing files that changed from the base of the PR and between 23009d9 and 745eef2.

📒 Files selected for processing (15)
  • config/max-lines-baseline.txt
  • src/renderer/src/components/hover-reveal-touch-action-visibility.test.ts
  • src/renderer/src/components/status-bar/ResourceUsageStatusSegment.session-polling.test.ts
  • src/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsx
  • src/renderer/src/components/status-bar/resource-session-classification-parity.test.ts
  • src/renderer/src/components/status-bar/resource-usage-kill-dialog.tsx
  • src/renderer/src/components/status-bar/resource-usage-metrics.tsx
  • src/renderer/src/components/status-bar/resource-usage-popover-body.tsx
  • src/renderer/src/components/status-bar/resource-usage-popover-summary.tsx
  • src/renderer/src/components/status-bar/resource-usage-resource-tree.tsx
  • src/renderer/src/components/status-bar/resource-usage-session-rows.tsx
  • src/renderer/src/components/status-bar/resource-usage-status-trigger.tsx
  • src/renderer/src/components/status-bar/use-resource-usage-actions.ts
  • src/renderer/src/components/status-bar/use-resource-usage-derived-model.ts
  • src/renderer/src/components/status-bar/use-resource-usage-status-controller.ts

📝 Walkthrough

Walkthrough

The 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 💡
  • Resolve merge conflict in branch ra/max-lines-bottom-24-resource-usage-status
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* 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
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