feat: unified CLI output style + polling countdown/realtime indicator#29
Merged
Conversation
Introduce a single rendering layer so every command renders consistently, in a Claude Code-style tree (⏺ section headings, ⎿ branch groups), and surface live polling state to the user. Output style: - Add src/utils/ui.ts: the canonical layer (section/branch/fields/status/ success/info/warn/note) on top of styling.ts. - Centralise the status→colour→symbol mapping in styling.ts (statusPalette); formatStatus and ui both build on it. Reimplement sectionHeader to the ⏺ look. Export stripAnsi for ANSI-aware column alignment. - Migrate every command (status, list, whoami, login, logout, switch-org, upgrade, upload, live, cloud) and the polling display off hand-rolled colors/symbols layouts onto ui. - Remove dead/old-look helpers: box, listItem, keyValue, full-width dividers. - Add STYLE_GUIDE.md (rules + cookbook) and a pointer in CLAUDE.md. Polling UX: - results-polling.service.ts now shows a live countdown to the next backstop poll and, for logged-in users, whether Realtime is connected, ticking once a second under the status display. - realtime-gateway.ts exposes isConnected() and an onConnectionChange hook. Labels are now uniformly lowercase, dim and column-aligned; updated three integration assertions that pinned the old wording. Full suite (147) passes; typecheck and lint clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Output was inconsistent across commands — every command hand-rolled its own layout from
colors/symbols, thekeyValue()helper was unused, section headers were split between a full-width ruler and nothing, and the status→colour→symbol logic was copy-pasted in three places. This consolidates all rendering behind one layer with a documented style, and while inresults-polling.service.tsadds the live polling feedback that was requested (countdown + Realtime connection state).The visual language is a Claude Code-style tree:
⏺section headings with⎿branch groups of indented detail rows.What changed
Canonical rendering layer
src/utils/ui.ts(new) —section/branch/fields(ANSI-aware aligned key/values) /status/success/info/warn/running/note. Returns strings, so callers keep routing throughloggerand the--jsongate.src/utils/styling.ts— singlestatusPalette(the one source of truth for status colour+symbol;formatStatusanduiboth use it);sectionHeaderreimplemented to the⏺look;stripAnsiexported for column alignment. Removed dead/old-look helpers:box,listItem,keyValue, full-widthdividers.STYLE_GUIDE.md(new) — the rules + a cookbook; pointer added inCLAUDE.md.All commands migrated off bespoke layouts:
status,list,whoami,login,logout,switch-org,upgrade,upload,live(all sub-commands),cloud. The live polling display + final results table also use the shared palette now.Polling UX (
results-polling.service.ts+realtime-gateway.ts)isConnected()and anonConnectionChangehook.Notable decisions
Binary ID→binary id, the list "showing… " line). Easy to revert if you'd rather keep uppercase.dcd live's post-start hints now sit under a⏺ Next stepsheading.Testing
pnpm typecheckandpnpm lintclean (0 errors).dcd liveanddcd whoamirendering by hand.🤖 Generated with Claude Code