-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(site): add cmd+enter to submit tasks immediately #21182
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
Conversation
5b95d53 to
c5fd1d2
Compare
|
I have confirmed this works! |
Implements cmd+enter (Mac) / ctrl+enter (Windows/Linux) keyboard shortcut for submitting new tasks on the tasks page. Regular enter still creates a new line in the textarea. Fixes #21179 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
c5fd1d2 to
802cb42
Compare
As suggested by @aslilac, pass the onSubmit handler directly as a prop rather than querying the DOM with closest('form'). This is more idiomatic React and keeps the logic within React's declarative paradigm.
|
Cool, edited and confirmed this still works. |
DanielleMaywood
left a comment
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.
Just a couple of comments, after that I think we'll be there!
When working on PRs, Claude Code was sometimes force pushing to branches. This adds simple git workflow guidelines emphasizing: - Check out PR branches properly (fetch, checkout, pull) - Don't use git push --force unless explicitly requested Examples of PRs with multiple commits from iterative work: - #21148: 7 commits including merge commit - #21150: 9 commits with iterative documentation changes - #21182: 4 commits with fixes - Also observed force updates on feat/add-tasks-template-flag branch 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove custom onFormSubmit prop from PromptTextarea - Remove duplicate e.preventDefault() call - Use existing onKeyDown prop from TextareaAutosizeProps - Submit form via form.requestSubmit() instead of calling handler directly
| const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => { | ||
| // Submit form on Cmd+Enter (Mac) or Ctrl+Enter (Windows/Linux) | ||
| if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) { | ||
| e.preventDefault(); |
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.
| e.preventDefault(); |
No need for this as onSubmit handles it but otherwise LGTM
Implements cmd+enter (Mac) / ctrl+enter (Windows/Linux) keyboard shortcut for submitting tasks on the tasks page. Regular enter key still creates new lines as expected.
Fixes #21179
🤖 Generated with Claude Code