Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Enforce the terminal style system + terminology (CLI)#368
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ffc8dc2
Enforce the terminal style system + terminology (CLI)
LukasWodka bac1ef9
Address Bugbot (parity): make the brand-colour check case-insensitive
LukasWodka 2720a80
Address Bugbot: don't shadow root CODEOWNERS; wire the guard into `ma…
LukasWodka 0a9371f
Address Bugbot (cont.): root CODEOWNERS style rules + make ci check-s…
LukasWodka 4371c61
Address Bugbot (parity): guard fails closed, anchored comment filter,…
LukasWodka 9926eae
Address Bugbot (parity): make fail-closed actually reachable (parent-…
LukasWodka eb15958
check-style: surface grep errors instead of suppressing (still fail-c…
LukasWodka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| ## Summary | ||
| <!-- 1–3 sentences. What does this PR do and why? --> | ||
| ## Related | ||
| <!-- Closes #123 / Ref tracebloc/other-repo#456 --> | ||
| ## Type of change | ||
| - [ ] Feature | ||
| - [ ] Bug fix | ||
| - [ ] Tech-debt / refactor | ||
| - [ ] Docs | ||
| - [ ] Security / hardening | ||
| ## Test plan | ||
| <!-- Commands run, manual steps. --> | ||
| ## Checklist | ||
| - [ ] Tests added / updated and passing locally | ||
| - [ ] `go build ./...`, `go vet`, and the Lint job's checks pass locally | ||
| - [ ] Terminal output follows [STYLE.md](../STYLE.md) — Printer tones (no hardcoded colour/emoji), "secure environment" not "workspace"; `bash scripts/check-style.sh` passes | ||
| - [ ] No secrets / credentials in the diff |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # Terminal output style | ||
| The `tracebloc` CLI and the installer share **one** terminal style system. This | ||
| is the reference; `scripts/check-style.sh` enforces the mechanical parts in CI. | ||
| ## The idea | ||
| From the tracebloc.io homepage gradient — **cyan orients, lime moves**: | ||
| - **cyan** `#01a5cc` = *structure* — headings, step titles, links, "where you are" | ||
| - **lime** `#91e947` = *action* — commands, the primary CTA, "what to do next" | ||
| Everything else stays quiet (dim neutral). Colour is never load-bearing: headings | ||
| and commands also carry **bold**, and alerts carry a distinct **glyph**, so the | ||
| output still reads under `NO_COLOR`, in a pipe, or for a colour-blind reader. | ||
| ## Roles → tones | ||
| All colour goes through the `Printer` in `internal/ui` — never inline an escape | ||
| or hex elsewhere. The tone table (`internal/ui/ui.go`) maps each role: | ||
| | Role | Printer method / tone | Colour | Weight / glyph | | ||
| |------|-----------------------|--------|----------------| | ||
| | Heading / section / step | `Section`, `Step`, `Banner` (`toneHeading`) | cyan `#01a5cc` | bold | | ||
| | Command (to run) | `Command`, `MenuRow` cmd (`toneCommand`) | lime `#91e947` | bold | | ||
| | Description / supporting | `MenuRow` desc (`toneDesc`) | soft lime `#a7ed6c` | — | | ||
| | Link / URL | `toneLink` | cyan `#01a5cc` | underline | | ||
| | Success ✔ / online ● | `Successf`, `CheckLine` (`toneGo`) | lime `#91e947` | glyph | | ||
| | Warning ⚠ | `Warnf`, `WarnLine` (`toneWarn`) | amber `#ffc62b` | glyph | | ||
| | Error ✖ | `Errorf` (`toneErr`) | red `#f64c4c` | bold glyph | | ||
| | Label : value | `Field`, `Stat` (`toneLabel`) | dim neutral | — | | ||
| **No emoji.** The lime `●` is the online indicator (not 🟢). | ||
| The engine renders exact 24-bit hex on truecolor terminals, the **deep shade** | ||
| (`#01637a` / `#578c2b`) on light backgrounds, the nearest ANSI-16 otherwise, and | ||
| nothing when colour is off (`NO_COLOR` / non-TTY / `TERM=dumb` / `--plain`). The | ||
| exact brand SGR is pinned by `internal/ui/brand_tones_test.go`, so a drift in the | ||
| tone table fails CI. The installer mirrors this in `scripts/lib/common.sh`. | ||
| ## Terminology | ||
| Source of truth: the docs repo `TERMINOLOGY.md`. In user-facing output: | ||
| | Use | Not | | ||
| |-----|-----| | ||
| | secure environment | workspace, hub, client (as a noun for the environment) | | ||
| | ingest | upload, import | | ||
| | delete | remove, uninstall (for offboarding) | | ||
| | Online / Offline | connected / disconnected, up / down | | ||
| | collaborators | users, members | | ||
| | task | job, experiment type | | ||
| `client` stays valid as the CLI verb (`tracebloc client create`) and in code | ||
| identifiers (`exitNoWorkspace`, etc.) — the guard matches `workspace` as a whole | ||
| word in output text only. | ||
| ## What's enforced vs reviewed | ||
| `scripts/check-style.sh` (CI Lint job, blocking) catches the **mechanical** | ||
| violations: hardcoded brand colour outside `internal/ui`, status emoji, and | ||
| `workspace` in user-facing text. Run it locally with `make check-style` (also part | ||
| of `make ci`) or directly: `bash scripts/check-style.sh`. | ||
| It can't police **judgement** — using the right *role* for a token (a command in | ||
| the command tone, not the heading tone), or the softer terminology calls. Those | ||
| stay with review; `STYLE.md` and `scripts/check-style.sh` are CODEOWNER-gated so | ||
| the rules can't be quietly weakened. | ||
| To intentionally exempt a line, append `// style-guard: allow` with a reason. |
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
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
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
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
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
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
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
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.