Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ui/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ <h2 class="m-0 fs-5 fw-semibold">Parameter Configuration</h2>
<aside class="chat-sidebar">
<div class="sidebar-header">
<div class="sidebar-toggle-wrapper">
<div class="sidebar-label">Feature</div>
<div class="sidebar-logo">
<img src="ultrarag.svg" alt="UltraRAG" class="sidebar-logo-img">
</div>
<button type="button" id="sidebar-toggle-btn" class="btn-sidebar-toggle" title="Toggle Sidebar">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="3" x2="9" y2="21"></line></svg>
</button>
Expand Down
18 changes: 16 additions & 2 deletions ui/frontend/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ function renderChatHistory() {
<div class="empty-state-wrapper fade-in-up">
<div class="greeting-section">
<div class="greeting-text">
<span class="greeting-gradient">HelloUltraRAG</span>
<span class="greeting-gradient">Hello, UltraRAG</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -3295,9 +3295,23 @@ function bindEvents() {
if (els.chatSend) els.chatSend.onclick = handleChatSubmit;

// Support Shift+Enter for newline, Enter for submit
// [修复] 添加 IME 输入法组合状态检测,防止中文输入时误触发发送
if (els.chatInput) {
let isComposing = false; // 跟踪是否正在进行 IME 组合输入

// 监听 IME 组合开始事件(拼音输入开始)
els.chatInput.addEventListener('compositionstart', function() {
isComposing = true;
});

// 监听 IME 组合结束事件(拼音输入结束,已选择汉字或确认拼音)
els.chatInput.addEventListener('compositionend', function() {
isComposing = false;
});

els.chatInput.addEventListener('keydown', function(e) {
if (e.key === 'Enter' && !e.shiftKey) {
// 如果正在进行 IME 组合输入,不触发发送
if (e.key === 'Enter' && !e.shiftKey && !isComposing) {
e.preventDefault();
handleChatSubmit(e);
}
Expand Down
61 changes: 40 additions & 21 deletions ui/frontend/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -412,23 +412,23 @@ body {
.sidebar-list {
flex: 1;
overflow-y: auto;
padding: 0 0.8rem;
padding: 0;
}

.sidebar-label {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-secondary);
margin: 1rem 0.5rem 0.5rem;
margin: 1rem 16px 0.5rem 16px; /* 统一左侧 margin 为 16px */
text-transform: uppercase;
}

.sidebar-label-row {
display: flex;
align-items: center;
justify-content: space-between;
/* Align with session items: left same as FEATURE (0.5rem), right same as session delete buttons (16px - 0.8rem) */
padding: 0.8rem 3px 0.5rem 0.5rem;
/* 左侧 20px 对齐标题,右侧 16px 对齐删除按钮 */
padding: 0.8rem 16px 0.5rem 20px;
}

.sidebar-label-row .sidebar-label {
Expand All @@ -450,8 +450,8 @@ body {
opacity: 0.6;
transition: opacity 0.15s, color 0.15s, background 0.15s;
text-align: center;
/* Align with session delete buttons - add right margin to match session item padding */
margin-right: 13px;
/* Align with session delete buttons - no extra margin needed as parent padding handles it */
margin-right: 0;
}

.btn-clear-all:hover {
Expand All @@ -464,7 +464,7 @@ body {

/* Session Item */
.chat-session-item {
padding: 10px 16px 10px 24px;
padding: 10px 16px 10px 24px; /* 左侧缩进 36px (20px + 16px),体现层级 */
font-size: 0.9rem;
color: var(--text-primary);
border-radius: 0;
Expand Down Expand Up @@ -2294,12 +2294,11 @@ body {
font-family: var(--font-sans); /* 恢复 Inter 字体 */
}

/* 统一水平对齐基准:16px */
/* 统一水平对齐基准:20px */
.sidebar-toggle-wrapper,
.sidebar-label,
.btn-nav {
padding-left: 16px !important;
padding-right: 16px !important;
padding-left: 20px !important;
padding-right: 20px !important;
}

/* 1. 顶部样式 */
Expand All @@ -2322,6 +2321,25 @@ body {
margin: 0 !important; /* 顶部 Feature 标签去除额外边距 */
padding: 0 !important; /* [新增] 去除嵌套 padding,防止双倍缩进 */
}

/* Logo 样式 */
.sidebar-logo {
display: flex;
align-items: center;
margin: 0;
padding: 0;
}

.sidebar-logo-img {
height: 20px; /* 与右边的 toggle 按钮图标高度一致 */
width: auto;
object-fit: contain;
}

/* 侧边栏收缩时隐藏 logo */
.chat-sidebar.collapsed .sidebar-logo {
display: none !important;
}

/* [新增] 收缩按钮统一风格 (黑色描边) */
#sidebar-toggle-btn {
Expand All @@ -2341,16 +2359,17 @@ body {
padding: 0;
}

.sidebar-label {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
margin: 1.5rem 0 0.5rem 0;
letter-spacing: 0.05em;
display: flex;
align-items: center;
}
.sidebar-label {
font-size: 0.75rem;
font-weight: 600;
color: var(--text-secondary);
margin: 1rem 20px 0.5rem 20px; /* 统一左侧 margin 为 20px */
text-transform: uppercase;
margin-top: 1.5rem;
letter-spacing: 0.05em;
display: flex;
align-items: center;
}

/* 3. 底部样式 */
.sidebar-footer {
Expand Down
Loading