Skip to content

feat(output): zero-dependency adaptive ascii logos and color fallbacks - #4

Merged
kk376 merged 4 commits into
mainfrom
feat/adaptive-ascii-logos
Nov 7, 2026
Merged

kk376 merged 4 commits into
mainfrom
feat/adaptive-ascii-logos

Conversation

@kk376

@kk376 kk376 commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

Implements zero-dependency, zero-glitch adaptive ASCII logos and ANSI color capability fallbacks across all supported platforms.

Key Changes

  • Responsive Constraint Solver (src/output/formatter.rs):
    • Dynamically evaluates terminal column geometry against logo and module text dimensions.
    • Automatically selects Side-by-Side (Full) -> Side-by-Side (Compact) -> Stacked (Full) -> Stacked (Compact) -> Info-Only.
    • Prevents line-wrapping glitches and terminal distortion across narrow or constrained windows (e.g., 80x24 standard VT100/POSIX terminals).
  • Handcrafted Compact ASCII Variants (src/output/logo.rs):
    • Added handcrafted compact ASCII art variants across all 40 logos in ALL_LOGOS.
  • Zero-Allocation 3-Tier Color Fallback Engine (src/output/color.rs):
    • Mathematically maps 256-color palette codes and 6x6x6 color cubes to the nearest standard 16-color ANSI code using minimum Euclidean distance in sRGB space.
    • Resolves colors statically without runtime heap allocations.
    • Prevents raw escape code leakage on Linux TTY virtual consoles (TERM=linux, serial consoles, and dumb terminals).
  • Robust Terminal Probing Cascade (src/context.rs):
    • Evaluates $COLUMNS override, standard streams ioctl (stdout -> stderr -> stdin), and direct /dev/tty descriptor.
    • Clamps terminal width to (20, 1000).
  • CLI & Config Integration (src/cli.rs, src/config.rs):
    • Added --logo-variant <auto|full|compact> and --compact-logo (alias: --compact).
    • Added logo_variant configuration option in config.toml.
    • Updated Bash, Zsh, and Fish shell completions.

Verification

  • cargo fmt --all -- --check passed cleanly.
  • cargo clippy --all-targets -- -D warnings passed with 0 warnings.
  • cargo test --all-targets passed (285 total tests: 221 unit tests, 23 CLI tests, 40 parser tests, 1 completion test).

kk376 added 2 commits November 7, 2026 03:52
- Add responsive layout constraint solver in formatter: dynamically selects
  Side-by-Side (Full/Compact), Stacked (Full/Compact), or Info-Only based on
  column width and content constraints without terminal line-wrapping glitches.
- Introduce handcrafted compact ASCII art variants across all 40 distribution
  logos in logo registry with backwards-compatible rendering.
- Implement zero-heap 3-tier ANSI color degradation engine mapping
  TrueColor -> 256-color -> Basic 16-color (via Euclidean sRGB distance) -> None,
  preventing escape code leakage on Linux virtual consoles and serial consoles.
- Upgrade terminal column probing cascade to evaluate $COLUMNS override,
  standard streams ioctl (stdout/stderr/stdin), and /dev/tty descriptor.
- Support --logo-variant <auto|full|compact>, --compact-logo, and config.toml
  logo_variant property across CLI, configuration, and Bash/Zsh/Fish completions.
- Expand test coverage across color degradation, variant layouts, CLI flags,
  and completions (285 total tests passing).
@kk376
kk376 force-pushed the feat/adaptive-ascii-logos branch 2 times, most recently from a4b2320 to 99a2e17 Compare November 6, 2026 23:50
@kk376
kk376 force-pushed the feat/adaptive-ascii-logos branch from 99a2e17 to 22d0543 Compare November 7, 2026 00:14
@kk376
kk376 merged commit a77c5bf into main Nov 7, 2026
7 checks passed
@kk376
kk376 deleted the feat/adaptive-ascii-logos branch November 7, 2026 00:33
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