chore: TUI polish from audit low-severity findings - #67
Merged
Conversation
- Jump-mode cell addresses now use checked base-26 arithmetic; 14+ letters returned garbage in release builds and panicked in debug. - Search-match highlighting uses a HashSet instead of a linear Vec scan per visible cell per frame, which lagged with many matches. - Remove the dead search progress indicator: perform_search is synchronous, so the progress state was set and cleared without ever rendering. - Auto-sized column widths (-H) measure chars, not bytes, so multibyte UTF-8 content no longer over-sizes columns. - Column layout uses Ratio instead of Percentage(100/width), which truncates to 0% past 100 columns and collapsed every column.
bgreenwell
force-pushed
the
chore/tui-polish
branch
from
July 11, 2026 02:30
5a38e42 to
14caa5a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batches the five low-severity findings from the code audit that never got individual issues:
parse_cell_addressused uncheckedcol * 26 + …, so a 14+ letter address wrapped silently in release builds (wrong jump target) and panicked in debug. Now checked, returningNone. Regression test included.Vec::containsper visible cell per frame — O(matches × visible cells). A common-letter query on a large sheet yields tens of thousands of matches and visible lag. Matches are now mirrored into aHashSetfor O(1) lookups; theVecstays for next/prev ordering.perform_searchis synchronous, soProgressInfowas set and cleared without a render ever happening between — the ⏳ UI could never appear. Removed (~40 lines).-Hauto-sizing measuredstr::len()(bytes), over-sizing columns for accented/CJK content. Nowchars().count(), matching the width heuristic used elsewhere.Percentage(100 / width), which truncates to 0% past 100 columns, rendering every column invisible without-H. NowConstraint::Ratio(1, width).Net −30 lines. fmt/clippy clean, 56 unit + 38 integration tests pass. TUI smoke-tested under a pty (launch, render, quit); a scripted search-input hang turned out to reproduce identically on main and is a pty stdin-preloading artifact of the harness, not app behavior.