Repository navigation
refactor(src): drop comments the code can say, part 9 of 9 - #4076
Conversation
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
…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]>
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 CSSsrc/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, andstyles.cssbelow its theme blocksAbout 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.csslines 1–1625 whole: the theme blocks and the notes around them, whichbun run generate:themesreads and which name where each palette came from.styles.css, t3code inworkspacePath.ts.settings.legacy-fixture.tsnames the commit it was copied from.Every change was checked against
origin/mainby 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)
settings.ts): another tab may have saved since this one loaded (Settings: an already-open tab's next save undoes another tab's settings change #2485); blocked storage (Lock pinned agents (experimental): close paths and lock-state gaps left from #2971 #2977); a stale or hand-edited record never breaks the UI.settingsHistory.tslistens first, and its traversal and buried-entry races;sessionHistory.ts's rules for when a recent Resume record ends.Left open (redesigns, not done here)
ChatView: whether the reader still follows the end (onScrollwithstickToBottom,manualLayout,pagingAway,scrollbarPress) needed about 120 lines of prose and could be one typed state machine;cancelledAtSendandgoingCancelare two records for one idea; the module-levellastPromptsandcardTextsmaps belong in a store;revealTurnpages until the pick settles.Composer:onSendreturnsboolean | string | DraftRefusal | Promise<…>and takes five positional flags (a typed result and an options object);fitStatusmeasures twice;COMMIT_WAIT_MSandplaceWaitingMentionskeep 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_seqand boot proofs could be typed values;stateis a test-only reader on the production class.sentWaiting.ts:newerThanSend's four clock rules could be named checks;saidcopies what the terminal does to a sent message;markUnanswereduses 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.worktreeBranches.ts's nullbranchmeans both "detached" and "not known yet";main.tsxandtheme-bootstrap.tsdepend 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).i18n.test.ts, the theme tests andsrc/conventions.test.tsincluded. All pass.🤖 Generated with Claude Code