Skip to content

Delete the dead TUI, and add a check that could have seen it - #653

Merged
jeremy merged 1 commit into
mainfrom
delete-dead-tui
Aug 24, 2026
Merged

Delete the dead TUI, and add a check that could have seen it#653
jeremy merged 1 commit into
mainfrom
delete-dead-tui

Conversation

@jeremy

@jeremyjeremy commented Aug 22, 2026

Copy link
Copy Markdown
Member

Rebased onto main. This was stacked on #652, which has since merged; the branch has been rebased so the diff is this PR's own 6 files and nothing else. Earlier review comments referring to a stacked base or a larger changed-file count predate that rebase.

Pure removal, plus one new (non-gating) make target. Separate from #652 so that stays reviewable as a bug fix.

Delete

internal/tui/spinner.go (187 lines) and internal/tui/paginated_picker.go (415 lines) have no callers — 602 lines of exported API nothing in the repo or the binary reaches, each holding a tea.NewProgram. Verified symbol by symbol before removing, not by file-level grep; the surviving Spinner matches elsewhere are bubbles/spinner's own struct field. Neither file had a test.

Removing internal Go symbols does not touch .surface, which tracks the CLI command surface, so no .surface-breaking entry is needed.

The allowlist in #652's launcher check shrinks from four files to two, which is the point — both deleted files were on it only as "no callers; slated for deletion."

Why unused could never have found this

.golangci.yml enables unused (staticcheck U1000), and it is the repo's only dead-code check. It runs per-package and treats every exported identifier in a non-main package as used by definition. That is exactly why 602 lines of exported, zero-caller internal/tui API survived it. No configuration fixes this — the analysis cannot see across package boundaries.

make deadcode

golang.org/x/tools/cmd/deadcode starts from a main and follows the call graph, so it sees what unused structurally cannot.

Rooted at the binary, not ./.... Only main packages are roots, so deadcode ./... loads every package and then reports everything no main reaches as unreachable — 1100+ of its 1250 lines here are the dev-tagged workspace tree, which the untagged build genuinely cannot reach. True, and useless. Naming the binary gives two answers worth reading:

deadcode ./cmd/basecamp what a released basecamp can never run
deadcode -tags=dev ./cmd/basecamp the same, with the dev `basecamp tui` tree

The version is pinned and invoked via go run, so output does not depend on what happens to be installed on the machine.

Deliberately NOT wired into make check. It is a report to read, not a gate: some zero-caller exported symbols are a deliberate API surface, and the dev tree is legitimately partial. Land the target, look at real output, decide separately. Adding a noisy gate is how a control nobody sized gets built.

It earned its keep immediately — it flagged two helpers that #652 had orphaned, which were removed there.

Scope

Held to the two TUI files. The other candidates originally considered — internal/models, internal/sdk, sdk/errors, resolve/comment_thread.go — are a separate backlog. internal/sdk in particular is documented in AGENTS.md as the SDK wrapper, and deleting it would mean editing the SDK-sync workflow in the same breath.

bin/ci green on this branch.


Summary by cubic

Removes two dead TUI launchers and adds a pinned whole-program dead-code report to catch similar cases. No CLI or runtime changes; .surface unchanged.

  • Delete internal/tui/spinner.go and internal/tui/paginated_picker.go; drop the dead-launchers block from internal/tui/forms_test.go; shrink the bubbletea launcher allowlist in internal/tui/launchers_test.go.
  • Add make deadcode (pinned golang.org/x/tools/cmd/deadcode@v0.40.0) that analyzes ./cmd/basecamp and again with -tags=dev; invoked via go run; report-only (not in make check) because unused cannot see cross-package dead code.
  • Document usage and GOOS/GOARCH caveats in AGENTS.md (root at the binary; analyze one target at a time; for cross-target runs: go install golang.org/x/tools/cmd/deadcode@v0.40.0 then GOOS=windows deadcode ./cmd/basecamp). No migration required.

Written for commit 4cf5fea. Summary will update on new commits.

Review in cubic

CopilotAI balanced review requested due to automatic review settings August 22, 2026 19:56
@github-actionsgithub-actionsBot added tui Terminal UI tests Tests (unit and e2e) docs labels Aug 22, 2026

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes unreachable TUI APIs and adds an optional whole-program dead-code report, building on #652’s launcher safeguards.

Changes:

  • Deletes two unused TUI implementations totaling 602 lines.
  • Adds pinned production and dev-tagged dead-code scans.
  • Updates launcher allowlisting and contributor documentation.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
MakefileAdds the non-gating deadcode target.
internal/tui/spinner.goRemoves the unused spinner API.
internal/tui/paginated_picker.goRemoves the unused paginated picker API.
internal/tui/launchers_test.goRemoves deleted files from the launcher allowlist.
AGENTS.mdDocuments dead-code analysis usage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

CopilotAI review requested due to automatic review settings August 23, 2026 02:16

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment threadMakefile
CopilotAI review requested due to automatic review settings August 23, 2026 02:22

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

CopilotAI review requested due to automatic review settings August 23, 2026 02:31

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

CopilotAI review requested due to automatic review settings August 23, 2026 02:38

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

CopilotAI review requested due to automatic review settings August 23, 2026 02:45

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

CopilotAI review requested due to automatic review settings August 23, 2026 03:14

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:8e02a011db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadMakefile
CopilotAI review requested due to automatic review settings August 23, 2026 03:27

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

CopilotAI review requested due to automatic review settings August 23, 2026 03:40

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Base automatically changed from close-hang-family-prompt-floor to mainAugust 24, 2026 02:05
internal/tui/spinner.go and internal/tui/paginated_picker.go have no
callers — 602 lines of exported API nothing in the repo or the binary
reaches, each holding a tea.NewProgram. Verified symbol by symbol before
removing; the surviving `Spinner` matches are bubbles/spinner's own field.
Neither had a test file. Removing internal Go symbols does not touch
.surface, which tracks the CLI command surface, so no .surface-breaking
entry is needed.
The reason this survived is worth fixing too. `unused` (staticcheck U1000)
is the repo's only dead-code check, it runs per-package, and it treats
every exported identifier in a non-main package as used by definition. It
is structurally incapable of reporting any of this, and no configuration
changes that.
So add `make deadcode`, which starts from a main and follows the call
graph. Rooted at ./cmd/basecamp, and again with -tags=dev, because those
answer different questions. Not `./...`: only main packages are roots, so
loading every package makes deadcode report everything no main reaches —
1100+ of 1250 lines here, nearly all the dev-tagged workspace tree, which
the untagged build genuinely cannot reach. True, and useless. The tool
version is pinned and invoked with `go run`, so the output does not depend
on what happens to be installed.
Deliberately NOT wired into `make check`. It is a report to read, not a
gate: some zero-caller exported symbols are a deliberate API surface, and
the dev tree is legitimately incomplete. Land the target, look at real
output, decide separately. Adding a noisy gate is how a control nobody
sized gets built.
Scoped to the two TUI files. The other candidates the plan listed —
internal/models, internal/sdk, sdk/errors, resolve/comment_thread.go —
are a separate backlog; internal/sdk in particular is documented in
AGENTS.md as the SDK wrapper and touching it means editing the SDK-sync
workflow in the same breath.
CopilotAI review requested due to automatic review settings August 24, 2026 02:51

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@jeremy
jeremy merged commit 4e449d0 into mainAug 24, 2026
25 checks passed
@jeremy
jeremy deleted the delete-dead-tui branch August 24, 2026 08:14
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docstestsTests (unit and e2e)tuiTerminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jeremy