Repository navigation
refactor(src): drop comments the code can say, part 7 of 9 - #4075
Conversation
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]>
…rule 3) 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:
|
What
Part 7 of 9 for
src/in the repo-wide comment pass. This part covers:src/componentsfromAgentSidebartoChatView.css: agent tiles and settings, alert webhooks and checks,AnimatedHeight, the crash view, artifacts, background agents and tasks, the chat timeline and turnssrc/lib/relay/and nearbysrc/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 finishessrc/libfromtouchFlingtouseInboxQuestions: 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 hooksAbout 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:
@legendapp/list3.3.5's measuring (checked in its bundle; fix(chat): follow measured rows without a competing glide #2624, revert(chat): follow measured rows without a competing glide (#2624) #2647), React's keyed children and discrete popstate flushperformance.now()during sleephidden=until-foundrules,scrollToprounding// fixed wait:markers inrelay/shell.tsx, the// allow: SIZE_OKmarkers inChatTimeline.tsxandrelay/shell.tsx, andAnimatedHeight's "Adapted from t3code's AnimatedHeight (MIT)".agentSvgMarks.tskeeps its icon-source header and is untouched.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. The fiveeslint-disable-line react-hooks/exhaustive-depslines inAgentTile.tsxstay.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)
BackgroundAgentDetailis never polled;Artifactsasks nothing while its chip is off.useFileViewer.ts: picking another file inside an open preview adds no Back step.relay/device.ts's database name and version stay in step withpublic/sw.js.ChatTimeline: a field's own copy stays native.Deleted as unverified:
ChatTimeline's claims aboutpointerupoutside the window and wherecopygoes, and aSelection.toString()claim inChatView.css.Left open (redesigns, not done here)
relay/device.ts openDatabase's name, version and stores are copied inpublic/sw.js openRelayDatabase.relay/directSocket.ts'sEARLY_SEND_BYTES/EARLY_SEND_MESSAGESandrelay/transport.ts DIRECT_SOCKETScopy the native plugins' limits;saveImage.ts SAVE_MAX_BYTEScopies the Android app's.relay/transport.ts WS_SEND_QUEUE_LIMITcopiesshared/relay-mux-engine.ts's unexportedQUEUE.outgoing(4 MiB).relay/transport.ts RECONNECT_PC_ANSWER_MS(25 s) is set by hand underrelay/core.ts OFFLINE_WAIT_MS(30 s);relay/pcStatus.ts DIRECT_PROBE_MScopiesDIRECT_BUDGET_MS.relay/pcSweep.ts CHECK_GAP_MSwas sized against a "30 a minute" relay limit;relay/bun-limits.tsdefaults to 120 per address.DirectSocket.eventacknowledges afteronmessagewhile the relay channel may still hold queued work, so the plugin's limit does not cover it.relayNotice.ts relayNoticeFromStatusguesses which link refused from anerror_codeprefix and returns three states; a typed refusal per link would do.relay/shell.tsx mountRelayShellruns the pairing flow in one ~440-line closure on loose flags.repositoryWorkspaces.tstells a failure from a refusal by error-code strings, becauseserver/http.tsanswers herdr failures as 404.useAddressBar.ts onPop's branch tree on ref flags,useFilePanels.ts's history choreography (collapsing, a one-offpopstatelistener,history.go(-2 - …)),useFileViewer.ts'spopscounter.useComposerSends.ts:composerSendtakes four positional booleans,notedStillOpenis a one-shot flag,actOnPendingmixes three action paths.typeAhead.ts Pendingand the module-levellingering;usageCounters.ts'sallowed/refusedflags and a bare403.AgentSidebar's held row order and focus hand-off;ChatTimeline's four ways of telling a layout scroll from a reader's.seenFinishes.ts writetrusts 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 movewrites a record that must read as no comments.AgentTile's effects callonRunning,onErrorandonInstalledwith incomplete deps;AgentSidebar'sfoldRequest?.seqdeps are knowingly incomplete;useFocusTrap.tsre-focuses in a microtask because our owninertlifts after the cleanup.Artifactsasks again every 3 s andBackgroundTasksup 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.turnRevision.ts'simmutableflag,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-levelt.Validation
bun run check fast: passed (18,593 unit tests, typecheck, build, generated themes and types).i18n.test.ts,userMessageFold.test.tsandsrc/conventions.test.tsincluded. All pass.server/relay/service.contract.test.ts(importssrc/lib/relay; comments only, CI's integration job runs it) and browser regressions.🤖 Generated with Claude Code