Skip to content

refactor(tui): remove redundant code - #40081

Merged
kitlangton merged 1 commit into
v2from
tui-simplify
Aug 1, 2026
Merged

refactor(tui): remove redundant code#40081
kitlangton merged 1 commit into
v2from
tui-simplify

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Remove redundant V2 TUI code discovered during a broad simplification audit. The rendered UI and interaction behavior remain unchanged, while the sidebar scrollbar follow-up avoids touching a destroyed renderable if its deferred reset runs after unmount.

Before / After

Before

The sidebar queued a scrollbar visibility reset without checking whether the keyed session view had already unmounted. Several TUI paths also maintained duplicate derived memos, selection calculations, registrations, conditions, and unused declarations.

After

The deferred scrollbar reset safely no-ops after destruction. Existing shared selection helpers and derived values replace duplicate logic, and unreachable or unused code is removed.

How

  • Guard the sidebar scrollbar microtask with scroll.isDestroyed.
  • Reuse the shared select controller for autocomplete wrapping and viewport reveal.
  • Remove an unused dialog helper, two unused types, and duplicate spinner registration.
  • Collapse redundant prompt footer memos and repeated vertical-tab pulse state.
  • Derive available session width once and remove an unreachable mini prompt queue branch.

Scope

This is limited to behavior-preserving V2 TUI cleanup. It does not include the larger plugin lifecycle, diff viewer, theme, or mini TUI consolidations identified during the audit.

Testing

  • bun typecheck from packages/tui
  • bun run test from packages/tui: 586 passed, 5 skipped, 0 failed
  • Focused TUI tests: 27 passed, 0 failed
  • Pre-push workspace typecheck: 33 packages passed
  • git diff --check

Demo

Not applicable: the refactor intentionally preserves settled TUI output and interactions.

@kitlangton
kitlangton merged commit 5d72952 into v2Aug 1, 2026
11 of 12 checks passed
@kitlangton
kitlangton deleted the tui-simplify branch August 1, 2026 18:22
github-actionsBot pushed a commit to ReStranger/opencode that referenced this pull request Aug 3, 2026
* upstream/v2:
test(core): stabilize shell integration timing (anomalyco#40084)
fix(core): route Bedrock packages natively (anomalyco#40165)
feat(ai): add native Bedrock Mantle support (anomalyco#40119)
fix(tui): reserve home and end for navigation (anomalyco#40123)
refactor(ai): align multimodal naming (anomalyco#40073)
refactor(tui): remove redundant code (anomalyco#40081)
fix(tui): discover plugins across config roots (anomalyco#39988)
fix(tui): make vertical tabs responsive (anomalyco#40080)
feat(tui): add vertical session tabs (anomalyco#40072)
fix: preserve provider error status (anomalyco#39976)
fix(tui): prevent sidebar scrollbar flash (anomalyco#40056)
feat(tui): prioritize favorite model search results (anomalyco#40049)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@kitlangton