Skip to content

feat(macros): add Type Text step type to keyboard macros#1399

Open
mikeshoss wants to merge 5 commits intojetkvm:devfrom
mikeshoss:feat/macro-type-text
Open

feat(macros): add Type Text step type to keyboard macros#1399
mikeshoss wants to merge 5 commits intojetkvm:devfrom
mikeshoss:feat/macro-type-text

Conversation

@mikeshoss
Copy link
Copy Markdown

@mikeshoss mikeshoss commented Apr 6, 2026

Summary

  • Adds a Type Text step type to keyboard macros, allowing users to enter arbitrary text strings as macro steps
  • Reuses existing Paste Text keyboard layout logic to convert text into keystrokes at execution time
  • Fully backward compatible — the optional text field doesn't affect existing macros

Problem

The macro editor only allows picking individual keys from a dropdown one at a time, making it impossible to type text strings like usernames, URLs, or commands within a macro.

Solution

Each macro step now has a Step Type toggle (Keys / Type Text). Users can mix both in a single macro:

  1. Ctrl+A (select all)
  2. Delete (clear field)
  3. Type Text: user@example.com
  4. Tab (next field)
  5. Type Text: some-text-here
  6. Enter (submit)

Files Changed

File Change
ui/src/hooks/stores.ts Added optional text field to KeySequenceStep
ui/src/hooks/useKeyboard.ts Added expandTextSteps() for text-to-keystrokes conversion
ui/src/components/MacroStepCard.tsx Added Keys/Type Text toggle, textarea, invalid char warnings
ui/src/components/MacroForm.tsx Updated validation for text steps
ui/src/components/MacroBar.tsx Passes keyboard layout during execution
ui/localization/messages/en.json Added 7 new localization strings

Test plan

  • Create a macro with mixed Keys and Type Text steps
  • Verify the Step Type toggle switches between modes
  • Enter unsupported characters and verify warning appears
  • Execute macro and verify text is typed correctly on remote machine
  • Verify existing macros still work unchanged

Note

Medium Risk
Medium risk because it changes macro step schema and execution flow (text expansion + keyboard-layout-dependent behavior), which could affect existing macro playback if edge cases slip through.

Overview
Adds a new Type Text option for macro steps, allowing macros to include freeform text alongside traditional key/modifier steps.

Macro execution now accepts an optional keyboard layout and expands step.text into per-character keystroke steps via shared textToMacroSteps logic (also reused by PasteModal). The macro editor UI is updated with a step-type toggle, textarea input, unsupported-character warnings, and validation now treats text as valid step content; localization strings are updated accordingly (including updating existing validation copy across languages).

Reviewed by Cursor Bugbot for commit b6eb48e. Bugbot is set up for automated code reviews on this repo. Configure here.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 6, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ mikeshoss
❌ claude
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread ui/src/hooks/useKeyboard.ts
… duplicate logic

Both PasteModal.onConfirmPaste and useKeyboard.expandTextSteps had identical
character-to-keystroke conversion loops. Extract the shared logic into a
standalone textToMacroSteps() function that both now call, eliminating the
duplication flagged in review.

https://claude.ai/code/session_011WGGjmQiwkNQ7Rru8ovjTy
Comment thread ui/src/components/MacroForm.tsx
claude added 2 commits April 6, 2026 19:54
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 59324b5. Configure here.

Comment thread .gitignore Outdated
Move watch-pr.sh exclusion to .git/info/exclude where personal
developer scripts belong.

https://claude.ai/code/session_011WGGjmQiwkNQ7Rru8ovjTy
@mikeshoss
Copy link
Copy Markdown
Author

I have afree to the CLA for jetkvm/kvm mutiple times and it still shows that its not signed yet.

@IDisposable IDisposable mentioned this pull request Apr 9, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants