Skip to content

chore: remove dead Swift code, unused strings and stale comments - #411

Merged
arzafran merged 1 commit into
mainfrom
chore/remove-dead-swift-code
Oct 8, 2026
Merged

arzafran merged 1 commit into
mainfrom
chore/remove-dead-swift-code

Conversation

@arzafran

@arzafran arzafran commented Oct 8, 2026

Copy link
Copy Markdown
Member

What this does

Removes about 1,300 lines of Swift code that nothing calls, 18 UI strings nothing shows, and comments that describe old history instead of the current code. The app behaves the same. The four tmux-compat commands that only ever printed "not supported yet" (popup, bind-key, unbind-key, copy-mode) now report an unknown command instead.

Summary

Review order:

  1. Sources/TerminalController.swift, Sources/TerminalController+Debug.swift, CLI/programa.swift, CLI/SocketClient.swift: zero-caller helpers and constants. The at-budget files gain headroom.
  2. contracts/v2/methods.json and the generated files: debug.viewtree removed (no caller in CLI, MCP, tests or scripts). Regenerated with gen-v2-contract.py.
  3. Sources/WorkspaceContentView.swift, Sources/Panels/TerminalPanel.swift: the tmuxActivePane overlay target, which never had a producer for its layout report. Documented in docs/removed/tmux-active-pane-overlay.md. The overlay settings gate and the bonsplitPane target stay, since live code and tests use them.
  4. TabManager, Workspace, model and UI members with no callers; 20 unused shortcut wrappers in KeyboardShortcutSettings.swift; promptRenameSelectedWorkspace; the empty Sources/GhosttyTerminalView.swift and its project entries.
  5. The rest is Localizable.xcstrings deletions (each key had 0 references) and present-tense rewording of history comments.

Contract change: tests_v2/test_tmux_compat_matrix.py now asserts the four removed tmux commands are rejected, instead of asserting the old "not supported" message.

Kept on purpose: recordSurfaceDraw and the draw-count stats (a UI test reads renderDrawCount), and programaWithWindowFirstResponderBypass (per-event path, needs its own review).

Test plan

  • check-structural-budgets.py, check-v2-contract.sh, check-settings-docs.py pass locally.
  • programa, programa-cli and programa-unit build-for-testing succeed locally.
  • CI unit, UI and socket suites pass (the UI test target was not compiled locally).

@arzafran
arzafran merged commit 6a64a9e into main Oct 8, 2026
13 checks passed
@arzafran
arzafran deleted the chore/remove-dead-swift-code branch October 8, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant