diff --git a/src/pages/ChatPage.tsx b/src/pages/ChatPage.tsx
index e6baa89..6db8a78 100644
--- a/src/pages/ChatPage.tsx
+++ b/src/pages/ChatPage.tsx
@@ -632,8 +632,24 @@ export default function ChatPage() {
onChange={(e) => setInput(e.target.value)}
placeholder="问我任何问题..."
autoSize={{ minRows: 3, maxRows: 10 }}
- onPressEnter={(e) => {
- if (!e.shiftKey) {
+ onKeyDown={(e) => {
+ if (e.key !== 'Enter') return;
+ if ((e as any).isComposing) return;
+
+ if (e.metaKey || e.ctrlKey) {
+ e.preventDefault();
+ const el = e.currentTarget;
+ const start = el.selectionStart ?? input.length;
+ const end = el.selectionEnd ?? input.length;
+ const next = input.slice(0, start) + '\n' + input.slice(end);
+ setInput(next);
+ requestAnimationFrame(() => {
+ el.selectionStart = el.selectionEnd = start + 1;
+ });
+ return;
+ }
+
+ if (!e.shiftKey && !e.altKey) {
e.preventDefault();
handleSend();
}
@@ -655,6 +671,7 @@ export default function ChatPage() {
/>
{
handleAttach(files as File[]);
@@ -663,9 +680,14 @@ export default function ChatPage() {
showUploadList={false}
accept=".txt,.md,.markdown,.json,.csv,.pdf,.docx,.html,.htm,image/png,image/jpeg,image/webp,image/gif"
>
- } />
+ } />
- } onClick={() => setTplDrawerOpen(true)} />
+ }
+ onClick={() => setTplDrawerOpen(true)}
+ />
{sending ? (
diff --git a/src/styles.css b/src/styles.css
index 3d2b904..f753134 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -556,11 +556,6 @@ body {
box-shadow: var(--shadow-sm);
}
-.chat-input-card:focus-within {
- border-color: var(--color-border-focus);
- box-shadow: var(--shadow-focus);
-}
-
.chat-input-stack {
display: flex;
flex-direction: column;
@@ -614,6 +609,20 @@ body {
color: var(--color-text-tertiary);
}
+.chat-tool-button {
+ position: relative;
+ z-index: 1;
+}
+
+.chat-upload {
+ flex: 0 0 auto;
+ display: inline-flex;
+}
+
+.chat-upload .ant-upload {
+ display: inline-flex;
+}
+
.chat-send-button {
width: 40px;
height: 40px;