-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
[DRAFT]: Theme definition #3242
base: main
Are you sure you want to change the base?
Conversation
I'm very excited to see this happening!! Just a heads up: I'm in the process of wrapping up v0.40.0 in the next week or so, so it will take me a short while to get to this. But rest assured, I will! I ask for your patience and thank you again for what seems like a tremendous amount of work! |
Is there a full config example for this? I'd like to grab this and compile it locally to test it out .. |
Hey @DeaconDesperado - amazing and very thorough work here! Thank you for your patience and apologies for taking so long to give you an initial review. I'll try to be faster from now on so we can iterate over this quickly. If it's alright with you, I prefer to go over the actual code changes once the product side (API, config, spec, behaviour, etc.) has been finalized. I think it'll save both of us some work, because changes in that area can cause sweeping changes in its implementation. So to your questions:
Good catch, we didn't account for these. Perhaps we can add a
I actually like it this way. I understand it can seem a bit redundant, but I think in the context of a theme configuration this is much clearer than
I don't have a strong opinion here, so up to you. A few considerations:
Legit! Let's keep things simple.
Yes, these are legacies! It's totally fine to remove them if you want.
These issues were fixed in v0.40.0 and iirc I even moved lots of stuff to UI components, so I hope this will make things easier! Anything else I can do to help move this along? |
@imsnif Thanks for the thorough answers! Will incorporate this feedback and have another go at Strider. |
@glenn-lytx below is a sample of the themes block I've been using locally (also used in the screenshots), just need to change
|
Awesome, thanks! I'll give it a try |
e9bebbc
to
5c845d3
Compare
Revised this quite heavily with the suggested changes:
To validate the behavior of the UI components, I set up a very simple toy example based on rust-plugin-example that just renders all the elements in various states (with silly, but noticeable color differences between states) Let me know if the high level approach here now looks sound, and then I'll proceed with improving the test coverage for backward compatiblity and the aforementioned product stuff to support migration (docs, possible script to migrate old palette to new themes). Also LMK if we prefer that in a separate PR. Thanks! |
Hey @DeaconDesperado - I'm happy to see the work going on. Kudos on your perseverance and consistency, this looks like quite a great effort! I'm sorry it's taking me a bit of time to get to this, but rest assured - I plan to ASAP! I have not forgotten nor do I mean to let your work go to waste. |
Hey @DeaconDesperado - this sounds good (though I will as mentioned wait with going over the exact code until we finalize the product stuff). Including a conversion script is a very nice touch, but assuming we preserve backward compatibility and the existing themes will continue working as expected, I think it's alright. This is mostly meant to allow people to more easily create new themes with greater flexibility. For the interests of efficiency, I have put aside some time every week on Friday morning CEST to go over this PR. So that you'll know when I'll do the next round and are able to prepare for it. I'll try to be available for quick questions in between so that we can get this going. What else do you need from me for the time being? |
Draft implementation of the specification laid out in #2297. Would love feedback on this!
Rough outline of the changes:
Styling
, and the necessary protobuf records to match the spec from [Proposal] New theme definition spec #2297Styling
Styling
<->Palette
in order to preserve backward compatibility for themes:Palette
in their config).Styling
->Palette
conversion is performed in theplugin_api
layer, so the older message format is still propagated to plugins.Open questions / notes
client_id_to_colors
This function is used to colorize pane frames and cursors in multi-user sessions. While mentioned in some of the comments, the proposed specification in #2297 didn't explicitly lay these colors out, and there are (presently) 10 of them (larger in number than the other specs). We could consider adding a separate style block for these, repurposing some of the emphases from
frame_unselected
, or using some sane defaults? This draft presently sets them to values fromcrate::shared::colors
for the time being.Configuration shape
KDL prohibits anonymous nodes, and lists are represented as sequential values after the node name. In order to support all three representations of color presently used (single digit, 3 digit rgb, hex) the style specifications all are named individually, and macros from the original
Palette
are reused to deserialize the color, EG:It's arguably a bit redundant to have these indexes named sequentially this way? It might be possible to consolidate all the emphases to one list, but then that one node would need to be extracted into all 4 indexes somehow, which presents the prospect of mixing the EightBit/RGB/Hex representations... WDYT?
Currently,
Styling
's members are stored as fixed length arrays: it felt like a reasonable way to preserve the ability to add more colors in the future if needed. An alternative could be this structure though.UI Components
Given that I'm only just getting familiar with the codebase, I opted to make these changes in place without also doing a migration of plugins to the various UI components 😅 . The coloration should be consistent however, only preserving differences where they are an artifact of the present implementation.
An example: When using
simplified_ui
, theribbon
implemented directly in the status-bar plugin uses alternating background colors to differentiate "tabs", whereas the UI component (eg insession-manager
) uses divider spacers colored to match the terminal background. Where encountered, these kinds of differences are preserved (for now).ThemeHue + PaletteSource
The swap of foreground/background based on
ThemeHue
is preserved only when converting aPalette
to aStyling
. The only place I could find this value to be set was in this function, which doesn't seem to be called anywhere. Perhaps it's leftover from an earlier implementation? I seemed to uncover similar forPaletteSource
. Not sure if I'm missing something here...Strider
I was unfortunately unable to do as much vetting of strider specifically, encountered #3064 when trying to test it out. Might require some help with this.
Still TODO
In addition to incorporating any feedback, still need to:
snapshot
assertion (temporarily ignored here)zellij convert-theme
utility to migrate existing configurations to the new format?Screenshots
Comparison of default theme (left new, right old)
Welcome screen
Frameless layout
Run pane exit codes
Simplified UI (no arrow fonts)
Compact layout