Skip to content

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

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

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

Conversation

@devswha

@devswha devswha commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What

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

  • src/components from ConnectPhoneDialog to InboxMode: the phone QR dialog, conversation search, devices, the directory browser, droplets, the files dialog and viewer, first-start hints, the find bar, highlighted code, the image lightbox and the inbox list, with their CSS
  • src/components from SessionHistory to SignOutRow: settings controls and the settings dialog, the setup guide and the sidebar, with their CSS
  • src/lib: pending messages, the phone and plugin runs, Portal, preferences sync, pressed buttons, prompt answers and text, push and push health, receipt resume, the reconnect grace, recent directories, and the relay account controller, boot, channel and dashboard
  • the tests of all of these

About 3,200 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:

  • Machine-read and attribution lines: the // fixed wait: markers (DevicesPanel, relay/accountController.ts), "adapted from Agent of Empires (MIT)" in pushHealth.ts, and the pinned Unicode tables in promptAnswer.ts (CaseFolding.txt, confusables.txt / UTS feat: gjc chat, gjc and omo marks #39).

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 one eslint-disable-line react-hooks/exhaustive-deps in FirstStartHints.tsx stays, as lint directives do.

This PR touches relay sign-in and pairing (src/lib/relay/accountController.ts, boot.ts, the channel.ts tests), the devices panel, queued input (pendingMessages.ts) and the file viewer's sandbox, 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)

  • Preferences sync (preferencesSync.ts): a made-up mute list is never sent to a server that keeps none.
  • Push: a later enable queues a new registration after a removal; registrations and removals keep click order; no probe push is ever sent, and a transient failure is never a notice.
  • The relay account (relay/accountController.ts): an earlier sign-in's read never holds back the next.
  • Lists and pickers:
    • InboxList: a query never narrows the list unseen; a failure is never taken for "Loading…" or an empty list.
    • Sidebar: pins of workspaces gone from this PC leave only by a change the user makes.
  • Smaller rules:
    • FirstStartHints: nothing takes the keyboard from the pane, and nothing is announced.
    • recent-directories.ts: missing panes never delete history.
    • receiptResume.ts: the storage shape must not change.
    • SettingsControls: every theme's raised background and strong border stay opaque; five or more options go in a select. SettingsDialog: the web server, not a PC, keeps the bridge-update choice. SetupGuide adds no server route, and its line breaks come from text-wrap only. Sidebar.css's row-fill and grid tokens are aliases only.

Left open (redesigns, not done here)

  • Hand-kept copies that could live in shared/: pendingMessages.ts HELD_RECEIPT_MS copies server/core/pending.ts's PI_RESUME_MS; promptText.ts's 12_000 copies the server's finishPrompt body cap.
  • State machines in components and hooks:
    • ConnectPhoneDialog AccountQr could be a QR-session hook (press, shown, take-down, notice) and a view; its run counter could be an AbortController per press, ending a handle the take-down returns, endShownCode a typed result, pcAccount a tagged union.
    • PendingMessageStore's seven parallel maps need a typed state per row; usePreferencesSync's ~20 refs are a send state machine (a reducer).
    • InboxList's held row order and opening focus could be useHeldOrder and useOpeningFocus; its restoring ref has two meanings.
  • Stale-answer guards: DevicesPanel's three guards, ConversationSearch's pickSerial, pushHealth.ts's two counters; one request sequencer or AbortController each.
  • Values with several meanings: pushHealth.ts endpoint, relay/accountController.ts PairingConsent and deletion, promptAnswer.ts nameOf().
  • Smaller items:
    • push.ts's module-global recovered handshake.
    • FirstStartHints' locate effect leaves out finish (useEffectEvent).
    • Droplet.tsx DISMISS_VELOCITY keeps its unit only in a removed comment (_PX_PER_MS).
    • SettingsControls useRowSentence's cleanup check exists for a test window without timers.
    • SetupGuide FocusTitle draws nothing so a layout effect runs before the focus trap reads it.

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: 17 + 47 + 12 files, both conventions.test.ts and i18n.test.ts included. All pass.
  • Not run: browser regressions (comments only).

🤖 Generated with Claude Code

devswha and others added 3 commits November 18, 2026 04:54
The eighth src/ slice of the repo-wide comment pass: the components
from ConnectPhoneDialog to InboxMode (the phone QR dialog, conversation
search, devices, directory browser, droplets, files dialog and viewer,
first-start hints, find bar, image lightbox and inbox list), from
SessionHistory to SignOutRow (settings controls and dialog, the setup
guide and the sidebar), and src/lib's pending messages, preferences
sync, prompt answers, push and push health, recent directories and the
relay account controller, boot and channel, with their tests. About
3,700 comment lines go; security, trap, platform and measured notes
stay (the owner's rule for comment-removal PRs), as do the fixed-wait
markers and the attribution lines. One dead exhaustive-deps suppression
goes (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

  • Documentation
    • Updated and removed explanatory comments across the app and its tests; no user-facing behavior or styling changes are reported.
  • Tests
    • Expanded coverage for prompt-answer matching, preference synchronization, push health, and relay connection scenarios.

This pull request removes or revises explanatory comments across UI components and libraries. It also removes the checkSlot prop from DevicesPanel, adds and adjusts selected test assertions, and expands test coverage for prompt-answer matching and relay-channel timing.

Changes: Repository-wide comment cleanup

Layer / File(s) Summary
Comment cleanup and focused test/API updates
src/components/*, src/lib/*
Comments and documentation are removed or shortened across components, stylesheets, libraries, and tests. DevicesPanel no longer accepts checkSlot; its “Check now” control renders in the panel. Tests add or adjust assertions for settings-stepper behavior, prompt-answer matching, relay-channel deadlines, and push-health handling.

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

Change: Other

Merge Risk: Minimal · up to 3f76d

This change removes explanatory comments and makes small test adjustments without altering runtime behavior. No concrete merge-blocking risk was found. Some rules that were documented only in deleted comments are now less visible to maintainers.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "refactor(src): drop comments the code can say, part 8 of 9" matches the changeset, which removes explanatory comments across src/components, src/lib, and their tests. It uses a conventional…
Description check Passed The description follows the template's intent. It covers what changed, the scope (components, lib, tests), and the reasoning for preserving security, platform, and attribution notes. The Validation se…
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 8 of 9" matches the changeset, which removes explanatory comments across src/components, src/lib, and their tests. It uses a conventional-commit prefix and describes the primary change. It does not name the specific files, but the description covers that. The title does not mention that the change is part of a series beyond the 'part 8 of 9' suffix.

Full details: Description check

Explanation

The description follows the template's intent. It covers what changed, the scope (components, lib, tests), and the reasoning for preserving security, platform, and attribution notes. The Validation section lists the commands run (bun run check fast) with results, plus the checks skipped (browser regressions). The template's 'Change' section asks for the problem and resulting behavior, and the description states the behavior is unchanged (comments only). It does not include a changelog entry reference or a linked issue, and the template's changelog guidance (changelog.d/) is not mentioned. Those gaps are minor for 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 12f8b75 and 3f76d80.

Files selected for processing: 117

  • src/components/ConnectPhoneDialog.test.tsx
  • src/components/ConnectPhoneDialog.tsx
  • src/components/ConversationSearch.css
  • src/components/ConversationSearch.tsx
  • src/components/DevicePairedNotice.css
  • src/components/DevicePairedNotice.tsx
  • src/components/DevicesPanel.css
  • src/components/DevicesPanel.relink.test.ts
  • src/components/DevicesPanel.test.ts
  • src/components/DevicesPanel.tsx
  • src/components/DiffWorkerPool.tsx
  • src/components/DirectoryBrowser.css
  • src/components/DirectoryBrowser.tsx
  • src/components/Droplet.css
  • src/components/Droplet.tsx
  • src/components/EnrollmentStatus.tsx
  • src/components/FileGlyph.tsx
  • src/components/FilePanelResizer.css
  • src/components/FilePanelResizer.tsx
  • src/components/FilePathLink.test.ts
  • src/components/FilePathLink.tsx
  • src/components/FileReader.tsx
  • src/components/FileTextSizeRow.tsx
  • src/components/FileViewer.css
  • src/components/FileViewer.relay.test.tsx
  • src/components/FileViewer.scripts.test.tsx
  • src/components/FileViewer.tsx
  • src/components/FilesDialog.css
  • src/components/FilesDialog.tsx
  • src/components/FilesPanelRow.tsx
  • src/components/FindBar.css
  • src/components/FindBar.tsx
  • src/components/FirstStartHints.css
  • src/components/FirstStartHints.tsx
  • src/components/FoldHelpersRow.tsx
  • src/components/FoundHerdrChoices.test.tsx
  • src/components/FoundHerdrChoices.tsx
  • src/components/HighlightedCode.css
  • src/components/HighlightedCode.tsx
  • src/components/ImageLightbox.css
  • src/components/ImageLightbox.tsx
  • src/components/InboxList.css
  • src/components/InboxList.test.tsx
  • src/components/InboxList.tsx
  • src/components/InboxMode.css
  • src/components/InboxMode.test.tsx
  • src/components/InboxMode.tsx
  • src/components/InboxRail.css
  • src/components/SessionHistory.tsx
  • src/components/SettingsControls.css
  • src/components/SettingsControls.test.tsx
  • src/components/SettingsControls.tsx
  • src/components/SettingsDialog.css
  • src/components/SettingsDialog.tsx
  • src/components/SetupGuide.css
  • src/components/SetupGuide.tsx
  • src/components/SetupProgressRow.css
  • src/components/SetupProgressRow.tsx
  • src/components/Sidebar.agentTree.test.tsx
  • src/components/Sidebar.appLayout.test.tsx
  • src/components/Sidebar.backgroundWorkspaces.test.tsx
  • src/components/Sidebar.compact.test.ts
  • src/components/Sidebar.css
  • src/components/Sidebar.tsx
  • src/components/SidebarResizer.css
  • src/components/SidebarResizer.tsx
  • src/components/SidebarSections.css
  • src/components/SidebarSplit.css
  • src/components/SidebarSplit.tsx
  • src/components/SignOutRow.test.ts
  • src/components/SignOutRow.tsx
  • src/components/Skeleton.css
  • src/components/Skeleton.tsx
  • src/components/SplitDividers.tsx
  • src/components/SplitDropPreview.css
  • src/lib/pendingMessages.ts
  • src/lib/phone.ts
  • src/lib/pinchFontSize.ts
  • src/lib/plan.ts
  • src/lib/pluginRun.test.ts
  • src/lib/pluginRun.ts
  • src/lib/portal.ts
  • src/lib/portalAuth.test.ts
  • src/lib/portalAuth.ts
  • src/lib/preferencesSync.hook.test.ts
  • src/lib/preferencesSync.test.ts
  • src/lib/preferencesSync.ts
  • src/lib/presence.ts
  • src/lib/pressedButton.ts
  • src/lib/projectFavicon.test.ts
  • src/lib/projectFavicon.ts
  • src/lib/promptAnswer.test.ts
  • src/lib/promptAnswer.ts
  • src/lib/promptText.test.ts
  • src/lib/promptText.ts
  • src/lib/pullRequest.ts
  • src/lib/push-removal.test.ts
  • src/lib/push.test.ts
  • src/lib/push.ts
  • src/lib/pushConfirm.ts
  • src/lib/pushHealth.test.ts
  • src/lib/pushHealth.ts
  • src/lib/receiptResume.ts
  • src/lib/recent-directories.test.ts
  • src/lib/recent-directories.ts
  • src/lib/reconnectGrace.test.ts
  • src/lib/reconnectGrace.ts
  • src/lib/relay/accountController.delete.test.ts
  • src/lib/relay/accountController.enrollment.test.ts
  • src/lib/relay/accountController.test.ts
  • src/lib/relay/accountController.ts
  • src/lib/relay/boot.ts
  • src/lib/relay/channel.destination.test.ts
  • src/lib/relay/channel.test.ts
  • src/lib/relay/dashboard.test.ts
  • src/lib/relay/dashboard.ts
  • src/lib/relay/dashboardRoute.ts
Files with no reviewable changes: 82

  • src/components/ConnectPhoneDialog.test.tsx
  • src/components/ConversationSearch.css
  • src/components/DevicePairedNotice.css
  • src/components/DevicesPanel.css
  • src/components/DevicesPanel.relink.test.ts
  • src/components/DevicesPanel.test.ts
  • src/components/DevicesPanel.tsx
  • src/components/DiffWorkerPool.tsx
  • src/components/DirectoryBrowser.css
  • src/components/DirectoryBrowser.tsx
  • src/components/Droplet.css
  • src/components/EnrollmentStatus.tsx
  • src/components/FileGlyph.tsx
  • src/components/FilePanelResizer.css
  • src/components/FilePanelResizer.tsx
  • src/components/FilePathLink.test.ts
  • src/components/FilePathLink.tsx
  • src/components/FileReader.tsx
  • src/components/FileTextSizeRow.tsx
  • src/components/FileViewer.relay.test.tsx
  • src/components/FileViewer.scripts.test.tsx
  • src/components/FilesDialog.css
  • src/components/FilesDialog.tsx
  • src/components/FilesPanelRow.tsx
  • src/components/FindBar.css
  • src/components/FindBar.tsx
  • src/components/FirstStartHints.css
  • src/components/FirstStartHints.tsx
  • src/components/FoldHelpersRow.tsx
  • src/components/FoundHerdrChoices.test.tsx
  • src/components/FoundHerdrChoices.tsx
  • src/components/HighlightedCode.css
  • src/components/HighlightedCode.tsx
  • src/components/ImageLightbox.css
  • src/components/InboxList.css
  • src/components/InboxList.test.tsx
  • src/components/InboxMode.css
  • src/components/InboxMode.test.tsx
  • src/components/InboxMode.tsx
  • src/components/SettingsControls.test.tsx
  • src/components/SetupGuide.css
  • src/components/SetupProgressRow.css
  • src/components/SetupProgressRow.tsx
  • src/components/Sidebar.agentTree.test.tsx
  • src/components/Sidebar.appLayout.test.tsx
  • src/components/Sidebar.backgroundWorkspaces.test.tsx
  • src/components/Sidebar.compact.test.ts
  • src/components/SidebarResizer.css
  • src/components/SidebarSplit.css
  • src/components/SignOutRow.test.ts
  • src/components/SignOutRow.tsx
  • src/components/Skeleton.css
  • src/components/Skeleton.tsx
  • src/components/SplitDividers.tsx
  • src/components/SplitDropPreview.css
  • src/lib/phone.ts
  • src/lib/pinchFontSize.ts
  • src/lib/plan.ts
  • src/lib/pluginRun.test.ts
  • src/lib/pluginRun.ts
  • src/lib/portal.ts
  • src/lib/portalAuth.test.ts
  • src/lib/portalAuth.ts
  • src/lib/preferencesSync.hook.test.ts
  • src/lib/preferencesSync.test.ts
  • src/lib/presence.ts
  • src/lib/projectFavicon.test.ts
  • src/lib/projectFavicon.ts
  • src/lib/promptAnswer.test.ts
  • src/lib/promptText.test.ts
  • src/lib/pullRequest.ts
  • src/lib/push-removal.test.ts
  • src/lib/pushHealth.test.ts
  • src/lib/recent-directories.test.ts
  • src/lib/reconnectGrace.test.ts
  • src/lib/relay/accountController.delete.test.ts
  • src/lib/relay/accountController.enrollment.test.ts
  • src/lib/relay/channel.destination.test.ts
  • src/lib/relay/channel.test.ts
  • src/lib/relay/dashboard.test.ts
  • src/lib/relay/dashboard.ts
  • src/lib/relay/dashboardRoute.ts

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

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