Skip to content

[P2-31] Remove confirmed unused helpers and stale registrations #36

Description

@phranck

Problem

Current production code contains helpers with no call site, plus stale registration/comment paths that obscure real behavior. Confirmed unused declarations include:

  • EdgeInsets.containerDefault and .dialogDefault in Sources/TUIkit/Extensions/ViewConstants+EdgeInsets.swift.
  • FocusManager.hasSections in Sources/TUIkit/Focus/Focus.swift.
  • FocusSection.clearFocusables in Sources/TUIkit/Focus/FocusSection.swift.
  • BorderRenderer.focusIndicatorWidth in Sources/TUIkit/Rendering/BorderRenderer.swift.
  • SplitViewPage.visibilityLabel in Sources/TUIkitExample/Pages/SplitViewPage.swift.

MockTerminal is not dead code; it is needed for runtime/terminal integration and must be retained.

Proposed solution

  • Remove the confirmed helpers, their now-empty files, and downstream imports/comments if applicable.
  • Sweep registrations, exports, disables, and comments made stale by the removal.
  • Use compiler/reference checks and module-isolated tests before classifying any additional symbol as dead.
  • Keep test infrastructure that is unused only because integration coverage is currently missing.

Acceptance criteria

  • Every removed declaration has no source, test, generated, or documented consumer.
  • Empty files and misleading comments/registrations are removed.
  • No public API is removed without compatibility-manifest review.
  • MockTerminal remains and gains consumers through runtime tests.
  • Targeted tests plus warning-free Swift 6.0 macOS/Linux gates pass.

Dependencies

None for the listed private/internal helpers. Coordinate any public deletion with #35.

Parallelization

Parallel-ready. Small isolated cleanup with minimal overlap; do not expand it into speculative refactoring.

Commit structure

  • Split this issue into small, thematic, independently revertible commits wherever the work can remain coherent.
  • Every commit must build and keep its applicable tests/gates green. Do not commit an intentionally failing regression test; use local/known-issue characterization or land the test with the smallest fix.
  • Keep characterization/fixtures, mechanical renames or moves, semantic changes, and documentation/migration updates separate when each step remains green.
  • The issue boundary is not a commit boundary; multiple commits are expected for independently reversible changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparallel-readyCan proceed independently of the current critical pathpriority: mediumImportant follow-up after critical and high dependencies

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions