Feature/merge layers with corner glyphs - #192
hollowhemlock wants to merge 4 commits into
Conversation
|
Can you split adding the corner legends to a separate PR? That would resolve #151. |
|
Thanks, I like the approach of a separate command to intentionally merge and output another keymap yaml. In general I am not a big fan of combined diagrams because they are hard to read, but it might be useful to have the functionality for some cases. I'll review if you can split as above. |
|
Awesome, will do. |
7a6b736 to
c34fe50
Compare
|
Also, I like the combined diagrams because they take less real estate when printing for easy reference. |
|
Can you rebase this when you get a chance? |
|
yeah |
Add a new subcommand that combines multiple layers into a single layer with multi-position legends. Each key can display: - Center (t/s/h): primary layer tap, shifted, and hold values - Corners (tl/tr/bl/br): tap values from up to 4 additional layers This enables creating compact reference diagrams showing multiple layers at once, useful for cheat sheets and documentation. New module: keymap_drawer/stack/ - stacker.py: Core stacking logic - config.py: StackConfig and CornerLayers models CLI usage: keymap stack-layers --center Base --tl Fun --tr Sys keymap.yaml Configuration options (stack_config): - corner_hide: Values to hide in corners - held_key_colors: Styling for layer activator keys - held_hide: Values to hide on held keys
c34fe50 to
cd3057b
Compare
|
Rebased to main and dropped the 1 commit related to #193. Ran the following and still functions. |
|
Wow, this is great! I wish I had seen this before hacking my own solution for this. I want to look at this more closely, but I wanted to raise one design-level question first for discussion. I was wondering whether it might be possible to get something both cleaner and more versatile by extending the existing More concretely, my impression is that most of the functionality could be obtained from three additional 1/ Layer inclusion/exclusion control I'd propose adding two command line options (config options would also word, but CLI flags have the advantage of allowing reuse of the same config for different outputs): This seems useful not just for stacked layouts, but more generally -- for example, when generating detailed write-ups that describe only certain parts of a keymap at a time. 2/ Stack layer control For the stacking behavior itself, I could imagine a
3/ Optional: show combos on separate layer This one is more optional (there's a single one-line The optional In combination, those options could be used roughly like this: With the caveat that I haven’t yet dug into the implementation details, this approach seems like it might reduce the maintenance and cognitive overhead of adding a separate command, while also giving users more flexibility and reducing the need for additional config files. Curious what you and @caksoylar think. |
|
I'm open to CLI flags if @caksoylar is. I'm unfamiliar with cli naming conventions. I think flag naming should be optimized for source to destination ordering. I prefer a suffix of "from" for stack-layer because the fist argument after the flag is the source. |
|
Thanks for the thoughts to both, and sorry I haven't properly reviewed the PR. This year has been busy. Some thoughts:
To that end, here is a final interface stub to replace the original stack-layers functionality (let me know if I am missing something): keymap rearrange \
--move-combos Combos \
--exclude-layers Mouse \
--move-layer Nav Base tr \
--move-layer Fun Base tl \
--move-layer Num Base bl \
--move-layer Sys Base br \
keymap.yaml >keymap_arranged.yaml |
|
I like it. Separating the commands retains a "source of truth" as reference. The rearrange command could cause unintended results and this will lead to easier end user debugging. Questions
|
|
Sure, |
|
Cool. I'll give it a go in the coming weeks. |
#191 Pull request.