-
Notifications
You must be signed in to change notification settings - Fork 0
feat: improve text formatter column alignment #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the human-readable text output in internal/output by replacing brittle fixed-width formatting with alignment that adapts to real content lengths, plus truncation for overly-long fields.
Changes:
- Mailbox listing now uses
text/tabwriterto keep columns aligned for long mailbox names. - Email list rendering now computes dynamic column widths and truncates long sender/subject values with
.... - Added regression tests for truncation and column alignment behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/output/text.go | Switch mailbox formatting to tabwriter; rework email list alignment to computed widths; add truncation helper/constants. |
| internal/output/text_test.go | Add tests for truncation and for mailbox/email list alignment (including a Unicode-focused case). |
| docs/plans/todo/2026-02-10-improve-text-column-formatting.md | Add implementation plan documenting the intended approach and verification steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Avoid unnecessary []rune allocation in truncate when no truncation is needed by checking utf8.RuneCountInString first - Add -1 guard checks in alignment test assertions to prevent false-pass when expected substrings are missing - Update Copilot instructions to document that plan docs are historical records not meant to be maintained
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
tabwriterso columns stay aligned for long mailbox namesTesting