fix(rag,desktop): Milvus 集合丢失自愈 + 检索框布局塌陷
真实演示中暴露的两个 bug: 1) Milvus 重连健壮性(mcp-go/internal/rag/milvus.go) 基础设施重启后向量集合丢失,但 ensure() 的 m.ok 缓存认定集合仍在、跳过重建, 导致 insert/search 报 "collection not found",必须重启进程才恢复。 修复:新增 invalidate() + isCollectionGone();insert/search 遇"集合不存在"类错误 时清缓存 + 重 ensure(重建集合)+ 重试一次。 实测:运行期 drop 集合后再入库 → 日志"清缓存重建后重试写入" → 写入成功且可检索(自愈,无需重启)。 2) 检索框布局塌陷(desktop frontend/src/ui/Input.tsx) Phase A 给 Input 基类内置了 w-full,与检索行调用方的 flex-1 / w-16 冲突, 查询框被挤成一条缝。修复:基类去掉 w-full,宽度交由调用方(Field 内 flex-col 自动撑满, 或显式 w-full/flex-1/w-16)。 实测(Preview):查询框 412px、topK 64px;报告页输入仍撑满(764/220px),无回归。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import type { InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes, ReactNode } from "react";
|
||||
import { cn } from "./cn";
|
||||
|
||||
// 注意:基类不含宽度。宽度由调用方决定(Field 内为 flex-col 自动撑满,
|
||||
// 或显式 w-full / flex-1 / w-16),避免 w-full 与 flex-1/w-16 冲突塌陷。
|
||||
const fieldBase =
|
||||
"w-full rounded-md border border-line bg-ink-950 text-sm text-slate-200 placeholder:text-slate-600 transition focus:border-brand focus:outline-none focus:ring-1 focus:ring-brand/40 disabled:opacity-50";
|
||||
"rounded-md border border-line bg-ink-950 text-sm text-slate-200 placeholder:text-slate-600 transition focus:border-brand focus:outline-none focus:ring-1 focus:ring-brand/40 disabled:opacity-50";
|
||||
|
||||
export function Input({ className, ...rest }: InputHTMLAttributes<HTMLInputElement>) {
|
||||
return <input className={cn(fieldBase, "h-9 px-3", className)} {...rest} />;
|
||||
|
||||
Reference in New Issue
Block a user