Skip to content

feat(ui): add DiagnosticBadge component for terminal output - #417

Merged
codeZe-us merged 1 commit into
Toolbox-Lab:mainfrom
GauravKarakoti:CLI
Aug 24, 2026
Merged

feat(ui): add DiagnosticBadge component for terminal output#417
codeZe-us merged 1 commit into
Toolbox-Lab:mainfrom
GauravKarakoti:CLI

Conversation

@GauravKarakoti

Copy link
Copy Markdown
Contributor

📝 Description

This PR introduces the DiagnosticBadge component to improve the visual scannability of terminal output. It maps diagnostic metadata (categories/severities) to specific Unicode symbols and provides immediate visual cues using ANSI coloring. Safe ASCII fallbacks are also implemented to ensure compatibility with legacy terminal environments that do not support complex emojis or ligatures.

🔗 Related Issues

Resolves: #409

🛠️ Changes Made

  • Added DiagnosticCategory enum: Maps Success, Info, Warning, and Error severities to distinct Unicode icons (✔, ℹ, ⚠, ✖) and ASCII fallbacks.
  • Added DiagnosticBadge struct: Acts as the formatting UI component to gracefully prepend colored badges to terminal messages.
  • Fallback handling: Built-in environment toggle (supports_unicode) guarantees terminal safety.

📂 File Changes

Note: The issue requested apps/cli/src/ui/badges.rs, but standardizing with your workspace, this is intended for the CLI UI module in crates/cli/src/ui/badges.rs.

✅ Checklist

  • I have read the CONTRIBUTING.md file.
  • My code follows the code style of this project.
  • I have implemented fallback mechanisms for non-Unicode environments.
  • ANSI color codes are correctly terminated so formatting does not bleed into user logs.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ee5015db-db9b-422b-af9d-4a47ab99594c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeZe-us
codeZe-us self-requested a review August 24, 2026 15:51
@codeZe-us

Copy link
Copy Markdown
Contributor

PR reviewed

@codeZe-us
codeZe-us merged commit c627b66 into Toolbox-Lab:main Aug 24, 2026
3 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.

Implement DiagnosticBadge Icons in Terminal

2 participants