From 29206d62a3a69b3f16cdba85e82c3bd870dca908 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Mon, 27 Jul 2026 16:16:26 +0700 Subject: [PATCH] =?UTF-8?q?fix(ai-copilot):=20t=C4=83ng=20chi=E1=BB=81u=20?= =?UTF-8?q?cao=20prompt=20input=20rows=3D4=20+=20resize-y,=20s=E1=BB=ADa?= =?UTF-8?q?=20ArrowUp/ArrowDown=20ch=E1=BB=89=20g=E1=BB=8Di=20history=20kh?= =?UTF-8?q?i=20cursor=20=E1=BB=9F=20=C4=91=E1=BA=A7u/cu=E1=BB=91i=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/app.jsx | 8 ++++---- wiki.md | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/static/js/app.jsx b/app/static/js/app.jsx index e0188e6..0731e3b 100644 --- a/app/static/js/app.jsx +++ b/app/static/js/app.jsx @@ -15261,18 +15261,18 @@ const App = () => { value: aiPrompt, onChange: e => setAiPrompt(e.target.value), placeholder: "Nhập lệnh điều khiển DAW... (VD: Tạo track mới tên Beat, đặt BPM 128)", - className: "w-full bg-[#1e1e1e] text-zinc-200 p-1.5 rounded border border-zinc-700 focus:outline-none focus:border-purple-600 font-mono text-xs resize-none", - rows: 2, + className: "w-full bg-[#1e1e1e] text-zinc-200 p-1.5 rounded border border-zinc-700 focus:outline-none focus:border-purple-600 font-mono text-xs resize-y", + rows: 4, onKeyDown: e => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); handleAISend(); - } else if (e.key === 'ArrowUp' && promptHistRef.current.length > 0) { + } else if (e.key === 'ArrowUp' && promptHistRef.current.length > 0 && e.target.selectionStart === 0) { e.preventDefault(); const idx = promptHistIdx === -1 ? promptHistRef.current.length - 1 : Math.max(0, promptHistIdx - 1); setPromptHistIdx(idx); setAiPrompt(promptHistRef.current[idx]); - } else if (e.key === 'ArrowDown') { + } else if (e.key === 'ArrowDown' && e.target.selectionStart === aiPrompt.length) { e.preventDefault(); if (promptHistIdx === -1) return; const idx = promptHistIdx + 1; diff --git a/wiki.md b/wiki.md index f270ee8..b2237dc 100644 --- a/wiki.md +++ b/wiki.md @@ -4,6 +4,12 @@ - **Ghi chú/Test (nếu có):** SpessaSynth CDN load OK (200). Cần kiểm tra browser console. --- +### [2026-07-27 16:16] Task: Tăng chiều cao + fix phím mũi tên cho Copilot prompt +- **Tóm tắt thay đổi:** Tăng rows từ 2 → 4, thêm resize-y. Sửa ArrowUp/ArrowDown: chỉ kích hoạt lịch sử khi con trỏ ở đầu/cuối text, giúp các phím mũi tên dùng để di chuyển con trỏ bình thường. Home/End/PageUp/PageDown tự động hoạt động đúng nhờ không bị chặn. +- **Các file ảnh hưởng:** `app/static/js/app.jsx` +- **Ghi chú/Test (nếu có):** Kiểm tra bằng cách focus vào ô prompt, gõ vài dòng text, dùng phím mũi tên lên/xuống để di chuyển con trỏ giữa các dòng; khi con trỏ ở đầu/cuối thì mũi tên lên/xuống vẫn gọi lịch sử prompt. +--- + ### [2026-07-26 20:15] Task: Stabilize client preview (oscillator + FluidSynth server) - **Tóm tắt thay đổi:** Kết luận sau debug: SpessaSynth parser (fromArrayBuffer) không extract được presets từ SF2. Client luôn dùng oscillator (ADSR theo program). Server-side FluidSynth render cho âm thanh chính xác khi Export. Xoá debug logs, clean code. - **Các file ảnh hưởng:** `app/static/js/services/soundfontPlayer.js`, `app/api/v1/plugins.py`, `app/static/js/app.precompiled.js`