Skip to content

fix: apply --no-color flag to huh interactive prompts#454

Open
srtaalej wants to merge 2 commits intomainfrom
ale-no-color
Open

fix: apply --no-color flag to huh interactive prompts#454
srtaalej wants to merge 2 commits intomainfrom
ale-no-color

Conversation

@srtaalej
Copy link
Copy Markdown
Contributor

@srtaalej srtaalej commented Mar 31, 2026

Changelog

N/A - Fixes for unreleased changes.

Summary

The --no-color flag stripped styles from CLI output but not from huh interactive prompts (select, confirm, input, etc.), because huh uses its own theme/rendering pipeline. This PR added ThemePlain() — a colorless huh theme with no ANSI styling so that when --no-color is set, forms now use ThemePlain + huh's accessible mode, rendering as plain numbered lists instead of a styled TUI

Test plan

Run slack create --no-color and verify prompts render as plain numbered lists with no color
Run slack login --no-color and verify confirmation prompt has no color
Run slack create (without --no-color) and verify themed prompts still work
go test ./internal/style/ ./internal/iostreams/

Requirements

@srtaalej srtaalej requested a review from a team as a code owner March 31, 2026 19:26
@srtaalej srtaalej self-assigned this Mar 31, 2026
@srtaalej srtaalej added semver:minor Use on pull requests to describe the release version increment enhancement M-T: A feature request for new functionality labels Mar 31, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.42%. Comparing base (15e0c40) to head (1327317).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #454      +/-   ##
==========================================
- Coverage   70.42%   70.42%   -0.01%     
==========================================
  Files         221      221              
  Lines       18539    18568      +29     
==========================================
+ Hits        13057    13076      +19     
- Misses       4307     4314       +7     
- Partials     1175     1178       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zimeg zimeg added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch Use on pull requests to describe the release version increment and removed enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment labels Mar 31, 2026
@zimeg zimeg added this to the Next Release milestone Mar 31, 2026
Copy link
Copy Markdown
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@srtaalej Super nice approach to bringing a more... "boring?" theme to forms 🎨 ✨

I'm leaving an issue we might find quick to address around confirm defaults before merging. I'm also curious if the hints below the prompts can have formatting removed or if that's internal upstream?

←/→ toggle • enter submit • y Yes • n No

Comment on lines +144 to +145
t.Focused.FocusedButton = lipgloss.NewStyle().Padding(0, 2).MarginRight(1)
t.Focused.BlurredButton = lipgloss.NewStyle().Padding(0, 2).MarginRight(1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

📸 issue: I'm not sure if these are the correct options but I find the confirm default isn't highlighted now. I'll include a screenshot for other reviewers:

Image

@zimeg
Copy link
Copy Markdown
Member

zimeg commented Apr 1, 2026

👾 ramble: I'm now uncertain if the comment about "hint" formatting is too nuanced but I do find that the Charm team offers a "default" theme that might be useful to use here for confidence in edge cases?

image

🔗 https://github.com/charmbracelet/huh?tab=readme-ov-file#themes

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

Labels

bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants