Skip to content
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

Dynamic right-alignment of dates #54

Closed
wants to merge 1 commit into from

Conversation

jnd-au
Copy link
Contributor

@jnd-au jnd-au commented Oct 9, 2024

This PR also adds some unit test support:

  • main.test.go: Stable UTC data model for reproducible tests
  • main.test.go: stripAnsiControlSequences to ignore colours (clean test data)
  • view_test.go: Use txtar to read, write, and annotate human-readable test data (easy git diffing)
  • testdata/view: Test dynamic right-alignment of dates in narrow, medium, and wide cases

- Use COLUMNS env var or dynamic terminal width (up to UIWidth max)
- Refresh each time, in case the user’s terminal is resized
- Fix oz#53 (regression since e4e6d44)
@oz
Copy link
Owner

oz commented Oct 15, 2024

Thanks for this fix. 😄 🙏🏻

I've rebased the changes on the main branch here, as they were in conflict with commits made after the PR was opened.

Side note: I'm not sure I like refreshing so often, but eh... trade-offs. This is something that could maybe be optimized later. 🔮

@oz oz closed this Oct 15, 2024
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.

Regression: Dates are truncated
2 participants