Skip to content

feat: show macro key assignments on the macro page#3002

Merged
ert78gb merged 5 commits into
masterfrom
issue-2743-macro-key-assignments
Jul 16, 2026
Merged

feat: show macro key assignments on the macro page#3002
ert78gb merged 5 commits into
masterfrom
issue-2743-macro-key-assignments

Conversation

@mondalaci

@mondalaci mondalaci commented Jul 15, 2026

Copy link
Copy Markdown
Member

Resolves #2743

Summary

  • On macro pages, show Used on: with comma-separated links to each assigned key (keymap ⭢ layer ⭢ key using default QWERTY labels).
  • Links navigate to /keymap/{abbreviation}?layer=&module=&key= and open the key action popover.
  • Remove redundant back-navigation from the macro page and keymap popover; keep Jump to macro for reverse navigation.
  • Fix Jump to macro so it no longer marks the configuration dirty or shows Save to keyboard.

Test plan

  • Open a macro assigned to one or more keys and verify Used on: links appear under the title.
  • Click a Used on link and confirm it opens the correct keymap/layer/key popover.
  • From the popover Macro tab, click Jump to macro and confirm navigation works without showing Save to keyboard.
  • Assign a macro to a new key via Assign new macro and confirm saving still works normally.
  • Verify module settings back links still render as Back to [name] keymap.

Made with Cursor

@ert78gb

ert78gb commented Jul 15, 2026

Copy link
Copy Markdown
Member

This PR contains the commits of other PR. As far as I see the UI part of the other PR is havent fully decided so this PR also blocked.

List where each macro is used with links back to the assigned key, and avoid treating Jump to macro navigation as a config change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mondalaci mondalaci force-pushed the issue-2743-macro-key-assignments branch from 30b72b3 to 91de325 Compare July 15, 2026 13:35
@mondalaci

Copy link
Copy Markdown
Member Author

Rebased onto master so this PR now contains only the macro key-assignment commit (91de3252), without the macro sidebar grouping commits from the other PR.

The diff is 17 files / +344 −35, scoped to issue #2743 only.

@ert78gb

ert78gb commented Jul 15, 2026

Copy link
Copy Markdown
Member

I summarise here my problem with this PR and macro grouping

  • the uhk-common package contains UI related code that have to be live in the uhk-web package. I did not mention it in the macro grouping PR because I was happy about the unit test, but I don't want it to be a trend. I thought I will add test runner to the uhk-web and we will port it.

  • Earlier I followed the smart/dummy component pattern and mostly the store contained the main calculations now the deep components reads from the store and do calculations. The dummy components just render the input and propagate the event. Most of the exception is inherited.

  • uses to much custom css. Would be nice to consolidate them for a unified styling and not add more and more. Every time when have to modify the css have to think about why is it there? Can I remove or what will collapse?

  • the use of optional chaining ? and nullish coalescing operator ?? operators is a code smell for me. Something is not properly initialised or read data from wrong selector. I maintained an old react app that was full of optional chaining and it was nightmare. Always thinking about is it intentionally optional or just the developer was lazy.

  • methods/functions with more than 3 parameters are hard to maintain in long term, like createKeymapWithMacroAssignment

I am not agains ai development but somehow have to improve their skills to decrease the cost of afterwork. Or we don't do after work and we will see the outcome after few months. I especially like I don't have to fight with pixels but I don't like the mess and noise that generating.

@ert78gb ert78gb changed the title Show macro key assignments on the macro page feat: show macro key assignments on the macro page Jul 15, 2026
Move macro assignment finding out of uhk-common, compute Used on view models in the smart macro-edit container, prefer Bootstrap utilities over custom CSS, and add Cursor rules capturing the review guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mondalaci

Copy link
Copy Markdown
Member Author

Addressed the architectural points from the review:

  • Moved findMacroKeyAssignments (and its tests) from uhk-common into uhk-web
  • Made macro-header presentational for Used on data; macro-edit derives the view models and passes them as @Input
  • Replaced custom Used on CSS with Bootstrap utilities (my-2, small, me-1, text-nowrap)
  • Reduced optional chaining / nullish coalescing in the new code; options objects for >3-parameter helpers
  • Added Cursor rules so future Agent work follows the same boundaries, smart/dumb split, styling preference, parameter limit, and initialization guidance

combineLatest([
store.select(getSelectedMacro),
store.select(getKeymaps),
store.select(getDefaultUserConfiguration),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We load the default configuration into the store when opening the Add Keymap menu.
I do it to save some memory because it is not frequently used feature. We could load it and app start and refresh when new device is connected, but I haven't did it, because little bit confusing me to see the macro assigned on a non qwerty keymap and we so the qwerty key name.
For example I assign the macro to the Dvorak O that is Qwerty S and I see Dvorak for PC -> Base -> S instead of Dvorak for PC -> Base -> O

The macro page "Used on" links need the default QWERTY keymap, which was
previously only loaded when opening the add-keymap page.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ert78gb ert78gb merged commit 8a0fd9e into master Jul 16, 2026
6 checks passed
@ert78gb ert78gb deleted the issue-2743-macro-key-assignments branch July 16, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On the macro page, list the keys the macro is assigned to

2 participants