Skip to content

Conversation

@bpmct
Copy link
Member

@bpmct bpmct commented Dec 9, 2025

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

@bpmct bpmct requested a review from aslilac December 9, 2025 01:14
@bpmct bpmct changed the title feat: Add cmd+enter to submit tasks immediately feat(site): add cmd+enter to submit tasks immediately Dec 9, 2025
@bpmct bpmct force-pushed the feat/issue-21179-cmd-enter-task-submit branch from 5b95d53 to c5fd1d2 Compare December 9, 2025 01:18
@bpmct
Copy link
Member Author

bpmct commented Dec 9, 2025

I have confirmed this works!

@bpmct bpmct requested a review from DanielleMaywood December 9, 2025 12:26
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>
@bpmct bpmct force-pushed the feat/issue-21179-cmd-enter-task-submit branch from c5fd1d2 to 802cb42 Compare December 9, 2025 15:01
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.
@bpmct bpmct marked this pull request as draft December 10, 2025 14:58
@bpmct bpmct marked this pull request as ready for review December 10, 2025 15:00
@bpmct
Copy link
Member Author

bpmct commented Dec 10, 2025

Cool, edited and confirmed this still works.

Copy link
Contributor

@DanielleMaywood DanielleMaywood left a 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!

bpmct added a commit that referenced this pull request Dec 10, 2025
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();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
e.preventDefault();

No need for this as onSubmit handles it but otherwise LGTM

@bpmct bpmct enabled auto-merge (squash) December 10, 2025 19:50
@bpmct bpmct merged commit 8e460ca into main Dec 10, 2025
48 of 50 checks passed
@bpmct bpmct deleted the feat/issue-21179-cmd-enter-task-submit branch December 10, 2025 22:00
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks: pressing shift+enter should kick off a new task immediately

4 participants