Studio: post-merge build fixes — drop dead score handling, dedupe activeThreadId, add knowledgeBases i18n key

Follow-ups after merging origin/main into feature/rag:

* chat-adapter.ts: drop `score` field from DocumentSourcePart and the
  `chunk.score` copy — the remote "hide RAG retrieval scores from chunks,
  citations, and side panel" commit removed `score` from ParsedChunk.
* chat-settings-sheet.tsx: remove the duplicate `const activeThreadId =`
  introduced by the merge (kept the HEAD-side declaration at line 497).
* chat-settings-sheet.tsx: drop the "Min relevance" Slider that referenced
  `ragMinScore` / `setRagMinScore` — same intent as the hide-scores commit
  (these are still on the runtime store but the side-panel UI is gone).
* i18n locales (en, zh-CN): add `settings.tabs.knowledgeBases` translation
  key so the new TabDef entry passes the TranslationKey union check.

Verified: `tsc --noEmit` clean, `vite build` succeeds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Etherll 2026-05-28 05:20:22 +03:00
commit 79fc69741c
4 changed files with 2 additions and 29 deletions

View file

@ -401,7 +401,6 @@ interface DocumentSourcePart {
pageCharEnd?: string;
lineStart?: string;
lineEnd?: string;
score?: string;
text: string;
}
@ -477,9 +476,6 @@ function toDocumentSourcePart(
if (chunk.lineEnd) {
part.lineEnd = chunk.lineEnd;
}
if (chunk.score) {
part.score = chunk.score;
}
return part;
}

View file

@ -712,7 +712,6 @@ export function ChatSettingsPanel({
activeExternalProvider.providerType,
externalSelection?.modelId,
);
const activeThreadId = useChatRuntimeStore((s) => s.activeThreadId);
const openAiApiKeyForSection = activeExternalProvider
? getExternalProviderApiKey(activeExternalProvider.id) || null
: null;
@ -1658,30 +1657,6 @@ export function ChatSettingsPanel({
grounding, more tokens.
</p>
</div>
<div className="flex flex-col gap-1.5">
<div className="flex items-center justify-between">
<label className="text-[12px] font-medium text-muted-foreground">
Min relevance
</label>
<span className="text-[12px] tabular-nums text-muted-foreground">
{ragMinScore === 0 ? "off" : ragMinScore.toFixed(2)}
</span>
</div>
<Slider
value={[ragMinScore]}
min={0}
max={1}
step={0.05}
onValueChange={([v]) => v != null && setRagMinScore(v)}
disabled={!ragEnabled}
/>
<p className="text-[11px] text-muted-foreground">
Cosine-similarity floor for retrieved chunks (0 = off). Set
above 0 so unrelated docs are dropped useful when your
query is off-topic from what's indexed. Try 0.3 as a
starting point.
</p>
</div>
<div className="flex items-center justify-between">
<div className="flex flex-col">
<span className="text-[13px] font-medium">

View file

@ -89,6 +89,7 @@ export const en = {
profile: "Profile",
appearance: "Appearance",
chat: "Chat",
knowledgeBases: "Knowledge Bases",
connections: "Connections",
apiKeys: "API",
about: "Help",

View file

@ -89,6 +89,7 @@ export const zhCN = {
profile: "个人资料",
appearance: "外观",
chat: "聊天",
knowledgeBases: "知识库",
connections: "连接",
apiKeys: "API",
about: "帮助",