Skip to content

fix(app): insert newline on Shift+Enter in AI inputs - #748

Merged
murongg merged 1 commit into
markrahq:v2from
itsmunzir:fix/ai-input-shift-enter-newline
Sep 27, 2026
Merged

murongg merged 1 commit into
markrahq:v2from
itsmunzir:fix/ai-input-shift-enter-newline

Conversation

@itsmunzir

Copy link
Copy Markdown
Contributor

Summary

  • Shift+Enter now inserts a newline in both AI inputs instead of submitting the prompt.
  • Inline AI command bar (AiCommandBar): Shift+Enter is treated like the existing Ctrl+Enter newline gesture.
  • Sidebar AI agent panel (AiAgentPanel): Shift+Enter returns early like Ctrl+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 checks event.ctrlKey || event.shiftKey.
  • packages/app/src/components/AiCommandBar.test.tsx — added inserts a newline with Shift+Enter.
  • packages/app/src/components/AiAgentPanel.tsx — submit suppression now checks event.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.tsx
    • Before: 2 failed (the new tests), after: 68 passed.
  • pnpm run typecheck:test — passes.
  • pnpm build — passes.
  • Ctrl+Enter behavior is unchanged; only Shift+Enter is added. No visual/geometry change, so no screenshots.

Notes

Refs #746

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
@vercel

vercel Bot commented Sep 27, 2026

Copy link
Copy Markdown

@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.

@itsmunzir
itsmunzir changed the base branch from main to v2 September 27, 2026 10:54
@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
markra-web Ready Ready Preview Sep 27, 2026 3:24pm UTC

@murongg
murongg merged commit 867d4dd into markrahq:v2 Sep 27, 2026
23 checks passed

This branch was successfully deployed

1 active deployment
Preview — 76780738 Deployed Sep 27, 2026 by vercel[bot]
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