fix(web): 整理记录维度按钮不随筛选消失,关键词延时写入不再冲掉刚选的条件

- 维度只在没有可选值又没选时隐藏;只有一个值照常显示,免得选了一个条件后别的按钮跳没。
- 搜索框的延时写 URL 只在关键词真变了时执行:否则它带着旧参数,会把 400ms 内刚点的维度条件冲掉。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-06 18:00:20 +08:00
1 parent 550ac285f4
commit 20e7391b15
2 files changed
+5 -3

No files matched your search

@@ -25,8 +25,8 @@ export function RecordFilterChips({
className="scroll-bleed -mx-1 flex min-w-0 gap-1.5 overflow-x-auto px-1 pb-0.5 [scrollbar-width:none]"
>
{dims
// 只有一个可选值又没选时不用筛(比如只有一个媒体库目录)
.filter((d) => d.options.length > 1 || !!values[d.key])
// 没有可选值又没选时不显示(比如还没有带分类的记录);随筛选变化按钮不跳动,只有一个值也照常显示
.filter((d) => d.options.length > 0 || !!values[d.key])
.map((d) => (
<DimButton key={d.key} dim={d} value={values[d.key] ?? ""} onChange={(x) => onChange(d.key, x)} />
))}