feat(output): modernize terminal output with a badges + rules design#227
Merged
Conversation
Introduce a centralized presentation layer (src/printing/theme.rs) and restyle every human-readable command output to a cohesive "badges + rules" look: section headers with an accent bar + horizontal rule, dim-label / accent-value key-value rows, colored severity badges for scan & jwks, and a unified braille spinner + block-fill progress bar. - theme: section/subsection headers, kv rows, status badges (badge / badge_width), spinner / progress_bar helpers, shared glyph constants. - Logger & banner refreshed: dropped the "[..] [..]" bracket noise for a dim time + glyph line; compact dot-separated identity line in the banner. - utils log_* and spinner helpers now delegate to the theme. - Fix a latent alignment bug: width padding was applied to already-colored strings (the count includes ANSI escape bytes, so columns drift under a real TTY); helpers now pad the plain text and then apply color. Contracts preserved (verified): - --json output is byte-identical (the machine-readable path is untouched). - Severity::as_str() / its Serialize impl and the HTML report are unchanged. - stdout data lines (tokens, payloads, JSON, PEM) stay structurally intact and pipe-safe. - Color stays TTY / NO_COLOR gated via the `colored` crate.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
Modernizes jwt-hack's terminal output with a cohesive "badges + rules" design, without changing the stdout data/
--jsoncontract. All human-readable framing now flows through a single presentation layer.What changed
src/printing/theme.rs: section headers (▎ DECODE ────), sub-sections (▎ Header), dim-label/accent-value key-value rows, colored severity badges (● PASS/▲ CRIT/◆ MED/■ LOW, and✓ VALID/✗ INVALIDfor jwks), a unified braille spinner and a block-fill progress bar (█▓░).printing/mod.rs): dropped the[..] [..]bracket noise for a cleandim-time glyph message; compact dot-separated banner identity line.decode,encode,version,payload,scan,jwks,crack.utilslog_*+ spinner helpers delegate to the theme.{:<14}) was applied to already-colored strings, so columns drift under a real TTY (the pad counts ANSI escape bytes). Helpers now pad the plain text then color.Before → After (decode)
Contracts preserved (verified)
--jsonoutput byte-identical tomain(machine path untouched; diffs only in pre-existing HashMap key-order + timing fields).Severity::as_str()/ itsSerializeimpl and the HTML report unchanged — badges use a separate display method.encode | tail -1,payload | grep eyJ,decode | grep '"alg"').colored; badges remain glyph-distinguishable in monochrome (e.g. the shell TUI capture).Verification
cargo fmt --check,cargo clippy --all-targets,cargo build— all clean, zero warnings.cargo test— 434 passed / 0 failed (incl. newthemeunit tests; verified race-free across repeated runs).🤖 Generated with Claude Code