From 71825201a217e89716b464b837e9c63f13939308 Mon Sep 17 00:00:00 2001 From: Muse Date: Sat, 14 Nov 2026 16:19:52 +0800 Subject: [PATCH] =?UTF-8?q?style(sidebar):=20=E5=B7=A5=E4=BD=9C=E5=8C=BA?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=B8=83=E5=B1=80=E2=80=94=E2=80=94=E5=AE=9E?= =?UTF-8?q?=E5=BF=83=E6=90=9C=E7=B4=A2=E6=8C=89=E9=92=AE=E6=94=B9=E6=8F=8F?= =?UTF-8?q?=E8=BE=B9=E5=9B=BE=E6=A0=87=E9=92=AE=EF=BC=88=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E4=B8=AD=E8=BD=AC=E5=9C=88=EF=BC=89=EF=BC=8C=E5=8E=9F=E7=94=9F?= =?UTF-8?q?=E5=A4=8D=E9=80=89=E6=A1=86=E6=94=B9=E8=83=B6=E5=9B=8A=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Sidebar.tsx | 27 +++++++++++++++++++++------ src/styles.css | 12 ++++++++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 55d1e9a..b99bc82 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -244,14 +244,29 @@ function WorkspaceSearch({ root, tauriMode, onOpen }: { onChange={(e) => setQuery(e.target.value)} onKeyDown={(e) => { if (e.key === 'Enter') void run() }} /> - + +
+
- {error &&
{error}
} {results && (
{results.length === 0 ? '没有找到匹配。' : `${results.length} 个文件 · ${total} 处匹配`}
diff --git a/src/styles.css b/src/styles.css index b1ad7d1..25d48f5 100644 --- a/src/styles.css +++ b/src/styles.css @@ -333,7 +333,16 @@ kbd { background: var(--code-bg); border: 1px solid var(--border); border-radius .modal-actions.left { align-items: stretch; } .modal-actions.left button { text-align: left; } .ws-search { display: flex; flex-direction: column; gap: 8px; padding: 10px; min-height: 0; } -.ws-search-box { display: flex; gap: 6px; } +.ws-search-box { display: flex; gap: 6px; align-items: stretch; } +.ws-search-go { flex: none; width: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--bg); color: var(--text-dim); border-radius: 6px; cursor: pointer; padding: 0; } +.ws-search-go:hover:not(:disabled) { color: var(--text); border-color: var(--accent); background: var(--hover); } +.ws-search-go:disabled { opacity: 0.45; cursor: default; } +.ws-spin { width: 13px; height: 13px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: ws-spin 0.7s linear infinite; } +@keyframes ws-spin { to { transform: rotate(360deg); } } +.ws-search-opts { display: flex; gap: 6px; } +.chip-toggle { font-size: 12px; font-family: inherit; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); cursor: pointer; } +.chip-toggle:hover { color: var(--text); background: var(--hover); } +.chip-toggle.on { background: var(--accent-weak); color: var(--text); border-color: transparent; } /* 自绘下拉(Dropdown 组件):按钮对齐 .input,展开层沿用应用菜单语言 */ .dropdown { position: relative; } .dropdown-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 6px; padding: 5px 9px; font-size: 13px; font-family: inherit; cursor: pointer; text-align: left; } @@ -346,7 +355,6 @@ kbd { background: var(--code-bg); border: 1px solid var(--border); border-radius .dropdown-menu button:hover, .dropdown-menu button:focus-visible { background: var(--hover); outline: none; } .dropdown-menu button.selected { background: var(--accent-weak); } .ws-search-box .input { flex: 1; min-width: 0; } -.ws-search-case { font-size: 12px; color: var(--text-dim); display: flex; gap: 5px; align-items: center; } .ws-search-summary { font-size: 12px; color: var(--text-dim); } .ws-search-results { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; } .ws-search-name { font-weight: 600; font-size: 12.5px; margin-bottom: 3px; }