Repository navigation
Update keyboard-shortcut-sequences extension - #22181
Conversation
- update README clarity on shortcut sequence configuration - chore: update changelog with new delay feature and UX improvements - fix: simplify special keys handling in shortcut sequence - fix: update shortcut delay handling and validation - wording improvement - fix: multiple special keys in one command - add new features
|
Thank you for your first contribution! 🎉 🔔 @SKaplanOfficial you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. You can expect an initial review within five business days. |
left a comment
There was a problem hiding this comment.
Greptile Overview
Summary
This PR adds delay support and special key selection to keyboard shortcut sequences, improving UX by making shortcut management more dynamic.
Major changes:
- Added delay field for each shortcut to compensate for loading times
- Introduced special keys dropdown (function keys, arrows, volume, brightness) as alternative to manual key code entry
- Replaced static "Number of Shortcuts" field with dynamic add/remove controls at end of form
- Updated types to include
specialsarray anddelayfield inShortcutinterface
Critical issues found:
- utils.ts:8-10 -
forEachwith async callback won't execute shortcuts sequentially; delays won't work as intended - utils.ts:9 - Delay calculation accumulates all previous delays instead of using just the current shortcut's delay
- SequenceForm.tsx:261 -
shortcutDelaysarray not updated when removing shortcuts, causing state misalignment - types.ts:48,52-55 - Multiple duplicate key codes (Power/F5 both "96", brightness keys conflict with F-keys)
Confidence Score: 1/5
- This PR has critical bugs that break core functionality - shortcuts won't execute sequentially and delays won't work correctly
- Score reflects multiple critical logic errors: async forEach breaks sequential execution (the main feature), incorrect delay accumulation logic, missing state updates causing data misalignment, and duplicate key codes causing incorrect key mapping. These issues will cause the extension to malfunction.
- Pay close attention to
utils.ts(broken async logic) andtypes.ts(duplicate key codes)
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| extensions/keyboard-shortcut-sequences/src/utils.ts | 1/5 | Critical logic errors: async forEach breaks sequential execution and delay calculation accumulates incorrectly |
| extensions/keyboard-shortcut-sequences/src/types.ts | 2/5 | Multiple duplicate key codes will cause incorrect key mapping (Power/F5, brightness/function keys, etc.) |
| extensions/keyboard-shortcut-sequences/src/components/SequenceForm.tsx | 3/5 | Missing state array update when removing shortcuts causes misalignment; otherwise good UX improvements |
6 files reviewed, 5 comments
| sequence.shortcuts.forEach(async (shortcut, index) => { | ||
| const delay = sequence.shortcuts.slice(0, index + 1).reduce((acc, curr) => acc + (curr.delay || 0), 0); | ||
| await new Promise((resolve) => setTimeout(resolve, delay)); |
There was a problem hiding this comment.
logic: forEach doesn't wait for async callbacks - shortcuts will execute in parallel, not sequentially, breaking the delay logic.
| sequence.shortcuts.forEach(async (shortcut, index) => { | |
| const delay = sequence.shortcuts.slice(0, index + 1).reduce((acc, curr) => acc + (curr.delay || 0), 0); | |
| await new Promise((resolve) => setTimeout(resolve, delay)); | |
| for (let index = 0; index < sequence.shortcuts.length; index++) { | |
| const shortcut = sequence.shortcuts[index]; | |
| const delay = sequence.shortcuts.slice(0, index + 1).reduce((acc, curr) => acc + (curr.delay || 0), 0); | |
| await new Promise((resolve) => setTimeout(resolve, delay)); |
| const currentApplication = await getFrontmostApplication(); | ||
| sequence.shortcuts.forEach(async (shortcut) => { | ||
| sequence.shortcuts.forEach(async (shortcut, index) => { | ||
| const delay = sequence.shortcuts.slice(0, index + 1).reduce((acc, curr) => acc + (curr.delay || 0), 0); |
There was a problem hiding this comment.
logic: Delay calculation accumulates all previous delays, not just the current shortcut's delay. Each shortcut should only wait for its own delay value.
| const delay = sequence.shortcuts.slice(0, index + 1).reduce((acc, curr) => acc + (curr.delay || 0), 0); | |
| await new Promise((resolve) => setTimeout(resolve, shortcut.delay || 0)); |
| setShortcutCount(shortcutCount + 1); | ||
| setShortcutKeys([...shortcutKeys, ""]); | ||
| setShortcutModifiers([...shortcutModifiers, []]); | ||
| setShortcutSpecials([...shortcutSpecials, []]); |
There was a problem hiding this comment.
logic: When removing a shortcut, shortcutDelays is not updated. This causes misalignment between state arrays.
| setShortcutSpecials([...shortcutSpecials, []]); | |
| setShortcutDelays(shortcutDelays.slice(0, -1)); |
| VolumeDown: "73", | ||
| Mute: "74", | ||
| Help: "114", | ||
| Power: "96", |
There was a problem hiding this comment.
logic: Power and F5 both map to key code "96" - one is incorrect.
| BrightnessUp: "113", | ||
| BrightnessDown: "107", | ||
| PrintScreen: "105", | ||
| Insert: "114", |
There was a problem hiding this comment.
logic: Duplicate key codes: BrightnessUp (113) conflicts with F15 (113), BrightnessDown (107) conflicts with F14 (107), PrintScreen (105) conflicts with F13 (105), and Insert (114) conflicts with Help (114).
- changelog - bugfix broken behavior - bugfix delay - check and sort speical keys - bugfix save delay on change - hide hud and notify when sequence has finished - add fn key functionality - bugfix: dont delete empty shortcuts - add fn key functionality
| sequence.shortcuts.forEach(async (shortcut) => { | ||
|
|
||
| // Hide Raycast overlay immediately | ||
| await showHUD(`Running: ${sequence.name}`); |
There was a problem hiding this comment.
If we use showToast instead, we can have it show an animated state until the shortcut stops. Not sure that is better or worse though?
e.g. the code below will result in something like the image, but I'm not sure we actually want that. Could be annoying for longer delays. Perhaps it could be an option in a future version.
// Hide Raycast overlay immediately
// await showHUD(`Running: ${sequence.name}`); // Replaced
await closeMainWindow();
const toast = await showToast({
title: `Running: ${sequence.name}`,
style: Toast.Style.Animated
});
try {
// ... shortcuts loop code
} catch (error) {
toast.title = `Failed to Run Sequence ${sequence.name}`;
toast.style = Toast.Style.Failure;
return;
}
// await showHUD(`Sequence ${sequence.name} finished`); // Replaced
toast.title = `Sequence ${sequence.name} finished`;
toast.style = Toast.Style.Success;
There was a problem hiding this comment.
I like that Idea! Its in the next pullrequest
| id="editShortcuts" | ||
| value="placeholder" | ||
| info="Use the selection to add or remove shortcuts from the sequence." | ||
| onChange={(value) => { |
There was a problem hiding this comment.
I'm not able to add a 3rd sequence without manually resetting the dropdown to some other value (since it only checks if the value changed, this makes sense). There's a few ways around it, but imo an elegant way is the imperative API using useRef, e.g.:
// ... state variables
const dropdownRef = useRef<Form.ItemReference | null>(null);
// ... form code
<Form.Dropdown
// ... props
ref={dropdownRef}
onChange={(value) => {
if (value === "add") {
// ...
} else if (value === "remove" && shortcutCount > 1) {
// ...
}
// Reset to initial value
dropdownRef.current?.reset();
}}
>
// ...
</Form.Dropdown>
commented
Oct 30, 2025
|
Hi @dw-herrmann👋 Thanks for your contribution 🔥 Did you see the comments from @SKaplanOfficial I converted this PR into a draft until it's ready for the review, please press the button |
commented
Oct 30, 2025
|
@pernielsentikaer, thank you for the reminder. I'll take care of the fixes in the next few days :) |
- updated images - focus latest shortcut affter adding or removing one - reset dropdown after adding field - - show animated state while shortcut is running - wrap loop with try-catch
left a comment
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This review covers only the changes made since the last review, not the entire PR. The update addresses several critical fixes and UX improvements to the keyboard shortcut sequences extension. The changelog was updated to reflect the correct release date (October 14th) and document the new FN-key modifier support. The core execution logic was fixed by replacing forEach with a proper for-of loop to ensure sequential shortcut execution, and delay calculation was corrected to use individual shortcut delays rather than accumulating all previous delays. Function key support was added through proper AppleScript handling with key down/up events. The form component received UX enhancements including auto-focus for delay fields, dropdown reset functionality using the imperative API, and better error handling. The types were cleaned up by removing conflicting key codes and organizing them into logical sections. These changes address the fundamental async execution issues while expanding functionality and improving user experience.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| extensions/keyboard-shortcut-sequences/CHANGELOG.md | 5/5 | Updated release date and documented FN-key modifier feature addition |
| extensions/keyboard-shortcut-sequences/src/components/SequenceForm.tsx | 4/5 | Added auto-focus, dropdown reset functionality, and FN modifier support with some complexity concerns |
| extensions/keyboard-shortcut-sequences/src/utils.ts | 4/5 | Fixed critical async execution flow and added FN key support with proper error handling |
| extensions/keyboard-shortcut-sequences/src/types.ts | 4/5 | Removed conflicting key codes and added FN modifier support, improving reliability |
Confidence score: 4/5
- This PR addresses critical functional issues and is safe to merge with the improvements significantly outweighing any minor concerns
- Score reflects successful resolution of major async execution bugs and timing issues, with well-implemented FN key support and UX enhancements, though some complexity was added to the form component
- Pay close attention to the SequenceForm.tsx file for potential focus management edge cases in complex user interactions
4 files reviewed, 3 comments
| // Set focus to the new delay field after state updates | ||
| setTimeout(() => setFocusDelayIndex(newIndex), 100); |
There was a problem hiding this comment.
style: Consider using requestAnimationFrame instead of setTimeout for UI state changes to ensure proper timing with React's rendering cycle.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
commented
Nov 4, 2025
|
@SKaplanOfficial can you give it another spin? |
There was a problem hiding this comment.
I'm fine with this image, but does it meet the store requirements @pernielsentikaer? In reference to the background not being one of the Raycast ones.
commented
Nov 5, 2025
|
Published to the Raycast Store: |
commented
Nov 5, 2025
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
commented
Nov 5, 2025
|
Hey @pernielsentikaer, somehow the order of the screenshots got mixed up in the store and on the website. This makes the extension a little harder to understand.
|

Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder