Skip to content

refactor(src): drop comments the code can say, part 9 of 9 - #4076

Merged
devswha merged 2 commits into
mainfrom
refactor/no-comment-src-9
Nov 17, 2026
Merged

devswha merged 2 commits into
mainfrom
refactor/no-comment-src-9

Conversation

@devswha

@devswha devswha commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What

Part 9 of 9 for src/ in the repo-wide comment pass. This part covers:

  • src/components: the chat view, composer, command palette, confirm dialog, connection line and route mark, the CLIProxy sign-in and the composer notices, with their CSS
  • src/lib: the sent-waiting check, session history and its retry, session stats, settings and their history, the setup guide and its flow, sheet history, workspace order and paths, worktree branches and the WebSocket client (ws.ts)
  • src/ itself: main.tsx, the PWA and theme bootstraps, and styles.css below its theme blocks
  • the tests of all of these

About 2,500 comment lines go. Security notes, platform facts, measured values, third-party attributions, and traps that name a concrete breakage stay (the owner's rule for comment-removal PRs). What else stays:

  • styles.css lines 1–1625 whole: the theme blocks and the notes around them, which bun run generate:themes reads and which name where each palette came from.
  • Attribution: the Herdr app (Apache-2.0) in styles.css, t3code in workspacePath.ts.
  • A pinned fixture: settings.legacy-fixture.ts names the commit it was copied from.

Every change was checked against origin/main by syntax tree (CSS with comments stripped). No test, script or doc reads a deleted comment, and no code changes.

This PR touches the WebSocket client and queued input (ws.ts, Composer, sentWaiting.ts), with comments and no code changed there, so it waits for a real review (AGENTS.md).

Rules that only a comment stated (deleted, not enforced yet)

Left open (redesigns, not done here)

  • ChatView: whether the reader still follows the end (onScroll with stickToBottom, manualLayout, pagingAway, scrollbarPress) needed about 120 lines of prose and could be one typed state machine; cancelledAtSend and goingCancel are two records for one idea; the module-level lastPrompts and cardTexts maps belong in a store; revealTurn pages until the pick settles.
  • Composer: onSend returns boolean | string | DraftRefusal | Promise<…> and takes five positional flags (a typed result and an options object); fitStatus measures twice; COMMIT_WAIT_MS and placeWaitingMentions keep loose timer state.
  • CommandPalette: the {key, index} pick with hand-written rules for rows that move or leave; plugin-run claims per opening and per PC.
  • ws.ts HerdrSocket: its per-pane maps (superseded, unconfirmed, lostInput, the secret counts) form a protocol state machine that needs named types.
  • workspaceOrder.ts: ReorderCoordinator's epochs, read_seq/moved_seq and boot proofs could be typed values; state is a test-only reader on the production class.
  • sentWaiting.ts: newerThanSend's four clock rules could be named checks; said copies what the terminal does to a sent message; markUnanswered uses up turns through a shared set in an order only prose explained.
  • settingsHistory.ts reconcile: eleven branches over buried, foreign and sheet-taken entries need a type.
  • setupGuideFlow.ts alertsHere: its truth table (feat(guide): Setup: N left in the sidebar, and three first-start hints #3907) could be a table in code.
  • settings.ts readChosen: about twenty "kept in a key of its own" constants re-explain one stored-format problem.
  • Smaller items: worktreeBranches.ts's null branch means both "detached" and "not known yet"; main.tsx and theme-bootstrap.ts depend on side-effect import order (one bootstrap call would do).

Validation

  • bun run check fast: passed (18,593 unit tests, typecheck, build, generated themes and types).
  • Unit tests of every touched test file and of the modules that import a touched one: 18 + 16 + 29 files, i18n.test.ts, the theme tests and src/conventions.test.ts included. All pass.
  • Not run: browser regressions (comments only).

🤖 Generated with Claude Code

devswha and others added 2 commits November 18, 2026 04:51
The last src/ slice of the repo-wide comment pass: the chat view,
composer, command palette, confirm dialog and connection marks, the
sent-waiting check, session history and its retry, settings and their
history, the setup guide flow, sheet history, workspace order and
paths, worktree branches, the WebSocket client, main.tsx, the PWA and
theme bootstraps and styles.css below its theme blocks, with their
tests. About 2,800 comment lines go; security, trap, platform and
measured notes stay (the owner's rule for comment-removal PRs), as do
the theme-block notes in styles.css and the attribution lines. Comments
only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved conversation scrolling and follow behavior, and made search-match restoration use the current conversation view.
    • Prompt answers now clear the remembered prompt and refresh the conversation and prompt state.
    • Improved handling of pending sends when the conversation timeline has not yet changed.
  • Tests
    • Expanded coverage for conversation history, navigation, settings, setup flows, and connection behavior.

The pull request removes or shortens explanatory comments across application components, libraries, tests, and stylesheets. It also updates several test assertions and makes a small number of implementation edits in transcript handling, waiting-send observation, and CommandPalette row construction.

Changes: Application changes

Layer / File(s) Summary
Chat transcript and navigation
src/components/ChatView.tsx, src/components/CLIProxyLogin.tsx
Comments and JSDoc are removed or shortened. The supplied summaries also describe changes to scroll handling, search-match restoration, and prompt-answer handling.
Palette, composer, and dialog components
src/components/CommandPalette*, src/components/Composer*, src/components/CompactPair*, src/components/ConfirmDialog*, src/components/ConnectPhoneDialog.css, src/components/Connection*, src/components/ChunkFailureNotice.test.tsx, src/components/codeFailureText.ts
Comments are removed or shortened across component code, styles, and tests. CommandPalette stores the selected workspace label in a local variable before passing it to taskRowLines.
Waiting sends and session history
src/lib/sentWaiting.ts, src/lib/sessionHistory*, src/lib/sessionStats.ts
Documentation is removed or revised. observeWaitingClock records unchanged reads and schedules markUnanswered when sends are pending; associated session-history tests retain their assertions.
Settings implementation and tests
src/lib/settings*
Comments are removed or shortened. Tests retain settings checks and add an assertion for the default --chat-w token.
Settings and sheet history tests
src/lib/settingsHistory*, src/lib/sheetHistory*
Comments are removed from history logic and tests. The tests add or adjust assertions for traversal, sheet markers, and Settings history behavior.
Setup guide flow
src/lib/setupGuide*
Comments are removed or shortened. Tests add cases for signed-in agent selection and retry tile states, and change the expected next incomplete setup step.
Workspace ordering and paths
src/lib/workspaceOrder.ts, src/lib/workspacePath*, src/lib/worktreeBranches*
Comments are removed or shortened; the described implementations and remaining assertions are unchanged.
WebSocket, PWA, and shared styles
src/lib/ws*, src/main.tsx, src/motion.test.ts, src/pwa*, src/relay-resource-worker.test.ts, src/styles*, src/theme-bootstrap.ts
Comments are removed or shortened. WebSocket tests add a hold-only submission case; PWA, application, style, and theme-bootstrap changes otherwise retain their described behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Merge Risk: Minimal · up to 694ec

This change mostly removes explanatory comments and makes a few small refactors and test adjustments, with no identified behavior change. The merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "refactor(src): drop comments the code can say, part 9 of 9" matches the changeset, which removes explanatory comments across src/ with no runtime code changes. It is specific about the type…
Description check Passed The description follows the template's Change and Validation sections. It explains what was changed and why, and it lists the checks run and the ones skipped (browser regressions). It does not include…
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.
Full details: Title check

Explanation

The title "refactor(src): drop comments the code can say, part 9 of 9" matches the changeset, which removes explanatory comments across src/ with no runtime code changes. It is specific about the type of change, though 'part 9 of 9' is series-numbering noise rather than a description of the change.

Full details: Description check

Explanation

The description follows the template's Change and Validation sections. It explains what was changed and why, and it lists the checks run and the ones skipped (browser regressions). It does not include the template's HTML comment about CONTRIBUTING.md or changelog.d, and it does not state whether a changelog entry was added. It also does not link an issue, though the template only asks for one for features, and this is a comment-only refactor.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 30ba8bf and 694ec83.

Files selected for processing: 56

  • src/components/CLIProxyLogin.tsx
  • src/components/ChatView.tsx
  • src/components/ChunkFailureNotice.test.tsx
  • src/components/CommandPalette.appLayout.test.tsx
  • src/components/CommandPalette.css
  • src/components/CommandPalette.tsx
  • src/components/CompactPair.css
  • src/components/CompactPair.tsx
  • src/components/Composer.css
  • src/components/Composer.tsx
  • src/components/ComposerBarePick.test.tsx
  • src/components/ComposerCounting.test.tsx
  • src/components/ComposerCrossTab.test.tsx
  • src/components/ComposerNotices.css
  • src/components/ComposerNotices.tsx
  • src/components/ComposerPasteSend.test.tsx
  • src/components/ComposerRestored.test.tsx
  • src/components/ConfirmDialog.css
  • src/components/ConfirmDialog.tsx
  • src/components/ConnectPhoneDialog.css
  • src/components/ConnectionLine.tsx
  • src/components/ConnectionRouteMark.test.tsx
  • src/components/ConnectionRouteMark.tsx
  • src/components/codeFailureText.ts
  • src/lib/sentWaiting.ts
  • src/lib/sessionHistory.test.ts
  • src/lib/sessionHistory.ts
  • src/lib/sessionHistoryRetry.test.ts
  • src/lib/sessionStats.ts
  • src/lib/settings.hook.test.ts
  • src/lib/settings.legacy-fixture.ts
  • src/lib/settings.test.ts
  • src/lib/settings.ts
  • src/lib/settingsHistory.test.ts
  • src/lib/settingsHistory.ts
  • src/lib/setupGuide.ts
  • src/lib/setupGuideFlow.test.ts
  • src/lib/setupGuideFlow.ts
  • src/lib/sheetHistory.skips.test.ts
  • src/lib/sheetHistory.test.ts
  • src/lib/workspaceOrder.ts
  • src/lib/workspacePath.test.ts
  • src/lib/workspacePath.ts
  • src/lib/worktreeBranches.test.ts
  • src/lib/worktreeBranches.ts
  • src/lib/ws.test.ts
  • src/lib/ws.ts
  • src/main.tsx
  • src/motion.test.ts
  • src/pwa-notification.test.ts
  • src/pwa.test.ts
  • src/pwa.ts
  • src/relay-resource-worker.test.ts
  • src/styles-wco.test.ts
  • src/styles.css
  • src/theme-bootstrap.ts
Files with no reviewable changes: 38

  • src/components/CLIProxyLogin.tsx
  • src/components/ChunkFailureNotice.test.tsx
  • src/components/CommandPalette.appLayout.test.tsx
  • src/components/CompactPair.css
  • src/components/CompactPair.tsx
  • src/components/Composer.tsx
  • src/components/ComposerBarePick.test.tsx
  • src/components/ComposerCounting.test.tsx
  • src/components/ComposerCrossTab.test.tsx
  • src/components/ComposerNotices.css
  • src/components/ComposerNotices.tsx
  • src/components/ComposerPasteSend.test.tsx
  • src/components/ComposerRestored.test.tsx
  • src/components/ConfirmDialog.css
  • src/components/ConnectPhoneDialog.css
  • src/components/ConnectionLine.tsx
  • src/components/ConnectionRouteMark.test.tsx
  • src/components/ConnectionRouteMark.tsx
  • src/components/codeFailureText.ts
  • src/lib/sessionHistory.test.ts
  • src/lib/sessionHistoryRetry.test.ts
  • src/lib/sessionStats.ts
  • src/lib/settings.hook.test.ts
  • src/lib/settings.legacy-fixture.ts
  • src/lib/settings.test.ts
  • src/lib/setupGuide.ts
  • src/lib/setupGuideFlow.test.ts
  • src/lib/sheetHistory.skips.test.ts
  • src/lib/sheetHistory.test.ts
  • src/lib/workspaceOrder.ts
  • src/lib/workspacePath.test.ts
  • src/lib/worktreeBranches.ts
  • src/lib/ws.test.ts
  • src/main.tsx
  • src/pwa.test.ts
  • src/relay-resource-worker.test.ts
  • src/styles-wco.test.ts
  • src/theme-bootstrap.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

@devswha
devswha merged commit 7078ab4 into main Nov 17, 2026
18 checks passed
@devswha
devswha deleted the refactor/no-comment-src-9 branch November 17, 2026 20:28
maslianok added a commit to maslianok/ovis that referenced this pull request Nov 17, 2026
…hs-at-the

main's comment pass (devswha#4071, devswha#4072, devswha#4074, devswha#4076, devswha#4051) and devswha#4029 touched the same lines as this branch.
In each conflict the branch's code stays, and a comment main removed that the branch had left
unchanged goes with it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
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