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

Make theme customizable #193

Closed
LucasPickering opened this issue May 1, 2024 · 0 comments · Fixed by #206
Closed

Make theme customizable #193

LucasPickering opened this issue May 1, 2024 · 0 comments · Fixed by #206
Assignees
Labels
feature New behavior to enable things that were previously not possible good first issue Good for newcomers

Comments

@LucasPickering
Copy link
Owner

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

It'd be nice to customize the color of the TUI.

Describe the solution you'd like
A clear and concise description of what you want to happen

Configurable theme section of config.yml. To start with, it'll just have two fields:

theme:
  primary_color: yellow
  error_color: #0000ff

ratatui::Color deserializes from both HTML hex strings and color names automatically, so we don't even need to implement that.

We may also want to add a field secondary_color, which would be used for things like the template color. Could also punt that to the future though.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered

We could make the entire style book customizable (Style does implement Deserialize!), but I think that would be way too complex and also opens us up to maintaining the entire set of styles as part of the external API. Making a few core settings customizable, then deriving styles from that, I think is a much better solution.

Additional context
Add any other context or screenshots about the feature request here

If anyone wants to pick this up, the work involved is:

  • Split Theme into two structs (theme.rs):
    • A small simple one that defines what's configurable in the config, which I would have keep the name Theme
    • A complex one with all the individual styles, which I would call Styles. This would be derived from the theme, and stored in TuiContext
  • Add a new field theme: Theme to the config (config.rs)
  • Document theme field in the config docs
@LucasPickering LucasPickering added good first issue Good for newcomers feature New behavior to enable things that were previously not possible labels May 1, 2024
@LucasPickering LucasPickering self-assigned this May 4, 2024
LucasPickering added a commit that referenced this issue May 4, 2024
Primary, secondary, and error colors can be customized. More things to be added in the future (e.g. pane sizing). Also, change default color schema to blue+yellow.

Closes #193
LucasPickering added a commit that referenced this issue May 5, 2024
Primary, secondary, and error colors can be customized. More things to be added in the future (e.g. pane sizing). Also, change default color schema to blue+yellow.

Closes #193
LucasPickering added a commit that referenced this issue May 5, 2024
Primary, secondary, and error colors can be customized. More things to be added in the future (e.g. pane sizing). Also, change default color schema to blue+yellow.

Closes #193
LucasPickering added a commit that referenced this issue May 5, 2024
Primary, secondary, and error colors can be customized. More things to be added in the future (e.g. pane sizing). Also, change default color schema to blue+yellow.

Closes #193
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 6, 2024
[1.1.0] - 2024-05-05

Added
- Add `section` field to `!request` chain values, to allow chaining response headers rather than body ([#184](LucasPickering/slumber#184))
- Add action to save response body to file ([#183](LucasPickering/slumber#183))
- Add `theme` field to the config, to configure colors ([#193](LucasPickering/slumber#193))
  - [See docs](https://slumber.lucaspickering.me/book/api/configuration/theme.html) for more info
- Add `stdin` option to command chains ([#190](LucasPickering/slumber#190))

Changed
- Reduce UI latency under certain scenarios
  - Previously some actions would feel laggy because of an inherent 250ms delay in processing some events
- Search parent directories for collection file ([#194](LucasPickering/slumber#194))
- Use thicker borders for selected pane and modals
- Change default TUI colors to blue and yellow

Fixed
- Fix Slumber going into zombie mode and CPU spiking to 100% under certain closure scenarios ([#136](LucasPickering/slumber#136))
- Fix historical request/response no loading on first render ([#199](LucasPickering/slumber#199))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New behavior to enable things that were previously not possible good first issue Good for newcomers
Projects
None yet
1 participant