From 5ff11dce38af1713e72e8ba992cb27a39890486d Mon Sep 17 00:00:00 2001 From: wizardchen Date: Wed, 29 Apr 2026 20:17:06 +0800 Subject: [PATCH] fix(frontend): hide card checkbox when not selecting Card grid showed a faded checkbox at all times after multi-select was added, which felt visually noisy and misaligned the title column. Hide the checkbox column by default and let it expand on hover / when any card is selected / when this card itself is selected. Drop :focus-within so a cleared selection doesn't get stuck visible due to the retained input focus. --- .../src/views/knowledge/KnowledgeBase.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/knowledge/KnowledgeBase.vue b/frontend/src/views/knowledge/KnowledgeBase.vue index 482c712b..8f79bdc9 100644 --- a/frontend/src/views/knowledge/KnowledgeBase.vue +++ b/frontend/src/views/knowledge/KnowledgeBase.vue @@ -3824,20 +3824,23 @@ async function createNewSession(value: string): Promise { cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease; - /* 初始态略可见,悬停/多选/已选时再强调,避免「凭空多一列」的突兀感 */ + /* 默认折叠不占位,悬停/多选/已选时展开,避免非选择态左侧错位 */ .card-nav-check { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; - width: 22px; + width: 0; height: 29px; - opacity: 0.4; - transition: opacity 0.2s ease; + margin-right: 0; + opacity: 0; + overflow: hidden; + transition: width 0.2s ease, margin-right 0.2s ease, opacity 0.2s ease; cursor: pointer; - &.active, - &:focus-within { + &.active { + width: 22px; + margin-right: 8px; opacity: 1; } @@ -3869,6 +3872,8 @@ async function createNewSession(value: string): Promise { &:hover .card-nav-check, &.has-selection .card-nav-check { + width: 22px; + margin-right: 8px; opacity: 1; } @@ -3908,7 +3913,7 @@ async function createNewSession(value: string): Promise { flex-shrink: 0; display: flex; align-items: flex-start; - gap: 8px; + gap: 0; margin-bottom: 8px; } @@ -3926,6 +3931,7 @@ async function createNewSession(value: string): Promise { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; + margin-right: 8px; } .more-wrap {