Skip to content

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

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

devswha merged 3 commits into
mainfrom
refactor/no-comment-src-7

Conversation

@devswha

@devswha devswha commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What

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

  • src/components from AgentSidebar to ChatView.css: agent tiles and settings, alert webhooks and checks, AnimatedHeight, the crash view, artifacts, background agents and tasks, the chat timeline and turns
  • src/lib/relay/ and nearby src/lib: the relay device store, direct sockets, transport, PC status and sweep, the hosted shell and its state, the relay notice, repository workspaces, the diff finder, reply comments, image saving, the secret screen and seen finishes
  • src/lib from touchFling to useInboxQuestions: touch reorder and wheel pacing, the transcript, transport, turn revisions, type-ahead, typography, update notes and progress, usage and usage counters, and the access, address bar, agent setup, alert, composer send, connection chip, edge fade, file panel, file viewer and focus trap hooks
  • the tests of all of these

About 2,600 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 stays:

  • Behaviour we cannot change:
  • Machine-read and attribution lines: the // fixed wait: markers in relay/shell.tsx, the // allow: SIZE_OK markers in ChatTimeline.tsx and relay/shell.tsx, and AnimatedHeight's "Adapted from t3code's AnimatedHeight (MIT)". agentSvgMarks.ts keeps its icon-source header and is untouched.

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. The five eslint-disable-line react-hooks/exhaustive-deps lines in AgentTile.tsx stay.

This PR touches relay pairing (src/lib/relay/), the access gate (useAccess.ts), queued input (useComposerSends.ts, typeAhead.ts) and the alert webhook's secret field, 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)

  • Reads: BackgroundAgentDetail is never polled; Artifacts asks nothing while its chip is off.
  • History: useFileViewer.ts: picking another file inside an open preview adds no Back step.
  • Storage: relay/device.ts's database name and version stay in step with public/sw.js.
  • Smaller rules: ChatTimeline: a field's own copy stays native.

Deleted as unverified: ChatTimeline's claims about pointerup outside the window and where copy goes, and a Selection.toString() claim in ChatView.css.

Left open (redesigns, not done here)

  • Hand-kept copies:
    • relay/device.ts openDatabase's name, version and stores are copied in public/sw.js openRelayDatabase.
    • relay/directSocket.ts's EARLY_SEND_BYTES/EARLY_SEND_MESSAGES and relay/transport.ts DIRECT_SOCKETS copy the native plugins' limits; saveImage.ts SAVE_MAX_BYTES copies the Android app's.
    • relay/transport.ts WS_SEND_QUEUE_LIMIT copies shared/relay-mux-engine.ts's unexported QUEUE.outgoing (4 MiB).
    • relay/transport.ts RECONNECT_PC_ANSWER_MS (25 s) is set by hand under relay/core.ts OFFLINE_WAIT_MS (30 s); relay/pcStatus.ts DIRECT_PROBE_MS copies DIRECT_BUDGET_MS.
    • relay/pcSweep.ts CHECK_GAP_MS was sized against a "30 a minute" relay limit; relay/bun-limits.ts defaults to 120 per address.
  • Relay:
    • DirectSocket.event acknowledges after onmessage while the relay channel may still hold queued work, so the plugin's limit does not cover it.
    • relayNotice.ts relayNoticeFromStatus guesses which link refused from an error_code prefix and returns three states; a typed refusal per link would do.
    • relay/shell.tsx mountRelayShell runs the pairing flow in one ~440-line closure on loose flags.
    • repositoryWorkspaces.ts tells a failure from a refusal by error-code strings, because server/http.ts answers herdr failures as 404.
  • State held in flags and refs:
    • useAddressBar.ts onPop's branch tree on ref flags, useFilePanels.ts's history choreography (collapsing, a one-off popstate listener, history.go(-2 - …)), useFileViewer.ts's pops counter.
    • useComposerSends.ts: composerSend takes four positional booleans, notedStillOpen is a one-shot flag, actOnPending mixes three action paths.
    • typeAhead.ts Pending and the module-level lingering; usageCounters.ts's allowed/refused flags and a bare 403.
    • AgentSidebar's held row order and focus hand-off; ChatTimeline's four ways of telling a layout scroll from a reader's.
    • seenFinishes.ts write trusts its cache only while a storage listener is mounted (Finish index: unused code, eviction while watching, stale cache with no subscriber (#1536 follow-ups) #1539); replyComments.ts move writes a record that must read as no comments.
  • Effects: AgentTile's effects call onRunning, onError and onInstalled with incomplete deps; AgentSidebar's foldRequest?.seq deps are knowingly incomplete; useFocusTrap.ts re-focuses in a microtask because our own inert lifts after the cleanup.
  • Polling: while the answer is empty, Artifacts asks again every 3 s and BackgroundTasks up to three more times, 3 s apart, because the server can answer before it has found the session; a "still looking" answer would replace it.
  • Smaller items: turnRevision.ts's immutable flag, useEdgeFades.ts's check for the test renderer's node, useAgentStateSince.ts's empty roster meaning "not loaded", updates.ts's mounted ref, useChatCallbacks.ts's check written three times, usage.ts silence's inline two-clock arithmetic, AppCrash's module-level t.

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: 77 + 78 + 18 files, i18n.test.ts, userMessageFold.test.ts and src/conventions.test.ts included. All pass.
  • Not run: server/relay/service.contract.test.ts (imports src/lib/relay; comments only, CI's integration job runs it) and browser regressions.

🤖 Generated with Claude Code

devswha and others added 3 commits November 18, 2026 04:48
The seventh src/ slice of the repo-wide comment pass: the components
from AgentSidebar to ChatView (agent tiles and settings, alert webhooks
and checks, animated height, the crash view, artifacts, background
tasks, the chat timeline and turns), src/lib/relay and the relay notice,
repository workspaces, reply comments, image saving, the secret screen
and seen finishes, and src/lib from touchFling to useInboxQuestions
(touch reorder and wheel pacing, the transport, type-ahead, typography,
updates and usage counters, and the access, address bar, composer
send, file panel, file viewer and focus trap hooks), with their tests.
About 3,400 comment lines go; notes on xterm 6, @legendapp/list,
IndexedDB, WebSocket and the Encoding and HTML specs, iOS and Android
web views, Safari, Chromium and CSS stay, and so do the third-party
attribution lines and the SIZE_OK markers. Five dead exhaustive-deps
suppressions go (no ESLint runs). 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

  • Refactor
    • No user-facing functionality changes. This update primarily removes or revises internal code comments; behavior and styling remain unchanged.

This pull request removes or shortens comments across components and library modules. It also adds a limit callback to FollowRestartOptions and retains or adds assertions in transport and panel-history tests.

Changes: Repository-wide comment cleanup and focused updates

Layer / File(s) Summary
Component comments and retained behavior
src/components/*, src/components/chatTimelineLoader.ts
Comments and documentation were removed or shortened across components and styles. The summaries report no related changes to rendering, CSS declarations, or component behavior.
Relay transport and update flow
src/lib/relay/*
Relay comments were edited; the described production behavior remains unchanged. Transport tests retain or add assertions for retry, reconnect, and socket lifecycle cases.
Shared library comments and contracts
src/lib/repoDiff*, src/lib/runtimeSwitch.ts, src/lib/usage*, src/lib/*
Library comments were removed or revised. FollowRestartOptions gains an optional limit callback that resolves to null after a specified duration.
Navigation and interface hooks
src/lib/use*, src/lib/useFilePanels.reopen.hook.test.ts
Hook comments were removed. File-panel history tests retain or add assertions for navigation, reopening, and release behavior.

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

Change: Other

Possibly related PRs

  • devswha/ovis#4066: Part 1 of the same comment-removal series, with a shared comment-retention policy.
Merge Risk: Minimal · up to f47b0

This change mostly removes or shortens comments and does not appear to alter runtime behavior. The author reports that the fast checks pass. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "refactor(src): drop comments the code can say, part 7 of 9" matches the changeset, which removes explanatory comments and JSDoc across src/components and src/lib with no code changes. It is…
Description check Passed The description covers what changed (comment removal across the listed src/components and src/lib areas and their tests), why specific comments were kept (security, platform, measured values, attribut…
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 7 of 9" matches the changeset, which removes explanatory comments and JSDoc across src/components and src/lib with no code changes. It is specific about scope (src) and type (refactor), and it names the main change. The 'part 7 of 9' suffix is series context, not noise.

Full details: Description check

Explanation

The description covers what changed (comment removal across the listed src/components and src/lib areas and their tests), why specific comments were kept (security, platform, measured values, attributions, concrete breakage), how the change was verified (syntax-tree comparison, check fast, unit tests), and what was not run (server contract test, browser regressions). It also lists rules and open items. It does not follow the repository template's Change and Validation headings exactly, and it does not link a CONTRIBUTING.md reference or a changelog.d entry. Those are minor gaps. The description is mostly complete.

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

Files selected for processing: 131

  • src/components/AgentSidebar.tsx
  • src/components/AgentTile.css
  • src/components/AgentTile.tsx
  • src/components/AgentsSettings.css
  • src/components/AgentsSettings.tsx
  • src/components/AlertChips.tsx
  • src/components/AlertWebhookGroup.test.tsx
  • src/components/AlertWebhookGroup.tsx
  • src/components/AlertsChecking.test.tsx
  • src/components/AlertsChecking.tsx
  • src/components/AnimatedHeight.css
  • src/components/AnimatedHeight.tsx
  • src/components/AppCrash.css
  • src/components/AppCrash.tsx
  • src/components/Artifacts.test.tsx
  • src/components/Artifacts.tsx
  • src/components/BackgroundAgentDetail.css
  • src/components/BackgroundAgentDetail.tsx
  • src/components/BackgroundTasks.css
  • src/components/BackgroundTasks.tsx
  • src/components/ChatFallback.test.ts
  • src/components/ChatMarkdownImages.test.ts
  • src/components/ChatMarkdownImages.tsx
  • src/components/ChatMinimap.css
  • src/components/ChatMinimap.tsx
  • src/components/ChatTimeline.css
  • src/components/ChatTimeline.test.tsx
  • src/components/ChatTimeline.tsx
  • src/components/ChatTurn.test.ts
  • src/components/ChatView.css
  • src/components/ChatView.goalWait.test.tsx
  • src/components/ChatView.scrollInput.test.tsx
  • src/components/ChatView.sentWaiting.test.tsx
  • src/components/ChatView.stoppedTurn.test.ts
  • src/components/chatTimelineLoader.ts
  • src/lib/relay.ts
  • src/lib/relay/device.test.ts
  • src/lib/relay/device.ts
  • src/lib/relay/directSocket.test.ts
  • src/lib/relay/directSocket.ts
  • src/lib/relay/pairCode.test.ts
  • src/lib/relay/pairCode.ts
  • src/lib/relay/pcStatus.test.ts
  • src/lib/relay/pcStatus.ts
  • src/lib/relay/pcSweep.test.ts
  • src/lib/relay/pcSweep.ts
  • src/lib/relay/resources.test.ts
  • src/lib/relay/resources.ts
  • src/lib/relay/shell.test.tsx
  • src/lib/relay/shell.tsx
  • src/lib/relay/shellEnrollment.test.tsx
  • src/lib/relay/shellJoin.test.tsx
  • src/lib/relay/shellState.test.ts
  • src/lib/relay/shellState.ts
  • src/lib/relay/skew.test.ts
  • src/lib/relay/skew.ts
  • src/lib/relay/transport.direct.test.ts
  • src/lib/relay/transport.test.ts
  • src/lib/relay/transport.ts
  • src/lib/relay/updateFlow.test.ts
  • src/lib/relay/updateFlow.ts
  • src/lib/relayNotice.ts
  • src/lib/replyComments.ts
  • src/lib/repoDiff.test.ts
  • src/lib/repoDiff.ts
  • src/lib/repoDiffFind.test.ts
  • src/lib/repoDiffFind.ts
  • src/lib/repositoryWorkspaces.test.tsx
  • src/lib/repositoryWorkspaces.ts
  • src/lib/runningVersion.ts
  • src/lib/runtimeMove.ts
  • src/lib/runtimeSwitch.test.ts
  • src/lib/runtimeSwitch.ts
  • src/lib/safeArea.ts
  • src/lib/saveImage.test.ts
  • src/lib/saveImage.ts
  • src/lib/secretScreen.test.ts
  • src/lib/secretScreen.ts
  • src/lib/seenFinishes.test.ts
  • src/lib/seenFinishes.ts
  • src/lib/selectionMark.test.ts
  • src/lib/selectionMark.ts
  • src/lib/sendUserFile.ts
  • src/lib/sentWaiting.test.ts
  • src/lib/touchFling.ts
  • src/lib/touchReorder.ts
  • src/lib/touchWheelPacer.test.ts
  • src/lib/touchWheelPacer.ts
  • src/lib/transcript.test.ts
  • src/lib/transcript.ts
  • src/lib/transport.test.ts
  • src/lib/transport.ts
  • src/lib/turnRevision.test.ts
  • src/lib/turnRevision.ts
  • src/lib/typeAhead.ts
  • src/lib/typography.test.ts
  • src/lib/typography.ts
  • src/lib/updateNotes.test.ts
  • src/lib/updateNotes.ts
  • src/lib/updateProgress.ts
  • src/lib/updates.ts
  • src/lib/usage.hook.test.ts
  • src/lib/usage.test.ts
  • src/lib/usage.ts
  • src/lib/usageCounters.test.ts
  • src/lib/usageCounters.ts
  • src/lib/useAccess.hook.test.ts
  • src/lib/useAccess.ts
  • src/lib/useAddressBar.hook.test.ts
  • src/lib/useAddressBar.ts
  • src/lib/useAgentSetup.hook.test.ts
  • src/lib/useAgentSetup.ts
  • src/lib/useAgentSkills.hook.test.ts
  • src/lib/useAgentSkills.ts
  • src/lib/useAgentStateSince.ts
  • src/lib/useAlertSignals.ts
  • src/lib/useAlerts.ts
  • src/lib/useChatCallbacks.ts
  • src/lib/useComposerSends.test.ts
  • src/lib/useComposerSends.ts
  • src/lib/useConnectionChip.ts
  • src/lib/useEdgeFades.ts
  • src/lib/useFilePanels.filesPanel.hook.test.ts
  • src/lib/useFilePanels.hook.test.ts
  • src/lib/useFilePanels.reopen.hook.test.ts
  • src/lib/useFilePanels.ts
  • src/lib/useFileViewer.ts
  • src/lib/useFocusTrap.test.tsx
  • src/lib/useFocusTrap.ts
  • src/lib/useInbox.hook.test.ts
  • src/lib/useInboxQuestions.test.ts
Files with no reviewable changes: 96

  • src/components/AgentTile.css
  • src/components/AgentsSettings.css
  • src/components/AlertChips.tsx
  • src/components/AlertWebhookGroup.test.tsx
  • src/components/AlertWebhookGroup.tsx
  • src/components/AlertsChecking.test.tsx
  • src/components/AlertsChecking.tsx
  • src/components/AnimatedHeight.css
  • src/components/AppCrash.css
  • src/components/AppCrash.tsx
  • src/components/Artifacts.test.tsx
  • src/components/BackgroundAgentDetail.css
  • src/components/BackgroundAgentDetail.tsx
  • src/components/BackgroundTasks.css
  • src/components/ChatFallback.test.ts
  • src/components/ChatMarkdownImages.test.ts
  • src/components/ChatMarkdownImages.tsx
  • src/components/ChatMinimap.css
  • src/components/ChatMinimap.tsx
  • src/components/ChatTimeline.css
  • src/components/ChatTimeline.test.tsx
  • src/components/ChatTurn.test.ts
  • src/components/ChatView.goalWait.test.tsx
  • src/components/ChatView.scrollInput.test.tsx
  • src/components/ChatView.sentWaiting.test.tsx
  • src/components/ChatView.stoppedTurn.test.ts
  • src/components/chatTimelineLoader.ts
  • src/lib/relay.ts
  • src/lib/relay/device.test.ts
  • src/lib/relay/device.ts
  • src/lib/relay/directSocket.test.ts
  • src/lib/relay/pairCode.test.ts
  • src/lib/relay/pairCode.ts
  • src/lib/relay/pcStatus.test.ts
  • src/lib/relay/pcStatus.ts
  • src/lib/relay/pcSweep.test.ts
  • src/lib/relay/resources.test.ts
  • src/lib/relay/shellEnrollment.test.tsx
  • src/lib/relay/shellJoin.test.tsx
  • src/lib/relay/shellState.test.ts
  • src/lib/relay/skew.test.ts
  • src/lib/relay/skew.ts
  • src/lib/relay/transport.direct.test.ts
  • src/lib/relay/transport.test.ts
  • src/lib/relay/updateFlow.test.ts
  • src/lib/repoDiff.test.ts
  • src/lib/repoDiff.ts
  • src/lib/repoDiffFind.test.ts
  • src/lib/repositoryWorkspaces.test.tsx
  • src/lib/repositoryWorkspaces.ts
  • src/lib/runningVersion.ts
  • src/lib/runtimeMove.ts
  • src/lib/runtimeSwitch.test.ts
  • src/lib/safeArea.ts
  • src/lib/saveImage.test.ts
  • src/lib/saveImage.ts
  • src/lib/secretScreen.test.ts
  • src/lib/seenFinishes.test.ts
  • src/lib/selectionMark.test.ts
  • src/lib/selectionMark.ts
  • src/lib/sendUserFile.ts
  • src/lib/sentWaiting.test.ts
  • src/lib/touchFling.ts
  • src/lib/touchWheelPacer.test.ts
  • src/lib/transcript.test.ts
  • src/lib/transport.test.ts
  • src/lib/transport.ts
  • src/lib/turnRevision.test.ts
  • src/lib/typeAhead.ts
  • src/lib/typography.test.ts
  • src/lib/updateNotes.test.ts
  • src/lib/updateProgress.ts
  • src/lib/usage.hook.test.ts
  • src/lib/usageCounters.test.ts
  • src/lib/usageCounters.ts
  • src/lib/useAccess.hook.test.ts
  • src/lib/useAddressBar.hook.test.ts
  • src/lib/useAgentSetup.hook.test.ts
  • src/lib/useAgentSkills.hook.test.ts
  • src/lib/useAgentSkills.ts
  • src/lib/useAgentStateSince.ts
  • src/lib/useAlertSignals.ts
  • src/lib/useAlerts.ts
  • src/lib/useChatCallbacks.ts
  • src/lib/useComposerSends.test.ts
  • src/lib/useConnectionChip.ts
  • src/lib/useEdgeFades.ts
  • src/lib/useFilePanels.filesPanel.hook.test.ts
  • src/lib/useFilePanels.hook.test.ts
  • src/lib/useFilePanels.reopen.hook.test.ts
  • src/lib/useFilePanels.ts
  • src/lib/useFileViewer.ts
  • src/lib/useFocusTrap.test.tsx
  • src/lib/useFocusTrap.ts
  • src/lib/useInbox.hook.test.ts
  • src/lib/useInboxQuestions.test.ts

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

@devswha
devswha merged commit 5634ba3 into main Nov 17, 2026
17 checks passed
@devswha
devswha deleted the refactor/no-comment-src-7 branch November 17, 2026 20:09
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