Skip to content

Remove dead modules, dead code in showcase, and stale test helpers#96

Merged
meszmate merged 1 commit intomainfrom
cleanup/remove-slop
Apr 24, 2026
Merged

Remove dead modules, dead code in showcase, and stale test helpers#96
meszmate merged 1 commit intomainfrom
cleanup/remove-slop

Conversation

@meszmate
Copy link
Copy Markdown
Owner

Summary

Audit pass for code that has no callers anywhere — files were imported nowhere, helpers were defined but never called, computed values were explicitly discarded. Net -584 lines, no behavior change, no public API removed beyond the two dead modules.

What was removed

File Why
`src/style/renderer.zig` (177 lines) Defines `RenderContext`, `stripAnsi`, `hasAnsi`, `truncate` — zero references in src, examples, or tests. Six test files that needed an ANSI stripper each rolled their own rather than reusing this one.
`src/testing/record_replay.zig` (372 lines) `Recorder` / `Player` for TUI session capture. No example, no test, no other src file uses it. Speculative API that didn't earn its place. (4 root.zig re-exports also dropped.)
`examples/showcase.zig` (~25 lines) `renderVerticalBars()` built a bar chart whose result was thrown away by an explicit `_ = vertical_box;` discard line. The helper, the call site, and the dead binding all ran every frame for no visible output.
`tests/markdown_tests.zig` (6 lines) Orphaned `renderMd` helper at the top of the file: never called, plus a latent use-after-free (returned slice from an arena destroyed on function return).

Audit notes — what was not removed

  • `transforms` namespace and `StyleRange` / `renderWithRanges` / `renderWithHighlights` — unused inside the codebase but documented in README, so they're intentional public API. Left alone.
  • The `*.zig` example files (e.g. `text_editor`, `focus_form`, `dashboard`) that overlap with `showcase` tabs — kept as small focused single-component demos. They're better learning entry points than the 1000-line showcase.
  • All other root.zig re-exports — convenience, low cost, real users.

Test plan

  • `zig build` passes
  • `zig build test` — full suite passes
  • All 44 example binaries still build

Audit pass over src/, examples/, and tests/ for code that has no
callers anywhere. Found:

* src/style/renderer.zig (177 lines) — defines RenderContext,
  stripAnsi, hasAnsi, truncate. Zero references in src, examples,
  or tests. The 6 test files that needed an ANSI stripper each
  rolled their own rather than reusing this. Delete; if anyone
  needs it later it can come back tied to actual callers.

* src/testing/record_replay.zig (372 lines) — Recorder/Player for
  TUI session capture. No example, no test, no other src file
  uses it. Speculative API that didn't earn its place. Delete plus
  drop the four root.zig re-exports.

* examples/showcase.zig — renderVerticalBars() built a bar chart
  whose result was thrown away by an explicit "_ = vertical_box"
  on line 790. Delete the helper, the call site, and the dead
  computed binding (~25 lines of code that ran every frame for
  no visible output).

* tests/markdown_tests.zig — orphaned renderMd helper at the top
  of the file: never called, plus had a latent use-after-free
  (returned slice from an arena destroyed on function return).

Build passes, full test suite passes. No public API removed
beyond the two dead modules.
@meszmate meszmate merged commit d37734b into main Apr 24, 2026
9 checks passed
@meszmate meszmate deleted the cleanup/remove-slop branch April 24, 2026 13:38
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