-
Notifications
You must be signed in to change notification settings - Fork 239
Add keyboard macros #305
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
Add keyboard macros #305
Conversation
|
This looks amazing! Thanks for working on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements support for keyboard macros by adding a macros section in both the settings UI and action bar, as well as introducing JSON RPC endpoints on the server to get and set macros.
- Adds new UI components and routing for managing keyboard macros
- Enhances client-side hooks and state management to support macro execution
- Implements server-side API endpoints and configuration updates to persist macros
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/src/routes/devices.$id.settings.tsx | Added a new navigation link for keyboard macros in settings |
| ui/src/main.tsx | Registered new routes for macros in the app routing configuration |
| ui/src/hooks/useKeyboard.ts | Added an executeMacro function to process macro steps |
| ui/src/hooks/stores.ts | Introduced macros state and functions to load and save keyboard macros |
| ui/src/components/WebRTCVideo.tsx | Integrated MacroBar component into the video layout |
| ui/src/components/MacroBar.tsx | New component rendering a macro bar with buttons for each macro |
| jsonrpc.go | Added JSON RPC handlers for getting and setting keyboard macros |
| config.go | Added configuration types and validation for keyboard macros |
Files not reviewed (1)
- ui/src/index.css: Language not supported
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work — thanks for taking the time to put this together. It’s a superb implementation, and the attention to detail really shows. Much appreciated.
Most of the comments are around UI consistency and readability: use existing components where possible, and split the macro settings file into multiple routes to keep things clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Even better second iteration
- Arrows feel much better than DnD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have too much left to say. You've done a wonderful job. Fix the remaining things from the last review, and these tiny change requests and then we should be able to merge
|
i'm getting some local dev issues from this commit #336 when running ui from https://github.com/jetkvm/kvm/blob/dev/ui/dev_device.sh |
|
Fixed and merged in: #342 |
|
Great work, @Savid! Will be included in the next version 0.4.0. |
* add jsonrpc keyboard macro get/set * add ui keyboard macros settings and macro bar * use notifications component and handle jsonrpc errors * cleanup settings menu * return error rather than truncate steps in validation Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(ui): add className prop to Checkbox component to allow custom styling * use existing components and CTA * extract display key mappings * create generic combobox component * remove macro description * cleanup styles and macro list * create sortable list component * split up macro routes * remove sortable list and simplify * cleanup macrobar * use and add info to fieldlabel * add useCallback optimizations * add confirm dialog component * cleanup delete buttons * revert info on field label * cleanup combobox focus * cleanup icons * set default label for delay --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
This is really awesome - I'm not sure what exactly the edit buttons do when viewing the macros steps, so maybe you already have this, but it would be cool to expand this for easy use with really long strings (one-liners, long passwords, password prefixes, api keys, etc). Could this be improved to support those use cases as well? It'd be nice to have like a text area for something like duckyscript rather than having to enter each character in one at a time via a GUI, so I could put common one-liners like "apt-get update; apt-get upgrade;ENTER" on a button without it being 5 pages long and taking half an hour to enter in :) (actual duckyscript would be slightly different but you get the idea. it supports specifying the delay and strings and other things too.) Quick Intro: https://github.com/dekuNukem/duckyPad/blob/master/duckyscript_info.md I don't know that supporting the full spec would be necessary because DuckyScript 3 gets into if statements and so forth, but support for the basics like strings, special characters and escaping presumably, and special keys would be really really awesome. I can't purchase a unit right now due to US orders being shut down over tariffs, but I applied for a PoE beta unit, and if I were sent one I would happily look into making this a reality, and I'd love to have OP's help if they don't want to do it themselves :) |
* add jsonrpc keyboard macro get/set * add ui keyboard macros settings and macro bar * use notifications component and handle jsonrpc errors * cleanup settings menu * return error rather than truncate steps in validation Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(ui): add className prop to Checkbox component to allow custom styling * use existing components and CTA * extract display key mappings * create generic combobox component * remove macro description * cleanup styles and macro list * create sortable list component * split up macro routes * remove sortable list and simplify * cleanup macrobar * use and add info to fieldlabel * add useCallback optimizations * add confirm dialog component * cleanup delete buttons * revert info on field label * cleanup combobox focus * cleanup icons * set default label for delay --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add jsonrpc keyboard macro get/set * add ui keyboard macros settings and macro bar * use notifications component and handle jsonrpc errors * cleanup settings menu * return error rather than truncate steps in validation Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat(ui): add className prop to Checkbox component to allow custom styling * use existing components and CTA * extract display key mappings * create generic combobox component * remove macro description * cleanup styles and macro list * create sortable list component * split up macro routes * remove sortable list and simplify * cleanup macrobar * use and add info to fieldlabel * add useCallback optimizations * add confirm dialog component * cleanup delete buttons * revert info on field label * cleanup combobox focus * cleanup icons * set default label for delay --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Macro bar
Settings