refactor(web): delete unmounted components carrying real logic (TASK-2632) - #1163
Merged
Conversation
…2632) A one-shot sweep, not a standing process. Two dead components had been found incidentally in one week, each discovered only because someone was about to change behaviour it appeared to depend on -- VersionHistory during BUG-2608 (its apparent liveness would have blocked a default history limit) and EditorToolbar before it. Retired UI left in-tree costs every future reader who greps for a component, finds a plausible implementation, and reasons about behaviour nobody mounts; it also silently constrains fixes. Instrument, two passes over all 110 components under web/src/lib/components: 1. Plain substring grep of each basename across web/src + web/e2e. Four zero-hit. This pass counts COMMENTS as liveness, so it under-reports deadness -- conservative in the safe direction. 2. Import/mount-only regex (a from-import of the .svelte path, a dynamic import of it, or a <Name element). Six zero-hit; the two extras were exactly the comment-shadowed cases pass 1 could not see. Controls: a known-live component (BacklinksPanel) resolves to its single consumer under both passes; each of the six candidates then took a repo-wide plain grep with no include filters, and every surviving hit was read. Pass 2's one known blind spot -- a component referenced only by vi.mock(path) -- was checked by enumerating every vi.mock target ending in .svelte; all are .svelte.ts store/service modules except CommentEditor, which is independently imported. None of the six is in that set. Deleted (six dead, two cascade orphans): - activity/ActivityFeed.svelte -- a live /activity route page and TimelineActivityCard both exist; neither touches it. - charts/LineChart.svelte and charts/layers/Lines.svelte -- from the TASK-1632 LayerCake library; only BarChart reached the insights pages. Lines had exactly one consumer (LineChart), so it falls with it. AxisX/AxisY stay: shared with BarChart. - charts/Sparkline.svelte (TASK-1638) -- its only repo-wide reference was a prose comment recording that PLAN-1542 chose not to show it. Zero mounts. - editor/MermaidRenderer.svelte -- superseded by the MermaidCodeBlock NodeView in Editor.svelte, which owns the render queue, toggle and error state. - versions/VersionHistory.svelte -- the BUG-2608 find. The live path is ItemTimeline to TimelineVersionCard to DiffView; DiffView stays. - attachments/fixtures/LightboxStub.svelte and fixtures/lightboxStub.ts -- a pair that referenced only each other. Their last consumer was removed by the TASK-2489 atomic cutover, so they were orphaned rather than born dead. Nothing was reclassified live-but-obscure, so no import-site comments were owed. Two docs updated so no artifact points at a deleted file: the web README component tree drops the activity/ line, and the UserOverviewTab comment now says the Sparkline component was deleted here and is recoverable from history, rather than leaving a dangling decision record. Git history is the archive; anything worth resurrecting is one revert away. Claude-Session: https://claude.ai/code/session_017jD6t1zjxGSq47SQpZfp1V
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.
Closes TASK-2632.
A one-shot dead-code sweep. Two dead components had been found incidentally in one week, each discovered only because someone was about to change behaviour it appeared to depend on —
VersionHistoryduring BUG-2608 (its apparent liveness would have blocked a default history limit), andEditorToolbarbefore it. One is an oddity; two is a pattern.Instrument
Two passes over all 110 components under
web/src/lib/components:web/src+web/e2e→ 4 zero-hit. This pass counts comments as liveness, so it under-reports deadness — conservative in the safe direction.from-import of the.sveltepath, a dynamicimport()of it, or a<Nameelement) → 6 zero-hit. The two extras were exactly the comment-shadowed cases pass 1 could not see.Controls. A known-live component (
BacklinksPanel) resolves to its single consumer under both passes. Each of the six candidates then took a repo-wide plain grep with no include filters and no scope beyondnode_modules/.git/.svelte-kit/build, and every surviving hit was read individually. Pass 2's one known blind spot — a component referenced only byvi.mock(path)— was checked by enumerating everyvi.mocktarget ending in.svelte; all are.svelte.tsstore/service modules exceptCommentEditor, which is independently imported. None of the six is in that set.Deleted (6 dead + 2 cascade orphans)
activity/ActivityFeed.svelte/activityroute page andTimelineActivityCardboth exist; neither touches it.charts/LineChart.svelteBarChartreached the insights pages.charts/layers/Lines.svelteLineChart.AxisX/AxisYstay: shared withBarChart.charts/Sparkline.svelteeditor/MermaidRenderer.svelteMermaidCodeBlockNodeView inEditor.svelte, which owns the render queue, toggle and error state.versions/VersionHistory.svelteItemTimeline→TimelineVersionCard→DiffView;DiffViewstays.attachments/fixtures/LightboxStub.svelteattachments/fixtures/lightboxStub.tsNothing was reclassified live-but-obscure, so no import-site comments were owed.
Docs
Two edits so no artifact points at a deleted file: the
web/README.mdcomponent tree drops theactivity/line, and theUserOverviewTabcomment now says theSparklinecomponent was deleted here and is recoverable from history — otherwise a future reader greping that decision record finds nothing.Gates
npx vite build— exit 0make lint— 0 issuesgo test ./...— exit 0, 25 packages okmake test-pg— not applicable: zero Go files and zero store SQL in the diffnpm run check— 0 errors, 6 warnings (all pre-existing, in files this diff does not touch)npm run test— 95 files, 1706 tests passedvi.mock/ dynamic imports / component registries / Go embeds / Playwright + build config / JSON / Markdown / generatedweb/buildGit history is the archive; anything worth resurrecting is one revert away.
https://claude.ai/code/session_017jD6t1zjxGSq47SQpZfp1V