Skip to content

refactor(comments): slim verbose comments in renderer state (store/hooks/lib) - #9545

Merged
nwparker merged 1 commit into
mainfrom
nwparker/slim-comments-renderer-state
Jul 20, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/slim-comments-renderer-state

Conversation

@nwparker

@nwparker nwparker commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Slim verbose code comments — renderer — store, hooks, lib, runtime

Part of a codebase-wide sweep to slim over-verbose comments per AGENTS.md → Document the "Why", Briefly. Comments should state the non-obvious why, not narrate the what/how when the code is already clear; multi-line blocks collapse to a single line.

This PR — renderer — store, hooks, lib, runtime: 36 files changed, 1673 insertions(+), 5677 deletions(-).

What changed

  • Multi-line Why: paragraphs → one-line why-statements.
  • Deleted comments that merely restated the adjacent code.
  • Kept: license headers, directives (eslint-disable, @ts-expect-error, oxlint-disable, …), TODO/FIXME, JSDoc tags, and every genuine non-obvious reason / external reference (issue numbers, platform quirks, race & ordering constraints).
  • useEffect / regex / bitwise / concurrency: kept a ≤1-line summary where it aids reading.
  • JSX {/* … */} comment text shortened; comments inside template-literal strings left untouched.

Safety

Every file in this PR is comments-only — enforced deterministically by stripping all comments (incl. JSX {/* */}) from both origin/main and the change and confirming the remaining code tokens are identical. pnpm typecheck ✅ · oxlint ✅ (no new findings vs main).

Part of a set of 6 area PRs from one sweep.

🤖 Generated with Claude Code

Made with Orca 🐋

…oks/lib)

Collapse multi-line explanatory comment blocks into single-line "why" statements
per AGENTS.md ("Document the Why, Briefly"): drop restatements of the code and
mechanism narration; keep the non-obvious reason, external refs, and directives.

Comments-only — verified no code changed via a Babel/esbuild comment-strip
token-equality gate against origin/main; typecheck and oxlint clean.

Area: renderer — store, hooks, lib, runtime. 36 files changed, 1673 insertions(+), 5677 deletions(-).

Co-authored-by: Orca <help@stably.ai>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request primarily revises inline documentation across renderer components, hooks, store slices, runtime synchronization, web compatibility adapters, and tests. It also adds the exported EditorViewMode type, refines editor state and conflict reconciliation behavior, tightens live-PTY-based agent counting, and changes web file-watch handling so “starting” responses return before replay processing. A terminal backlog warning string is also updated.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description misses required template sections such as Screenshots, Testing, AI Review Report, Security Audit, and Notes. Add the missing template sections and fill in Screenshots, Testing, AI Review Report, Security Audit, and Notes, including the required cross-platform review details.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.31% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: a comments-only refactor that trims verbose renderer comments.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9f2bfafd-c4f8-4de9-8799-525e232cac60

📥 Commits

Reviewing files that changed from the base of the PR and between 53aeeb7 and 24e9d5c.

📒 Files selected for processing (36)
  • src/renderer/src/App.tsx
  • src/renderer/src/hooks/useAutoAckViewedAgent.ts
  • src/renderer/src/hooks/useComposerState.ts
  • src/renderer/src/hooks/useEditorExternalWatch.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/lib/agent-status.ts
  • src/renderer/src/lib/launch-agent-in-new-tab.ts
  • src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.ts
  • src/renderer/src/lib/pane-manager/terminal-arabic-shaping-joiner.ts
  • src/renderer/src/lib/telemetry.ts
  • src/renderer/src/lib/use-tab-agent.ts
  • src/renderer/src/lib/workspace-session.ts
  • src/renderer/src/lib/worktree-activation.ts
  • src/renderer/src/lib/worktree-status.ts
  • src/renderer/src/runtime/sync-runtime-graph.ts
  • src/renderer/src/runtime/web-runtime-session.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/renderer/src/store/slices/agent-status.ts
  • src/renderer/src/store/slices/browser.ts
  • src/renderer/src/store/slices/diffComments.ts
  • src/renderer/src/store/slices/editor.ts
  • src/renderer/src/store/slices/github.ts
  • src/renderer/src/store/slices/repos.ts
  • src/renderer/src/store/slices/store-cascades.test.ts
  • src/renderer/src/store/slices/store-session-cascades.test.ts
  • src/renderer/src/store/slices/tabs.test.ts
  • src/renderer/src/store/slices/tabs.ts
  • src/renderer/src/store/slices/terminals-hydration.test.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/store/slices/worktree-nav-history.ts
  • src/renderer/src/store/slices/worktrees.test.ts
  • src/renderer/src/store/slices/worktrees.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/renderer/src/web/web-runtime-client.ts

the NewWorkspaceComposerCard reads or mutates, so both the full-page composer
and the global quick-composer modal can consume a single unified source of
truth without duplicating effects, derivation, or the create side-effect. */
/* eslint-disable max-lines -- Why: co-locates all NewWorkspaceComposerCard state so the full-page composer and quick-composer modal share one source of truth. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Do not disable max-lines in TypeScript files.

Both of these files use an eslint-disable max-lines directive. As per coding guidelines for **/*.{js,jsx,ts,tsx}, you must "Never disable ESLint or Oxlint max-lines, including line-specific disables". Please remove these directives to ensure compliance. If these files exceed the maximum length, they should ideally be refactored into smaller modules.

  • src/renderer/src/hooks/useComposerState.ts#L1-L1: Remove the /* eslint-disable max-lines */ directive.
  • src/renderer/src/store/slices/diffComments.ts#L1-L1: Remove the /* eslint-disable max-lines */ directive.
📍 Affects 2 files
  • src/renderer/src/hooks/useComposerState.ts#L1-L1 (this comment)
  • src/renderer/src/store/slices/diffComments.ts#L1-L1

Source: Coding guidelines

/* oxlint-disable max-lines -- Why: output ordering, foreground settle, queue
state, and e2e diagnostics share one state machine; splitting it would make the
backlog/resume guarantees harder to audit. */
/* oxlint-disable max-lines -- Why: output ordering, foreground settle, queue state, and e2e diagnostics form one state machine; splitting it would make backlog/resume guarantees harder to audit. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚖️ Poor tradeoff

Remove max-lines linter disables. As per coding guidelines, you must never disable ESLint or Oxlint max-lines rules, including line-specific/file-level disables. Consider refactoring or splitting the files instead of disabling the rule.

  • src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.ts#L1-L1: remove the oxlint-disable max-lines directive and split the file to satisfy the threshold.
  • src/renderer/src/store/slices/github.ts#L1-L1: remove the eslint-disable max-lines directive and extract slices or logic to smaller modules to satisfy the threshold.
📍 Affects 2 files
  • src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.ts#L1-L1 (this comment)
  • src/renderer/src/store/slices/github.ts#L1-L1

Source: Coding guidelines

@nwparker
nwparker merged commit 0f72508 into main Jul 20, 2026
7 checks passed
@nwparker
nwparker deleted the nwparker/slim-comments-renderer-state branch July 20, 2026 10:18
just-zzp added a commit to just-zzp/orca that referenced this pull request Jul 20, 2026
Resolved 6 adjacency conflicts with the comment-slimming refactors
(stablyai#9542/stablyai#9544/stablyai#9545/stablyai#9546): kept Mission additions and the
useCustomActivationOnly activation guard, adopted main's slimmed
comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…oks/lib) (stablyai#9545)

Collapse multi-line explanatory comment blocks into single-line "why" statements
per AGENTS.md ("Document the Why, Briefly"): drop restatements of the code and
mechanism narration; keep the non-obvious reason, external refs, and directives.

Comments-only — verified no code changed via a Babel/esbuild comment-strip
token-equality gate against origin/main; typecheck and oxlint clean.

Area: renderer — store, hooks, lib, runtime. 36 files changed, 1673 insertions(+), 5677 deletions(-).

Co-authored-by: Orca <help@stably.ai>
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