Repository navigation
fix(app): insert newline on Shift+Enter in AI inputs - #748
Merged
Merged
Conversation
Shift+Enter submitted the prompt in both AI inputs because only Ctrl+Enter was treated as the newline gesture. Treat Shift+Enter like Ctrl+Enter so the inline command bar inserts a line break and the agent panel leaves the default newline behavior in place. Refs markrahq#746
|
@itsmunzir is attempting to deploy a commit to the murongg's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Shift+Enternow inserts a newline in both AI inputs instead of submitting the prompt.AiCommandBar):Shift+Enteris treated like the existingCtrl+Enternewline gesture.AiAgentPanel):Shift+Enterreturns early likeCtrl+Enter, so the textarea keeps its default newline insertion.Relevant to #746. The issue also asks for a configurable send/newline scheme and for the sidebar agent to edit the document; those are separate, larger changes and are out of scope here.
Files changed
packages/app/src/components/AiCommandBar.tsx— newline branch now checksevent.ctrlKey || event.shiftKey.packages/app/src/components/AiCommandBar.test.tsx— addedinserts a newline with Shift+Enter.packages/app/src/components/AiAgentPanel.tsx— submit suppression now checksevent.ctrlKey || event.shiftKey.packages/app/src/components/AiAgentPanel.test.tsx— added a test that Shift+Enter does not submit and does not prevent the default newline.Verification
pnpm --filter @markra/app test src/components/AiCommandBar.test.tsx src/components/AiAgentPanel.test.tsxpnpm run typecheck:test— passes.pnpm build— passes.Ctrl+Enterbehavior is unchanged; onlyShift+Enteris added. No visual/geometry change, so no screenshots.Notes
canSubmitgating are untouched.Refs #746