Skip to content

fix: polish CLI table output - #39

Closed
N283T wants to merge 1 commit into
mainfrom
fix/cli-table-polish
Closed

fix: polish CLI table output#39
N283T wants to merge 1 commit into
mainfrom
fix/cli-table-polish

Conversation

@N283T

@N283T N283T commented Apr 16, 2026

Copy link
Copy Markdown
Owner

Summary

Three visual polish fixes found during live testing of #38:

  • extractSnippet normalizes embedded whitespace — search result snippets no longer contain literal \n/\t or double spaces
  • Column.max_width caps per-column width; applied to the Kind column (category/item) at 10 so it stops getting squeezed to cat… when the Match column is long
  • renderBoxed shrink switched from proportional to greedy (largest-first) — narrow columns are preserved, excess is absorbed by whichever column is widest

Before / After

mmcif-dict search "electron density" (140 cols, fake tty):

Before:

│ cat… │ pdbx_dcc_map                             │ dual map properties such as
	Real Space electron density Correlation Coefficien… │

After:

│ category │ pdbx_dcc_map                                    │ dual map properties such as Real Space electron density Correlation Coef… │

Test plan

  • zig build test — 55 pass (52 prior + 3 new: whitespace normalization, max_width cap, greedy shrink)
  • uv run --script tests/test_smoke.py — 25 pass (unchanged)
  • Manual: search "electron density" and relations atom_site in a fake tty — visible improvement, no regressions

Out of scope

  • Description dedent sometimes fails when the source .dic has outlier lines (e.g. last line at col 0); median-indent heuristic is a separate follow-up

- extractSnippet normalizes embedded whitespace (no more raw \n/\t in search)
- table.Column.max_width caps per-column width (applied to Kind at 10)
- renderBoxed shrink switched from proportional to greedy (largest-first)
@N283T

N283T commented Apr 16, 2026

Copy link
Copy Markdown
Owner Author

Closing unmerged. The tabular output approach doesn't fit mmCIF identifier data (20-40 char IDs don't pack into 80-col terminals without destructive truncation). Rolling back PR #38 entirely in a follow-up revert PR.

@N283T N283T closed this Apr 16, 2026
@N283T
N283T deleted the fix/cli-table-polish branch April 16, 2026 06:23
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