Skip to content

Conversation

@JoeColeman95
Copy link
Contributor

@JoeColeman95 JoeColeman95 commented Dec 23, 2025

Description

This PR aims to remove BubbleTea alternate screens, remove lipgloss styling and implement a unicode progress bar for bulk operations. The aforementioned changes have mostly been replaced with a simple tabular view, using ANSI codes for additional styling to improve readability.

All changes have been implemented keeping in mind the variance of different terminals. As such, the new styling (dim, bold, italic, underlined and strikethrough), all respect constraints of terminals, if it's got TERM=dumb, or NO_COLOR, etc. For example, if a terminal is only able to display dim/bold, the text will be formatted as plain-text for other style types due to the ANSI, it will not show the ANSI as an output (tested this with quite a few terminal types)

Further to this, the table in TTY will scale according to the available space, truncating when it would result in line-wrap (as that'd be really ugly). When in non-TTY, this has a fixed width.

When in non-TTY, all formatting is entirely removed, including color and a fixed terminal width of 120 is used. This can be adjusted with BUILDKITE_TABLE_MAX_WIDTH (this will be documented in Buildkite Docs after the fact).

The following environment variables are accepted for conforming to standard practises: NO_PAGER, BUILDKITE_NO_PAGER, NO_COLOR, TERM=dumb, PAGER=less, etc. These will also be documented.

Added a pager across all of the show me something items in the CLI, too. This is pretty standard across CLI tools, so it's nice to be part of the club.

Added the availability of no_pager: bool to the config (.bk.yaml) to disable this functionality.

--no-pager was also added as a global flag to disable the pager (when not auto-detected, or set via env var or config)

Past that, we have a progress bar on bk agent stop now, which is nice. I would've done the same for bk artifacts download, but that was a major refactor and would've been out of scope.

We still default to JSON everywhere, so this will be invisible for the most part, anyway. These changes are specific to --output text

Changes

  • Removed BubbleTea, Lipgloss and Bubbles dependencies
  • Deleted internal/ui package and all TUI components
  • Deleted internal/agent/* (entire agent TUI system)
  • Deleted internal/keys/* and internal/list/* (TUI key handlers)
  • Removed pkg/style/style.go (Lipgloss styling)
  • Added pager helper (internal/io/pager.go) with support for PAGER env var
  • Added --no-pager global flag to disable paging
  • Added BUILDKITE_NO_PAGER and NO_PAGER environment variables to disable paging
  • Added no_pager: bool config option in .bk.yaml
  • Added table renderer (pkg/output/table.go) with ANSI styling
  • Added pkg/output/color.go for color detection (NO_COLOR, TERM=dumb)
  • Added pkg/output/value.go for value formatting
  • Added internal/io/progress.go for progress bar rendering
  • Added BUILDKITE_TABLE_MAX_WIDTH environment variable to override table width
  • Replaced output across all list, view and watch commands to use new table renderer
  • Tables auto-size on TTY and use fixed width (default 120) on non-TTY
  • ANSI styling respects NO_COLOR, TERM=dumb, and non-TTY environments
  • Added Unicode progress bar to agent stop for bulk operations
  • Refactored agent stop to use worker pool pattern instead of semaphore
  • Added tests for all affected areas

Testing

  • Tests have run locally (with go test ./...)
  • Code is formatted (with go fmt ./...)

Disclosures / Credits

  • Used Claude when I was getting conflicting info between docs for TTY/non-TTY, color handling, pagers, etc.
  • Created some test scaffolding, too, because tests are fun. But had to re-write most of them myself as I kept polishing the codebase after the fact (this can be seen in the commits)
  • 100% of the code committed besides tests were written by me (and even then, tests are 90%+ myself)
  • 100% of design choices were made by myself
  • This has been tested across a number of terminals, ensuring all functionality works as it did before
  • No changes are breaking for any flows users may currently have now

Adding table.go to handle output to a table format (adds dep runewidth to properly scale)
Adding pager.go to handle paging
Adding color.go to respect NO_COLOR
Slightly reworked metadata here to be able to output the queue cleanly in the table view
- Replaced Bubble Tea bulk stop with fmt progress bar (using shared progress bar helper)
- Added ASCII-only output, delaying error printing, with a limit clamp
- Removed Bubble Tea import
- Removed all bubble tea deps from internal/agent
- Moved the single use functions in view.go internal to just be in view.go itself as they don't need to be exported
- Removed internal/agent entirely as it was empty :~)
- Uses output.Table and pager for --output text
- Refactored output once through the pager as was trying to write data on the fly
Impliments the table and pager in job list, removes lipgloss
- Added standardized table view and pager
- Added a header for URL as data was pretty lacking
- Removed lipgloss
- Added header for all other list commands for consistency
Allow pager to be disabled without specifying --no-pager
- Switch build view to the new table renderer and drop tea/lipgloss
- Adding shared summary helpers for consistent output
- Add pager to build view
Adds global check for no pager
Updates color checks to ensure isatty or dumb term now too
Removes all of the old UI, cleans up packages and updates missed references
Refactored the build listing command to handle streaming output and header printing, updated the confirmation prompt to print to stderr instead of stdout so prompts are still interactive in pager mode
Slightly changed string truncation logic in annotation summaries and job views to operate on runes instead of bytes, to ensure correct handling of unicode chars, preventing cuts in the wrong places
Using slice instead as was a little in-accurate
Coverage was OK but could be better, improved to be more thorough
Was hammering resources because it was unbound, I've capped it now so that we don't spawn loads of go routines
No longer needed as we now bound go routines properly
Would break out of the table view due to /n, made it csv to avoid this, updated test expected results
Rather than showing "Connected", it will now return the actual state, e.g., running, idle, paused. Added test for this
Add a plurization helper to make agent agents when more than 1 exists, made output cleaner
Output table will now scale accordingly, truncating text where overflow would occur
Added test case
Added signal handling to cancel gracefully. Improved output, too.
@JoeColeman95 JoeColeman95 marked this pull request as ready for review December 30, 2025 17:48
@JoeColeman95 JoeColeman95 requested a review from a team as a code owner December 30, 2025 17:48
@JoeColeman95 JoeColeman95 changed the title Sup 4494/remove bubble tea Simplify text outputs, remove Lipgloss, BubbleTea/Bubbles Dec 30, 2025
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.

2 participants