Skip to content

feat(desktop): support F1-F12 as hotkeys without modifiers#956

Merged
Kitenite merged 1 commit intosuperset-sh:mainfrom
iven:taxicab
Feb 9, 2026
Merged

feat(desktop): support F1-F12 as hotkeys without modifiers#956
Kitenite merged 1 commit intosuperset-sh:mainfrom
iven:taxicab

Conversation

@iven
Copy link
Copy Markdown
Contributor

@iven iven commented Jan 26, 2026

Description

  • Add F1-F12 to ELECTRON_KEY_MAP for hotkey recognition
  • Allow function keys (F1-F12) as valid app hotkeys without requiring Cmd/Ctrl modifiers
  • Update terminal keyboard handler to let unconfigured F1-F12 pass through to terminal apps
  • Rename hasPrimaryModifier to isValidAppHotkey for better semantics

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

图片 图片

Additional Notes

Summary by CodeRabbit

  • Improvements
    • Function keys (F1–F12) can now be assigned as app shortcuts without requiring modifier keys.
    • Enhanced keyboard event recognition for more reliable hotkey detection in the terminal.

✏️ Tip: You can customize this high-level summary in your review settings.

- Add F1-F12 to ELECTRON_KEY_MAP for hotkey recognition
- Allow function keys (F1-F12) as valid app hotkeys without requiring Cmd/Ctrl modifiers
- Update terminal keyboard handler to let unconfigured F1-F12 pass through to terminal apps
- Rename hasPrimaryModifier to isValidAppHotkey for better semantics
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 26, 2026

📝 Walkthrough

Walkthrough

The changes enhance hotkey handling by adding function key support (F1–F12) to the desktop app's keyboard subsystem. The shared hotkeys module now treats function keys as valid app hotkeys without requiring modifiers, renames the validation function to reflect this broader logic, and updates the terminal helper and hotkeys store to use centralized hotkey resolution instead of simple modifier checks.

Changes

Cohort / File(s) Summary
Hotkeys Core
apps/desktop/src/shared/hotkeys.ts
Added F1–F12 function key mappings to ELECTRON_KEY_MAP. Introduced isFunctionKey helper. Refactored hotkeyFromKeyboardEvent to accept function keys without requiring ctrl/meta modifiers. Renamed exported function hasPrimaryModifierisValidAppHotkey with updated logic to permit function keys as standalone valid hotkeys.
Terminal Keyboard Handling
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/helpers.ts
Replaced simple meta/ctrl key presence check with centralized hotkey resolution via hotkeyFromKeyboardEvent(event, getCurrentPlatform()). Now only processes events recognized as valid hotkeys, delegating key recognition to the shared hotkeys module.
Hotkeys Store Validation
apps/desktop/src/renderer/stores/hotkeys/store.ts
Updated hotkey validation in setHotkey and setHotkeysBatch methods from hasPrimaryModifier to isValidAppHotkey, enabling function keys as valid app hotkeys alongside ctrl/meta-modified keys.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • CharlieHelps
  • Kitenite

Poem

🐰 Function keys hop into the fray,
F1 through F12 now have their say,
No modifiers needed, hopping free,
Hotkeys resolve most tastefully,
A centralizer's dream, you see! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: adding support for function keys F1-F12 as hotkeys without requiring modifiers.
Description check ✅ Passed The description includes a clear summary of changes and indicates it is a new feature, but lacks related issue links and testing/verification details required by the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kitenite Kitenite merged commit 25b0f6c into superset-sh:main Feb 9, 2026
1 check passed
@Kitenite
Copy link
Copy Markdown
Collaborator

Kitenite commented Feb 9, 2026

@iven Sorry for taking so long, this works!

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.

2 participants