From 915b91d986c3d7d6841b7d59d2131e1846eb85cd Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Sun, 24 May 2026 21:20:28 +0100 Subject: [PATCH] =?UTF-8?q?write(ui):=20=E5=AF=B9=E8=AF=9D=E6=A1=86?= =?UTF-8?q?=E5=A1=AB=E6=BB=A1=20+=20=F0=9F=8E=99/=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=B5=AE=E5=9C=A8=20textarea=20=E6=A1=86?= =?UTF-8?q?=E5=86=85=E5=8F=B3=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - input-row 改 position: relative + flex:1 撑满 input-bar 高度 - textarea width/height 100% 填满,右/下加 padding (130px / 14px) 给按钮腾位 - btn-tray absolute right:8 bottom:8,pointer-events: none 让 textarea 仍可点 - 按钮 height 40→32 更紧凑 --- apps/write/frontend/src/App.vue | 26 +++++++++-------- apps/write/frontend/src/styles.css | 47 +++++++++++++++++++++--------- 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/apps/write/frontend/src/App.vue b/apps/write/frontend/src/App.vue index 4ec5ae4..10f26ae 100644 --- a/apps/write/frontend/src/App.vue +++ b/apps/write/frontend/src/App.vue @@ -340,18 +340,20 @@ onMounted(() => { :disabled="busy || activeId === null" @keydown="onInputKeydown" > - - +
+ + +
{{ status }}
diff --git a/apps/write/frontend/src/styles.css b/apps/write/frontend/src/styles.css index d8caf07..f687879 100644 --- a/apps/write/frontend/src/styles.css +++ b/apps/write/frontend/src/styles.css @@ -210,40 +210,61 @@ textarea, input { font: inherit; } background: var(--bg-elev); border-top: 1px solid var(--border-soft); padding: 10px 12px; + display: flex; + flex-direction: column; + min-height: 0; +} +.input-row { + flex: 1; + position: relative; + min-height: 0; } -.input-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; } .input-row textarea { - flex: 1 1 0; - min-width: 0; - min-height: 40px; - max-height: 100%; + width: 100%; + height: 100%; + /* 右 + 下 padding 给悬浮按钮腾空间,文字不会爬到按钮下 */ + padding: 11px 130px 14px 14px; resize: none; - padding: 9px 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); - border-radius: 8px; + border-radius: 10px; outline: none; font-size: 14px; - line-height: 1.4; + line-height: 1.5; } .input-row textarea::placeholder { color: var(--text-mute); } .input-row textarea:focus { border-color: var(--accent-strong); } +.input-row textarea:disabled { opacity: 0.6; } + +/* 悬浮在 textarea 框线内右下 */ +.btn-tray { + position: absolute; + right: 8px; + bottom: 8px; + display: flex; + gap: 6px; + pointer-events: none; /* 让 textarea 仍接受点击右下空白处定位光标 */ +} +.btn-tray > * { pointer-events: auto; } .btn { - height: 40px; + height: 32px; padding: 0 14px; - border-radius: 8px; + border-radius: 7px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-dim); - font-size: 14px; + font-size: 13px; + display: inline-flex; + align-items: center; + justify-content: center; } .btn:hover { background: var(--bg-hover); color: var(--text); } -.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; } +.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; font-weight: 600; } .btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:disabled { background: var(--bg-card); border-color: var(--border); color: var(--text-mute); cursor: not-allowed; } -.btn.mic { width: 44px; padding: 0; } +.btn.mic { width: 36px; padding: 0; } .btn.mic.on { background: var(--accent-red); border-color: var(--accent-red); color: #fff; } .status {