Skip to content

feat(editor): add keyboard shortcut for Run Code button#8268

Open
enkr1 wants to merge 1 commit intoCoursemology:masterfrom
enkr1:feat/run-code-hotkey
Open

feat(editor): add keyboard shortcut for Run Code button#8268
enkr1 wants to merge 1 commit intoCoursemology:masterfrom
enkr1:feat/run-code-hotkey

Conversation

@enkr1
Copy link
Copy Markdown

@enkr1 enkr1 commented Mar 21, 2026

Closes #4972

Changes

RunCodeButton.tsx:

  • Add Ctrl+Shift+Enter / Cmd+Shift+Enter keyboard shortcut (mirrors SubmitButton pattern using react-hot-keys)
  • Add tooltip showing the shortcut on hover
  • Extract isDisabled to avoid duplicating the condition

translations.ts:

  • Add runCodeTooltip translation

Why Ctrl+Shift+Enter?

Ctrl+Enter is already used by Submit. Shift modifier keeps it distinct while staying intuitive — same pattern used in VS Code for "Run" vs "Run Selection".

Not changed

Submit button's existing Ctrl+Enter shortcut is untouched.

@enkr1
Copy link
Copy Markdown
Author

enkr1 commented Mar 27, 2026

Friendly ping — this is a small one (Ctrl+Shift+Enter for Run Code, mirroring the existing Ctrl+Enter for Submit). The shortcut choice avoids collisions with the existing submit binding. Happy to tweak the key combo if the team has a preference.

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.

Missing "run code" hotkey for manual graded programming questions

1 participant