Repository navigation
refactor(comments): slim verbose comments in renderer state (store/hooks/lib) - #9545
Conversation
…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>
📝 WalkthroughWalkthroughThe pull request primarily revises inline documentation across renderer components, hooks, store slices, runtime synchronization, web compatibility adapters, and tests. It also adds the exported 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 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.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9f2bfafd-c4f8-4de9-8799-525e232cac60
📒 Files selected for processing (36)
src/renderer/src/App.tsxsrc/renderer/src/hooks/useAutoAckViewedAgent.tssrc/renderer/src/hooks/useComposerState.tssrc/renderer/src/hooks/useEditorExternalWatch.tssrc/renderer/src/hooks/useIpcEvents.tssrc/renderer/src/lib/agent-status.test.tssrc/renderer/src/lib/agent-status.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.tssrc/renderer/src/lib/pane-manager/terminal-arabic-shaping-joiner.tssrc/renderer/src/lib/telemetry.tssrc/renderer/src/lib/use-tab-agent.tssrc/renderer/src/lib/workspace-session.tssrc/renderer/src/lib/worktree-activation.tssrc/renderer/src/lib/worktree-status.tssrc/renderer/src/runtime/sync-runtime-graph.tssrc/renderer/src/runtime/web-runtime-session.tssrc/renderer/src/runtime/web-session-tabs-sync.tssrc/renderer/src/store/slices/agent-status.tssrc/renderer/src/store/slices/browser.tssrc/renderer/src/store/slices/diffComments.tssrc/renderer/src/store/slices/editor.tssrc/renderer/src/store/slices/github.tssrc/renderer/src/store/slices/repos.tssrc/renderer/src/store/slices/store-cascades.test.tssrc/renderer/src/store/slices/store-session-cascades.test.tssrc/renderer/src/store/slices/tabs.test.tssrc/renderer/src/store/slices/tabs.tssrc/renderer/src/store/slices/terminals-hydration.test.tssrc/renderer/src/store/slices/terminals.tssrc/renderer/src/store/slices/ui.tssrc/renderer/src/store/slices/worktree-nav-history.tssrc/renderer/src/store/slices/worktrees.test.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/web/web-preload-api.tssrc/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. */ |
There was a problem hiding this comment.
📐 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. */ |
There was a problem hiding this comment.
📐 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 theoxlint-disable max-linesdirective and split the file to satisfy the threshold.src/renderer/src/store/slices/github.ts#L1-L1: remove theeslint-disable max-linesdirective 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
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>
…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>
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
Why:paragraphs → one-line why-statements.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.{/* … */}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 bothorigin/mainand the change and confirming the remaining code tokens are identical.pnpm typecheck✅ ·oxlint✅ (no new findings vsmain).Part of a set of 6 area PRs from one sweep.
🤖 Generated with Claude Code
Made with Orca 🐋