Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move help styles to theme #44

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

jolheiser
Copy link
Contributor

This should set the help style to whatever is set as the Focused.Help style.
It may make more sense to have a dedicated help style, but the other themes seem to follow a pattern of Focused being primary and Blurred copying and modifying.

@meowgorithm
Copy link
Member

@jolheiser Good catch, and you’re totally right about the dedicated help style. We’ll make that change accordingly.

@maaslalani
Copy link
Contributor

Hey @jolheiser, thank you for the PR!

For a more correct solution we will put the Help styles on the theme itself instead of embedding within the Focused/Blurred of a field. Since the theme help applies to the group/form not a field.

// Currently
theme.Focused.Help.ShortKey = lipgloss.NewStyle() //...

// Suggested
theme.Help.ShortKey = lipgloss.NewStyle() //...

@jolheiser
Copy link
Contributor Author

jolheiser commented Dec 12, 2023

I think that sounds great and agree it would be much cleaner. I can close this one and let you hammer it out, unless you would like me to amend this PR. 🙂

Signed-off-by: jolheiser <john.olheiser@gmail.com>
@jolheiser
Copy link
Contributor Author

I believe this should be correct now. Another potential for cleanup would be to use the theme help styles directly (rather than setting group.help.Styles, but then you'd need to recreate what help.Model.ShortHelpView is already doing, so this is probably simpler for now.

@jolheiser jolheiser changed the title fix: set help style fix: move help styles to theme Dec 12, 2023
Copy link
Contributor

@maaslalani maaslalani left a comment

Choose a reason for hiding this comment

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

Nice @jolheiser, this is absolutely perfect! Thank you so much!

@maaslalani maaslalani merged commit 4ac8640 into charmbracelet:main Dec 12, 2023
8 checks passed
@jolheiser jolheiser deleted the help-theme branch December 12, 2023 16:23
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.

3 participants