fix(search): show previews for commands truncated by custom columns - #3601
fix(search): show previews for commands truncated by custom columns#3601ychampion wants to merge 1 commit into
Conversation
Fossier: Manual Review Requested
Score BreakdownTotal Score: 60.4/100 | Confidence: 100% | Outcome: REVIEW
|
Greptile SummaryFixes incorrect preview-height calculation when users configure extra UI columns (
Confidence Score: 5/5Safe to merge — the change is isolated to preview height calculation and has no effect on data or history storage. The fix replaces a hardcoded constant with a dynamic computation that correctly accounts for all configured columns. The math reproduces the original behaviour with default columns, the new test covers the reported scenario, and there are no side effects outside the display path. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Ensure auto previews follow configured r..." | Re-trigger Greptile |
Constraint: Preview truncation must follow both the configured column layout and terminal display width. Rejected: Retain the fixed 19-cell subtraction | fails when users add or resize result columns. Confidence: high Scope-risk: narrow Directive: Keep preview-height math aligned with the result-row column widths. Tested: cargo test -p atuin --no-default-features --features client --bin atuin; cargo clippy -p atuin --tests -- -D warnings -D clippy::redundant_clone; cargo fmt --all -- --check; git diff --check Not-tested: Manual TUI smoke testing on non-Linux platforms
6065642 to
f17fac7
Compare
Summary
Why
The auto strategy still assumed the default 19-cell prefix. With
datetimeandexitcolumns enabled, the selected command can be truncated even though the preview calculation thinks it fits.Fixes #3599.
Validation
cargo test -p atuin --no-default-features --features client calc_preview_height -- --nocapture- passed (2 tests)cargo test -p atuin --no-default-features --features client --bin atuin- passed (200 tests)cargo clippy -p atuin --no-default-features --features client --bin atuin -- -D warnings -A unused-variables- passedcargo fmt --all -- --check- passedChecks