Skip to content

DCP-2216 feat: add comprehensive color support and UI enhancements#259

Open
ajmalkhan-eng wants to merge 1 commit intomainfrom
DCP-2216-prolific-cli-ui-helpers-and-color-support
Open

DCP-2216 feat: add comprehensive color support and UI enhancements#259
ajmalkhan-eng wants to merge 1 commit intomainfrom
DCP-2216-prolific-cli-ui-helpers-and-color-support

Conversation

@ajmalkhan-eng
Copy link
Contributor

@ajmalkhan-eng ajmalkhan-eng commented Dec 7, 2025

Summary

This PR adds rich terminal colour support and UI helper functions to improve the CLI user experience with consistent, vibrant output.

Changes

Color Support

  • Add colour constants: Green, Red, Yellow, Cyan, ProlificBlue
  • Add Unicode symbols (✓, ✗, !, •) with ASCII fallbacks ([ok], [error], etc.)
  • Implement TTY detection and NO_COLOUR environment variable support
  • Add coloUr profile detection (TrueColour/256/16/ASCII)

UI Helper Functions

  • Success(), Error(), ErrorWithHint(), Warn(), Info() - Styled message formatting
  • Dim(), Bold(), Highlight() - Text styling utilities
  • Write*() functions for direct stderr/stdout output
  • RenderBanner() - Display ASCII art banners in Prolific blue

Enhanced Root Command

  • Integrate colour profile initialisation into root command

Technical Details

  • Uses lipgloss for terminal styling
  • Automatic terminal capability detection
  • Respects NO_COLOUR environment variable
  • Graceful fallback to ASCII for non-TTY environments

Testing

All existing tests pass with the new UI functions in place.

Add rich terminal color support with automatic detection:
- Add color constants (Green, Red, Yellow, Cyan, ProlificBlue)
- Add Unicode and ASCII symbol support for cross-platform compatibility
- Implement TTY detection and NO_COLOR environment variable support
- Add helper functions: Success(), Error(), Warn(), Info(), Dim(), Bold(), Highlight()
- Add Write* functions for direct stderr/stdout output
- Implement shouldUseColor() for conditional formatting
- Initialize color profile detection (TrueColor/256/16/ASCII)
- Add RenderBanner() function for displaying ASCII art banners
@ajmalkhan-eng ajmalkhan-eng requested a review from a team as a code owner December 7, 2025 22:53
@prolific-snyk
Copy link

prolific-snyk commented Dec 7, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ajmalkhan-eng ajmalkhan-eng changed the title feat: add comprehensive color support and UI enhancements DCP-2216 feat: add comprehensive color support and UI enhancements Dec 7, 2025
const ApplicationName = "prolific"

// BannerFilePath is the path to the ASCII art banner file
const BannerFilePath = "banner.txt"
Copy link
Contributor

Choose a reason for hiding this comment

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

question: What does this get us? We would have to ship another file for it to render

Copy link
Contributor Author

@ajmalkhan-eng ajmalkhan-eng Jan 6, 2026

Choose a reason for hiding this comment

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

Sorry I just see this.. I hate gh notifications..

I'll be honest.. it breaks the ascii 🥹 .. I can embed it in to binary on build? or yeet.

it's soo last year anyway 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants