Skip to content

[LOW][tabs] Legacy TabBar/TabBarWithOverflow and unconsumed animation variants: delete or wire, not gate #1331

Description

@h4yfans

Surfaced while fixing epic #987 (memory/CPU audit 2026-08). Not fixed there to keep those PRs surgical.

Follow-up to #1290 / PR #1304, which gated behavior: 'smooth' on prefers-reduced-motion in tab-bar-with-drag.tsx. The same ungated calls survive in two sibling tab bars — but those two components, and most of animations.ts, look like they have no consumer at all, so the question is delete-or-wire, not gate.

What's wrong

Ungated behavior: 'smooth', unchanged by #1304.

apps/desktop/src/renderer/src/components/tabs/tab-bar.tsx:69 and :74:

const scrollLeft = (): void => {
  if (!scrollRef.current) return
  scrollRef.current.scrollBy({ left: -200, behavior: 'smooth' })
}

apps/desktop/src/renderer/src/components/tabs/tab-bar-with-overflow.tsx:131 and :151:

tabsRef.current.scrollBy({ left: scrollAmount, behavior: 'smooth' })
...
activeTab.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' })

tab-bar-with-drag.tsx:53 already has the shared helper this would use:

window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth'

But both components appear dead. The only references to TabBar and TabBarWithOverflow in apps/desktop/src are the barrel re-exports at components/tabs/index.ts:6 and :8 and their own tests (cold-zero-components.test.tsx:13, tabs-components.test.tsx:7). Nothing renders them; the app uses TabBarWithDrag.

Same shape in animations.ts. components/tabs/animations.ts exports nine variant objects — tabVariants (:13), tabVariantsReduced (:42), contentVariants (:55), contentVariantsReduced (:81), splitPaneVariants (:94), dragFeedbackVariants (:113), dropZoneVariants (:133), fadeVariants (:154), slideInVariants (:163) — and index.ts does export * from './animations'. Grepping each name across apps/desktop/src, the only hits outside the file itself are in tabs-small-components.test.tsx, which asserts on their literal values (expect(tabVariants.animate.width).toBe('auto')). contentVariantsReduced has no reference anywhere at all, not even a test.

Why it matters

Nothing user-visible is broken — this code does not run. The cost is maintenance drag and false signal: the tests make three dead modules read as covered and healthy, which is exactly why the reduced-motion sweep for #1290 had to look at them, and why the next sweep will too. Anyone reading animations.ts reasonably assumes the reduced-motion variants are wired to something honouring the preference; they are not wired to anything.

Suggested direction

Confirm the dead-code claim first (check for dynamic/string-keyed usage and any consumer outside apps/desktop/src), then decide per module rather than gating: if TabBar / TabBarWithOverflow are superseded by TabBarWithDrag, delete them along with their tests and barrel exports, and the behavior: 'smooth' question disappears with them. animations.ts is the more interesting call — the reduced-motion variants suggest an intended motion system that was never connected, so it is worth deciding whether TabBarWithDrag should consume them before deleting. Tests that only assert on the literal values of an unconsumed object should go with whatever they were guarding.

Confirmed on

origin/main @ c0754c9 on 2026-08-12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit-2026-08-followupSurfaced while fixing the audit-2026-08 epic (#987), not part of the original auditimprovementSmaller polish, workflow, or quality improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions