feat: add catppuccin theme support#59
Conversation
textfuel
left a comment
There was a problem hiding this comment.
Thanks for the PR! Huge refactor on the color system - really appreciate that. I have left a few comments to discuss
There was a problem hiding this comment.
There is a duplicated palette in authorcolor.go. Could we pick one source of truth between it and your theme.go? I would prefer keeping yours and dropping authorcolor.go
| func SetTheme(name string) error { | ||
| switch name { | ||
| case "", "default": | ||
| Default = defaultTheme() | ||
| case "catppuccin-latte": | ||
| Default = catppuccinLatte() | ||
| case "catppuccin-frappe": | ||
| Default = catppuccinFrappe() | ||
| case "catppuccin-macchiato": | ||
| Default = catppuccinMacchiato() | ||
| case "catppuccin-mocha": | ||
| Default = catppuccinMocha() | ||
| default: | ||
| return fmt.Errorf("unknown theme: %q", name) | ||
| } |
There was a problem hiding this comment.
Consider using https://github.com/catppuccin/go so we'd have all the Catppuccin flavors and no hardcoded colors.
Bonus: the lib also exposes contrast helpers, which solves the Latte readability issue (white-on-light-gray on selected items)
Not blocking
| ) | ||
| // These are functions so they pick up the active theme's colors. | ||
| func jqlFieldStyle() lipgloss.Style { return lipgloss.NewStyle().Foreground(theme.ColorBlue) } | ||
| func jqlKeywordStyle() lipgloss.Style { return lipgloss.NewStyle().Foreground(lipgloss.Color("5")) } |
There was a problem hiding this comment.
Looks like a few colors are missing from the palette.
Migrating to the catppuccin/go lib would cover this automatically.
Was there a reason for skipping them, or just oversight?
There was a problem hiding this comment.
A few package-level styles are evaluated at init time, before SetTheme runs, so they capture the default ANSI colors and never pick up the active theme:
- pkg/tui/components/createform.go:1098 — noneStyle
- pkg/tui/views/infofields.go:255 — noneStyle
- pkg/tui/views/detail.go:663 — urlStyle
Same root cause as the var to func conversion you already did in jqlhighlight.go. Could we apply the same fix here?
func noneStyle() lipgloss.Style {
return lipgloss.NewStyle().Foreground(theme.ColorGray)
}|
Thanks for feedback! |
|
Addressed comments. |
these needed to be re-generated every time go.mod changed i'll add it into Contributing.md
textfuel
left a comment
There was a problem hiding this comment.
Looks awesome! One last minor comment and I'll release this!
Co-authored-by: textfuel <81143241+textfuel@users.noreply.github.com>
|
Applied suggestion. |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [textfuel/lazyjira](https://github.com/textfuel/lazyjira) | minor | `v2.9.0` → `v2.13.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>textfuel/lazyjira (textfuel/lazyjira)</summary> ### [`v2.13.0`](https://github.com/textfuel/lazyjira/releases/tag/v2.13.0) [Compare Source](textfuel/lazyjira@v2.12.0...v2.13.0) #### Changelog - [`16a6dd6`](textfuel/lazyjira@16a6dd6) Merge branch 'hotfixes-of-demo-check' - [`11ba667`](textfuel/lazyjira@11ba667) Reach parents and children from the task list ([#​68](textfuel/lazyjira#68)) - [`26afc79`](textfuel/lazyjira@26afc79) Show parent-link children in Sub tab on Cloud ([#​66](textfuel/lazyjira#66)) - [`d5f63df`](textfuel/lazyjira@d5f63df) changelog - [`34ab861`](textfuel/lazyjira@34ab861) changelog - [`5dbd650`](textfuel/lazyjira@5dbd650) codowners adjustments - [`6aa089d`](textfuel/lazyjira@6aa089d) fixes - [`d22816b`](textfuel/lazyjira@d22816b) release v2.13.0 *** **Full changelog:** [CHANGELOG.md](https://github.com/textfuel/lazyjira/blob/main/CHANGELOG.md) ### [`v2.12.0`](https://github.com/textfuel/lazyjira/releases/tag/v2.12.0) [Compare Source](textfuel/lazyjira@v2.11.1...v2.12.0) #### Changelog - [`6af4d03`](textfuel/lazyjira@6af4d03) Feat/task status icons ([#​64](textfuel/lazyjira#64)) - [`a19773b`](textfuel/lazyjira@a19773b) changelog - [`4ca1ee7`](textfuel/lazyjira@4ca1ee7) release v2.12.0 - [`c476e2b`](textfuel/lazyjira@c476e2b) sprint fields ([#​48](textfuel/lazyjira#48)) *** **Full changelog:** [CHANGELOG.md](https://github.com/textfuel/lazyjira/blob/main/CHANGELOG.md) ### [`v2.11.1`](https://github.com/textfuel/lazyjira/releases/tag/v2.11.1) [Compare Source](textfuel/lazyjira@v2.11.0...v2.11.1) #### Changelog - [`29ca5ae`](textfuel/lazyjira@29ca5ae) Route to tracking only on exact remote match ([#​62](textfuel/lazyjira#62)) - [`5516244`](textfuel/lazyjira@5516244) release v2.11.1 *** **Full changelog:** [CHANGELOG.md](https://github.com/textfuel/lazyjira/blob/main/CHANGELOG.md) ### [`v2.11.0`](https://github.com/textfuel/lazyjira/releases/tag/v2.11.0) [Compare Source](textfuel/lazyjira@v2.10.2...v2.11.0) #### Changelog - [`382fe06`](textfuel/lazyjira@382fe06) changelog - [`23b6d49`](textfuel/lazyjira@23b6d49) feat: add catppuccin theme support ([#​59](textfuel/lazyjira#59)) - [`ced4b10`](textfuel/lazyjira@ced4b10) readme v2 path - [`9d434fc`](textfuel/lazyjira@9d434fc) release v2.11.0 - [`e570d8b`](textfuel/lazyjira@e570d8b) some dev QOL ([#​60](textfuel/lazyjira#60)) *** **Full changelog:** [CHANGELOG.md](https://github.com/textfuel/lazyjira/blob/main/CHANGELOG.md) ### [`v2.10.2`](https://github.com/textfuel/lazyjira/releases/tag/v2.10.2) [Compare Source](textfuel/lazyjira@v2.10.1...v2.10.2) #### Changelog - [`94fafd7`](textfuel/lazyjira@94fafd7) fix of v2 version naming ([#​57](textfuel/lazyjira#57)) - [`86f48fe`](textfuel/lazyjira@86f48fe) release v2.10.2 *** **Full changelog:** [CHANGELOG.md](https://github.com/textfuel/lazyjira/blob/main/CHANGELOG.md) ### [`v2.10.1`](https://github.com/textfuel/lazyjira/releases/tag/v2.10.1) [Compare Source](textfuel/lazyjira@v2.10.0...v2.10.1) #### Changelog - [`fe34157`](textfuel/lazyjira@fe34157) changelog - [`5728a57`](textfuel/lazyjira@5728a57) pkg/config: accept string shorthand for the projects list ([#​53](textfuel/lazyjira#53)) - [`cce7280`](textfuel/lazyjira@cce7280) release v2.10.1 *** **Full changelog:** [CHANGELOG.md](https://github.com/textfuel/lazyjira/blob/main/CHANGELOG.md) ### [`v2.10.0`](https://github.com/textfuel/lazyjira/releases/tag/v2.10.0) [Compare Source](textfuel/lazyjira@v2.9.0...v2.10.0) #### Changelog - [`45afec5`](textfuel/lazyjira@45afec5) Add configurable custom commands ([#​42](textfuel/lazyjira#42)) - [`851bfa1`](textfuel/lazyjira@851bfa1) Context-sensitive preview for Sub/Lnk tabs ([#​55](textfuel/lazyjira#55)) - [`f546bc7`](textfuel/lazyjira@f546bc7) Make maxResults configurable globally and per tab ([#​45](textfuel/lazyjira#45)) - [`672fb6d`](textfuel/lazyjira@672fb6d) changelog - [`67bdf1a`](textfuel/lazyjira@67bdf1a) changelog - [`d14fb0e`](textfuel/lazyjira@d14fb0e) perl for make release - [`b04c7a8`](textfuel/lazyjira@b04c7a8) release v2.10.0 *** **Full changelog:** [CHANGELOG.md](https://github.com/textfuel/lazyjira/blob/main/CHANGELOG.md) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNjguNSIsInVwZGF0ZWRJblZlciI6IjQzLjE2OC41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
What
Add catppuccin (https://github.com/catppuccin) themes support.
Why
I'd like to have themes support so I can use my favourite theme.
How to test
Set gui.theme to one of supported catppuccin themes or
default.Closes #58