Skip to content

Delete dead legacy terminal code (AppState, raw-mode functions, duplicate spinners) #94

@joshuacrass

Description

@joshuacrass

Problem:
The codebase contains a layer of legacy pre-BubbleTea code that is no longer reachable from the TUI runtime:

  • AppState struct in main.go (comment: "kept for compatibility with legacy code still being migrated" — no migration is in progress)
  • renderHeader, renderStatusBar, printIssueDetail, printPRDetail, printIssuesTable in render.go / terminal.go — write directly to stdout via fmt.Printf, which would corrupt the BubbleTea alt-screen buffer if ever called during TUI operation
  • withSpinner, startSpinner / stopSpinner in terminal.go — two duplicate spinner implementations, neither used from any BubbleTea Update handler
  • confirmAction in terminal.go — calls form.Run() which takes over stdin/stdout

This dead code increases cognitive surface area, creates a silent correctness risk if accidentally invoked during TUI operation, and contains stty calls and clearScreen side effects.

Solution:
Audit every function in terminal.go and the legacy rendering functions in render.go. Delete any that are not reachable from the BubbleTea AppModel.Update or AppModel.View path. Delete AppState.

Acceptance Criteria:

  • AppState is deleted
  • All unreachable raw-mode functions are deleted
  • Both legacy spinner implementations are deleted
  • go vet ./... and go test ./... pass after deletion
  • No BubbleTea Update/View path calls any function that writes directly to stdout

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort:3Medium effort (3-8 hours)priority:mediumMedium priority - fix when possibletype:refactorCode refactoring

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions