Skip to content

ui-react: helpers that only tests call are shipped in src #2525

Open

Description

@schlessera

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 trackerWords and its private helpers, inlineRenderedFences, INLINE_BUDGET_CHARS and the orphaned JSDoc, nodeSize, SwitchRow and the clearGraphSceneCache wrapper, together with the tests that only exercise them.
  • Move createTabHub from src to a test fixture under packages/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-react returns nothing.
  • git grep -n createTabHub -- packages/ui-react/src returns nothing, and tests/answer-delivery.test.ts passes 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-react and bun run typecheck pass, and the api-report for ui-react is unchanged.

Verification

bun run test packages/ui-react
bun run typecheck
bun run lint

Contract impact

None. No public export changes.

Found by a repository review on 2026-10-22.

Activity

  1. added
    type: refactorStructure changes; behaviour does not. No changeset-visible effect.
    area: ui-reactReact chat/files/voice components, stores, WebSocket transport.
    priority: p3Someday. Needs a driving use case before it starts.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.priority: p3Someday. Needs a driving use case before it starts.type: refactorStructure changes; behaviour does not. No changeset-visible effect.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions