diff --git a/apps/web/app/components/organize/record-filters.tsx b/apps/web/app/components/organize/record-filters.tsx index 726a9c0c..992c3966 100644 --- a/apps/web/app/components/organize/record-filters.tsx +++ b/apps/web/app/components/organize/record-filters.tsx @@ -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) => ( onChange(d.key, x)} /> ))} diff --git a/apps/web/app/routes/console/organize.tsx b/apps/web/app/routes/console/organize.tsx index 126c140c..4eda2afd 100644 --- a/apps/web/app/routes/console/organize.tsx +++ b/apps/web/app/routes/console/organize.tsx @@ -386,10 +386,12 @@ export default function OrganizePage() { const byIds = useFileRecords({ ids }, ids.length > 0); const navigate = useNavigate(); const qc = useQueryClient(); + // 只在关键词真变了时写 URL:否则这次延时写入会带着旧的查询参数,把刚点的维度条件冲掉 useEffect(() => { + if (qInput.trim() === v.q) return; const t = setTimeout(() => setFilter("q", qInput.trim()), 400); return () => clearTimeout(t); - }, [qInput, setFilter]); + }, [qInput, v.q, setFilter]); // 时间筛选换成具体时刻只在切换时算一次,避免每次渲染查询键都变 const since = useMemo(() => sinceOf(v.time), [v.time]); const base: Omit = {