Skip to content

feat(doctor): flutter-doctor-style report with two-colour status markers#124

Merged
ikeikeikeike merged 1 commit into
mainfrom
feat/doctor-flutter-style
Jul 22, 2026
Merged

feat(doctor): flutter-doctor-style report with two-colour status markers#124
ikeikeikeike merged 1 commit into
mainfrom
feat/doctor-flutter-style

Conversation

@ikeikeikeike

Copy link
Copy Markdown
Member

Makes bough claude doctor read like flutter doctor: per-section [✓]/[!]/[✗]/[·] rollup headers, glyph-led detail lines, and two colours on a TTY (green OK / red attention; neutral stays plain).

Colour gate TTY (termio.IsTTY, shared with the spinner) + NO_COLOR unset + TERM≠dumb. Pipe / CI / redirect → identical layout, plain glyphs.
Rollup section = worst status inside. A correctly-wired repo is [✓]; the cross-scope caveat drops to a heads-up (was a nagging [!]); only a live double-fire is [✗].
Tests new termio.Styler/Status (two-colour map, plain-on-non-TTY, rollup order, message-text-never-coloured); doctor section-rollup; conformance updated. 30 pkg pass, lint 0.

Verified by eye on a faked TTY: green , red [✗] on a real double-fire, red [!] on an exported API key, plain glyphs through a pipe.

Refs: internal/termio/color.go

The doctor was one colour with a ✓ on almost every line, so "which block needs
me" did not stand out — the exact complaint. It now reads like flutter doctor:
each section (Hook wiring / Observer / Cost meter / Continuous learning) leads
with a [✓] / [!] / [✗] / [·] header that rolls up the worst status of its
lines, and every detail line leads with the matching glyph, so the markers scan
down a column.

Colour is two hues only, by request: green for OK, red for warn+error (with two
colours, "look here" and "broken" share the attention hue), and neutral /
informational lines stay uncoloured so they never compete for the eye. It is on
only when stdout is a real terminal (termio.IsTTY, the same isatty check the
spinner uses — now shared rather than duplicated), NO_COLOR is unset, and TERM
is not "dumb". A pipe, a redirect, a CI log, or a NO_COLOR user gets the
identical layout in bare glyphs — the "only colour where it renders reliably,
otherwise leave it white" contract, backed by go-isatty rather than a guess.

One semantic fix falls out of giving sections a rollup: a correctly-wired repo
with no live conflict now rolls up to [✓]. The cross-scope caveat ("a plugin
MIGHT be enabled elsewhere") drops from a [!] to a • heads-up, because painting
every correct setup yellow is the nagging the redesign exists to remove. Only a
double-fire happening in this settings.json right now paints the section [✗].

The marker/colour logic is a new termio.Styler + Status, unit-tested for the
two-colour mapping, the TTY-off plain path, the rollup ordering, and the
property that message text is never wrapped in an escape sequence (so tokens a
test or a grep looks for are never split). Verified by eye on a faked TTY:
green ✓ marks, a red [✗] on a real double-fire, a red [!] on an exported API
key, plain glyphs through a pipe.
@ikeikeikeike
ikeikeikeike merged commit a9b5399 into main Jul 22, 2026
11 checks passed
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