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; }