fix: apply --no-color flag to huh interactive prompts#454
fix: apply --no-color flag to huh interactive prompts#454
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
@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
| t.Focused.FocusedButton = lipgloss.NewStyle().Padding(0, 2).MarginRight(1) | ||
| t.Focused.BlurredButton = lipgloss.NewStyle().Padding(0, 2).MarginRight(1) |
|
👾 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?
🔗 https://github.com/charmbracelet/huh?tab=readme-ov-file#themes |


Changelog
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-colorand verify prompts render as plain numbered lists with no colorRun
slack login --no-colorand verify confirmation prompt has no colorRun
slack create(without --no-color) and verify themed prompts still workgo test ./internal/style/ ./internal/iostreams/Requirements