Skip to content

Improve how DNS records are displayed#2

Open
sbastn wants to merge 1 commit into
mainfrom
ux/records-table
Open

Improve how DNS records are displayed#2
sbastn wants to merge 1 commit into
mainfrom
ux/records-table

Conversation

@sbastn
Copy link
Copy Markdown
Member

@sbastn sbastn commented Mar 18, 2026

This PR improves the formatting of the DNS records:

  • Long content no longer flows out of their cell
  • Adapts to any resolution

👀 Preview

Before

Screenshot 2026-03-18 at 15 50 10

After

Screenshot 2026-03-18 at 15 51 19

On a different resolution (smaller size):
Screenshot 2026-03-18 at 15 52 49

Summary

  • replace the tabwriter-based table renderer with a width-aware renderer that wraps oversized cells
  • detect terminal width from the TTY, with a COLUMNS fallback, and keep a test hook for deterministic wrapping
  • add regression coverage for long wrapped table cells

QA

  • make build
  • bin/dnsimple records list jacegu.com

@sbastn sbastn self-assigned this Mar 18, 2026
@sbastn sbastn requested a review from weppos March 18, 2026 14:54
@sbastn sbastn added the enhancement New feature or request label Mar 18, 2026
@sbastn sbastn changed the title Wrap long table cells in record listings Improve how DNS records are displayed Mar 18, 2026
@weppos
Copy link
Copy Markdown
Member

weppos commented Mar 18, 2026

Can you explain why you are branching out table with unix and table with other? What issue did you experience specifically, and in which OS?

@sbastn
Copy link
Copy Markdown
Member Author

sbastn commented Mar 18, 2026

I split it because terminal width detection here uses a Unix-specific call to get the window size of the terminal. It uses the golang.org/x/sys/unix package. That works on macOS/Linux, but it is not portable to Windows or other non-Unix targets, so the other file is just a build-safe fallback.

I didn’t hit an OS-specific runtime bug. The issue was portability: without the split, the output package would stop compiling cleanly outside Unix-like systems.

I developed/tested this on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants