Repository navigation
ui-react: helpers that only tests call are shipped in src #2525
Description
Context
ui-react ships logic in src that only tests call. Each item below was checked with git grep -nw <name> -- packages ':!*CHANGELOG*': the hits are the definition plus test files only.
| Symbol | Where | Tests that use it |
|---|---|---|
trackerWords, and its private helpers clock, age, FAILED_WORD, CANT_CHECK_LINE |
packages/ui-react/src/lib/trackers.ts:478-531 |
tests/trackers.test.ts, tests/tracker-store.test.ts |
inlineRenderedFences, INLINE_BUDGET_CHARS |
packages/ui-react/src/lib/mermaid.ts:220-243 |
tests/mermaid-fences.test.ts |
nodeSize |
packages/ui-react/src/lib/graph-helpers.ts:88 |
tests/graph-helpers.test.ts |
SwitchRow |
packages/ui-react/src/components/graph/graph-form.tsx:50 |
tests/render/render-smoke.test.tsx:90 |
createTabHub (documented "Tabs in one process, for tests") |
packages/ui-react/src/lib/answer-delivery/tabs.ts:83-88 |
tests/answer-delivery.test.ts |
clearGraphSceneCache (module-level wrapper over the default root) |
packages/ui-react/src/stores/graph-store.ts:13 |
tests/graph-store.test.ts |
inlineRenderedFences is a retired path. The share pipeline now pre-renders fences in preRenderBrowserFences with its own byte budget (INLINE_BUDGET_BYTES, packages/ui-react/src/lib/content-renderer-share.ts:7), so tests/mermaid-fences.test.ts tests a budget rule production no longer applies. A JSDoc block written for the removed inliner sits orphaned above the budget constant (packages/ui-react/src/lib/mermaid.ts:205-212).
Dead logic with green tests reads as covered behaviour, and it gets maintained in every refactor of these files.
Scope
- Delete
trackerWordsand its private helpers,inlineRenderedFences,INLINE_BUDGET_CHARSand the orphaned JSDoc,nodeSize,SwitchRowand theclearGraphSceneCachewrapper, together with the tests that only exercise them. - Move
createTabHubfromsrcto a test fixture underpackages/ui-react/tests/.
Out of scope
ToolCallTimeline(the sibling issue in this epic).- Any symbol exported from a package entry (
packages/ui-react/src/index.ts,content-figures). Removing one of those is an API change and needs its own issue. - Rewriting the tracker, mermaid or graph production paths.
Acceptance criteria
-
git grep -nw -e trackerWords -e inlineRenderedFences -e INLINE_BUDGET_CHARS -e nodeSize -e SwitchRow -- packages/ui-reactreturns nothing. -
git grep -n createTabHub -- packages/ui-react/srcreturns nothing, andtests/answer-delivery.test.tspasses using the fixture. - Production tracker wording and share fence pre-rendering stay covered by tests that call the production functions. Name them in the PR.
-
bun run test packages/ui-reactandbun run typecheckpass, and theapi-reportfor ui-react is unchanged.
Verification
bun run test packages/ui-react
bun run typecheck
bun run lintContract impact
None. No public export changes.
Found by a repository review on 2026-10-22.
Activity