Repository navigation
refactor: sweep tombstone comments, dead CSS and no-consumer leftovers - #353
Merged
Merged
Conversation
Comments that described where code used to live, or named refactor-plan phases (Pack/L*/R*), cost every reader a lookup that resolves to nothing. Dead CSS rules and exports with no consumer do the same. Remove them, and collapse the two places that built the per-PR storage-key prefix and the two private UTF-8 base64 decoders onto one definition each so they cannot drift. Closes #301
nownabe
force-pushed
the
refactor/301-sweep
branch
from
September 20, 2026 10:36
184221c to
52ff62b
Compare
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Comments that say where code used to live, or that name a refactor-plan phase
(
Pack B / R8b,L7e-1,Phase 4), send the reader looking for something thateither moved or was never in this repo. CSS rules with no markup and exports with
no importer cost the same kind of lookup. Two of them were worse than noise: the
pr:{owner}/{repo}#{n}key prefix and the UTF-8 base64 decoder each had twoindependent definitions that could silently drift.
Net -130 lines (135 insertions / 265 deletions) across 29 files, plus one
deleted file. No behaviour change.
What
1. Tombstone / phase-tag comments. Re-located by content (the issue's line
numbers are from before #303–#350). Rewritten to say what the code is, or deleted
where the comment only described history:
App.tsx(a garbled half-sentence, six"now lives in …" markers, and the
L5/L6c/L6d-1/L7e-1/R3/R6tags), the five
hooks/headers, bothadapters/headers plusdisplayPositionToAnchorStatus.ts,highlight.ts,suggestionView.ts,lib/drafts.ts,lib/comments.ts,lib/pr/repository.ts.lib/storage.ts'sheader advertised an IndexedDB layer that does not exist — it now says
chrome.storage.local and points at ADR 0001 §2. Real "why not" sentences (the
reviewer note on thread visibility, the
canAcceptrationale, everysimplify:and issue-numbered note) are untouched.
2. Dead CSS. Deleted
.field--mono,.badge--review,.badge--suggestion,.badge--anchored,.composer__routing,.radio-row(+.radio-row label)after an exact-token search over
entrypoints/,lib/,tests/found noproducer.
.badge--anchoredis unreachable by construction as well:ThreadItembuilds
badge--${status}fromAnchorStatus(current|reanchored|outdated), gated onSTATUS_LABEL[status], which only definesreanchoredandoutdated.docs/design-principle.mdno longer lists.field--mono.3. No-consumer leftovers.
components/directory (nothing inwxt.config.ts,tsconfig.jsonor the docs configures a root components dir; the real one isentrypoints/review/components/).useUiPanels.closePrInfo(only the hook's own test called it).APP_SLUG,SubmitCommitGroup,SubmitSummary— all used only intheir defining module.
SubmitGroupstays exported:SubmitConfirmModalimports it.prStorageKey/prStorageKeysnow build onstorageKeys.pr, the same prefixlib/drafts.tsbuilds, so fix(storage): bound chrome.storage.local growth and stop quota errors losing drafts #332's eviction and the drafts keys cannot drift.base64Decodeis exported fromlib/pr/metadata.tsand reused byremote-fetcher.ts; the fetcher keeps its own whitespace strip (GitHub wrapsits base64 at 60 chars) rather than pushing that into the fence decoder.
fetchThreads(no production caller —fetchRemoteStateinlineslistReviewThreads+threadsFromRaw). Its four tests now callthreadsFromRaw(await listReviewThreads(...))through a 2-line local helper, sothe paging coverage is unchanged and the only export is a function production
actually uses.
4.
AppState.currentFiles. Verified no consumer anywhere inentrypoints/;deleted it with
buildCurrentFilesand its two tests.Test evidence
This is a deletion PR, so there is no red step except for the two shared helpers,
where the rule was to pin current behaviour before unifying:
tests/pr/chrome-storage.test.ts— "shares its prefix with the keyslib/drafts.ts builds":
prStorageKey("acme","site",42)===`${storageKeys.pr("acme","site",42)}:state`. Added and run green againstthe two independent definitions, then
prStorageKeywas rewritten ontostorageKeys.pr; still green.tests/pr/remote-fetcher.test.ts— "decodes UTF-8 from the line-wrapped base64GitHub returns": multibyte source, base64 wrapped at 60 chars. Added and run
green against the fetcher's private decoder, then repointed at the shared
base64Decode; still green.Full set on the rebased branch: 816 pass / 0 fail (
bun run test),check:lint,check:format,typecheckandbuildall clean.Dropped from the issue (already fixed on main)
DebugFab.tsx's undefinedvar(--green)— gone with DebugFab's preview.lib/pr/bootstrap.ts:8-17— the current header describes the live compositionaccurately; nothing to remove.
lib/pr/repository.ts:159— that line is live code today; only the(Phase 4)tag on line 8 needed a fix.
Left out, on purpose
Two phase tags remain in
App.tsx's submit flow —// already double-written by L4/L6aand// (the L6d-1 effect is best-effort…). Both sit inside thecomposeDraftBodycall regions that the still-open #351 edits, so they are leftfor a one-line follow-up after that merges rather than handed #351 a conflict.
Closes #301