fix: enter input fixed

This commit is contained in:
qixinbo
2026-03-19 14:57:42 +08:00
parent cca492cfdb
commit 803f742a64
3 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -1,8 +1,13 @@
import os
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
SQLALCHEMY_DATABASE_URL = "sqlite:///./dataclaw.db"
# Use absolute path to ensure dataclaw.db is created in the backend root directory,
# preventing nested backend/backend/dataclaw.db issues when starting from different cwd.
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DB_PATH = os.path.join(BASE_DIR, "dataclaw.db")
SQLALCHEMY_DATABASE_URL = f"sqlite:///{DB_PATH}"
engine = create_engine(
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
View File
+6 -1
View File
@@ -122,7 +122,12 @@ export function ChatInterface() {
setSlashQuery(null);
};
const handleInputKeyDown = (e: React.KeyboardEvent) => {
const handleInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
// Avoid triggering Enter when using IME (Input Method Editor) for CJK characters
if (e.nativeEvent.isComposing) {
return;
}
if (slashQuery !== null && filteredSlashSkills.length > 0) {
if (e.key === 'ArrowUp') {
e.preventDefault();