Skip to content

Conversation

@cboone
Copy link
Owner

@cboone cboone commented Feb 11, 2026

Summary

  • replace fixed-width mailbox formatting with tabwriter so columns stay aligned for long mailbox names
  • rework email list rendering to compute dynamic column widths and truncate long sender or subject values with ellipses
  • fix Unicode alignment by using rune-counted widths and add regression tests for truncation and column alignment

Testing

  • go test ./internal/output/...
  • go vet ./...

Use tabwriter for dynamic mailbox column alignment instead of fixed
40-char widths. Use two-pass width calculation for email lists instead
of fixed 30/50-char widths. Add truncate helper with ellipsis for
long sender names (40 chars) and subjects (80 chars).

Closes #3, closes #4
Copilot AI review requested due to automatic review settings February 11, 2026 00:07
Copy link
Contributor

Copilot AI left a 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/tabwriter to 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.

Copy link
Contributor

Copilot AI left a 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
Copy link
Contributor

Copilot AI left a 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.

@cboone cboone merged commit 8e6e2c7 into main Feb 11, 2026
7 checks passed
@cboone cboone deleted the feature/improve-text-formatting branch February 11, 2026 01:15
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