Skip to content

feat: Hackbox banner and brand-aligned CLI styling#78

Merged
Miyamura80 merged 3 commits intomasterfrom
feat/hackbox-brand-styling
Mar 29, 2026
Merged

feat: Hackbox banner and brand-aligned CLI styling#78
Miyamura80 merged 3 commits intomasterfrom
feat/hackbox-brand-styling

Conversation

@Miyamura80
Copy link
Copy Markdown
Contributor

@Miyamura80 Miyamura80 commented Mar 29, 2026

Summary

  • Wraps the ASCII art banner in the edison.watch Hackbox visual system (solid β–ˆ border with 40% tag anchored top-left, half-height β–„β–€ top/bottom bars)
  • Applies brand colors to all clap help output: cyan+bold+underline section headers, cyan subcommands/flags, dimmed placeholders
  • Styles after_help sections (WORKFLOWS, EXAMPLES, PREREQUISITES, DEPRECATED) with colored headers, cyan β–Έ step markers, and dimmed # comments
  • Adds dashed cyan separator between banner and help text
  • Version tagline split into bold white (name/version) and graphene grey (subtitle)
  • All ANSI codes auto-stripped when output is piped (non-TTY safe)

Test plan

  • cargo test β€” 494 passed, 0 failed
  • cargo run -- (bare command) β€” Hackbox renders with aligned borders
  • cargo run -- run --help β€” subcommand help styled correctly
  • Piped output (cargo run -- 2>&1 | head) β€” no ANSI codes, clean plaintext
  • Visual check in terminal for color rendering

πŸ€– Generated with Claude Code


Open with Devin

Miyamura80 and others added 2 commits March 29, 2026 16:32
Wrap the ASCII art banner in the edison.watch Hackbox visual system
(solid β–ˆ border with 40% tag, half-height β–„β–€ top/bottom bars) and
apply brand colors throughout the help output.

- Section headers (Usage, Commands, Options, etc.): cyan + bold + underline
- Subcommands and flags: cyan
- Placeholders: dimmed
- after_help sections (WORKFLOWS, EXAMPLES, etc.): styled headers + dim comments
- Workflow steps prefixed with cyan β–Έ markers
- Dashed separator between banner and help text
- Version tagline: bold white + graphene grey
- All ANSI codes auto-stripped when piped (non-TTY safe)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 29, 2026

Greptile Summary

This PR introduces a "Hackbox" visual system for the CLI banner β€” a dynamically-sized solid β–ˆ border box with half-height top/bottom bars and a 40% tag anchored top-left β€” and applies brand-aligned styling throughout all clap help output (cyan+bold+underline headers, cyan subcommands/flags, dimmed placeholders, and colored after_help sections). All ANSI codes are TTY-guarded in main.rs (explicit is_tty check) and handled by clap's anstream integration for after_help strings in cli.rs, making piped output clean.

Key changes:

  • src/main.rs: New Hackbox print_banner with dynamic width calculation, 24-bit true-color ANSI constants, and a static dashed cyan separator injected between banner and help
  • src/cli.rs: Compile-time BRAND_STYLES const; all after_help strings converted to concat!() macros with embedded ANSI escape sequences for section headers, step markers (β–Έ), and dimmed comments

Issues found (all P2 / cosmetic):

  • The banner uses 24-bit true-color cyan (#C3FFFD) while BRAND_STYLES and after_help headers use 8-bit ANSI cyan (\\x1b[36m / AnsiColor::Cyan) β€” these render as visually distinct shades in true-color terminals
  • The dashed separator is a hardcoded 43-character literal while the banner box width is dynamic (~72 chars for typical versions), leaving it visually misaligned below the box
  • The tagline trailing-space calculation yields one extra space compared to the widest logo line, so the tagline text is not flush-right with the logo content

Confidence Score: 5/5

Safe to merge β€” all findings are cosmetic/P2 with no functional, correctness, or security impact

All three issues are purely visual: a color shade mismatch between banner and help text, a fixed-width separator that is shorter than the banner, and a one-space trailing-pad asymmetry in the tagline. None affect runtime behavior, data correctness, or the ANSI-stripping guarantee for piped output. The Hackbox layout math is self-consistent and TTY guards are correctly placed throughout.

No files require special attention β€” the three cosmetic issues are minor and can be addressed in follow-up polish commits

Important Files Changed

Filename Overview
src/main.rs Adds print_banner Hackbox rendering: dynamic-width solid β–ˆ border, TTY-guarded ANSI true-color, half-height top/bottom bars, and a static cyan separator. Minor cosmetic issues: banner uses 24-bit true-color cyan while help text uses 8-bit ANSI cyan, separator width is hardcoded, and the tagline trailing-space calculation is off-by-one vs. the logo lines.
src/cli.rs Adds compile-time BRAND_STYLES const using AnsiColor::Cyan and converts all after_help strings to concat!() macros with embedded ANSI escape sequences for colored headers (\x1b[1;4;36m), cyan β–Έ step markers, and dimmed # comments. ANSI stripping on non-TTY is handled by clap's anstream integration.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[main: no subcommand] --> B[print_banner]
    B --> C{is_tty?}
    C -- No --> D[Print plain logo lines\nPlain tagline\nReturn]
    C -- Yes --> E[Compute box_width\ninner = max logo/tagline + 2\ntag_width = 40% box_width]
    E --> F[Print top bar in CYAN]
    F --> G[Print tag row with right border]
    G --> H[Print blank row]
    H --> I[Print each LOGO_LINE\nwith left border + padding]
    I --> J[Print tagline\nWHITE_BOLD name + GREY subtitle]
    J --> K[Print bottom bar in CYAN]
    K --> L{is_tty?}
    L -- Yes --> M[Print dashed cyan separator]
    L -- No --> N[Skip separator]
    M --> O[cmd.print_help via clap anstream\nANSI stripped if non-TTY]
    N --> O
    O --> P[BRAND_STYLES applied\nAnsiColor::Cyan headers + literals]
    P --> Q[after_help rendered\nraw ANSI stripped by anstream on non-TTY]
Loading

Reviews (1): Last reviewed commit: "fix: rustfmt and clippy warnings" | Re-trigger Greptile

greptile-apps[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

βœ… Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

- Unify colors: replace ANSI cyan (\x1b[36m) with true-color #C3FFFD
  (\x1b[38;2;195;255;253m) in both clap Styles and after_help sections
  to match the banner constants
- Make separator width dynamic based on banner box_width
- Fix tagline padding to use same ` ` prefix pattern as logo lines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Miyamura80 Miyamura80 merged commit 3cf87eb into master Mar 29, 2026
4 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