Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.
C aiderastclaude-codecode-analysiscode-intelligencecodexcursorcypherdeveloper-toolsgemini-cligraph-visualizationkilocodeknowledge-graphmcpmcp-servermodel-context-protocolopencodesqlitetree-sitterwindsurf
fix(ui): keep German answers German and name the Galaxy controls
Bernhard Jackiewicza5f3df209956
diff --git a/graph-ui/src/browser-ai/BrowserChatDock.test.tsx b/graph-ui/src/browser-ai/BrowserChatDock.test.tsxindex 514ba52e9..c8fc84309 100644--- a/graph-ui/src/browser-ai/BrowserChatDock.test.tsx+++ b/graph-ui/src/browser-ai/BrowserChatDock.test.tsx@@ -1024,7 +1024,8 @@ describe('graph answers and answer limits', () => {expect(request.filter(message => message.role === 'user').map(message => message.content.split('\n').at(-1))).toEqual(['Und was noch?']);expect([...container.querySelectorAll('.cbm-chat-topic-break')].map(item => item.textContent)).toEqual(['New topic: JSONBAgg. Earlier messages are not sent with these questions.',- 'New topic: .github/workflows/new_contributor_pr.yml. Earlier messages are not sent with these questions.']);+ // "Und was noch?" is German, so its divider is too (W8).+ 'Neues Thema: .github/workflows/new_contributor_pr.yml. Frühere Nachrichten werden bei diesen Fragen nicht mitgeschickt.']);// Within the returned topic the conversation goes on.await type('Welche Jobs?'); await click('Send ↑');expect(runtime.chat.mock.calls[3][0].filter(message => message.role === 'user').map(message => message.content.split('\n').at(-1))).toEqual(['Und was noch?', 'Welche Jobs?']);@@ -1542,7 +1543,7 @@ describe('general questions, prompts without a question and configuration filesexpect(options).toMatchObject({ maxOutputTokens: 128, generationProfile: 'automatic-explanation' });expect(request.at(-1)!.content).toContain('Describe this class in one short sentence that starts with `JSONBAgg`. Answer in German.');expect(request.at(-1)!.content).toContain('function = "JSONB_AGG"');- expect(answer()).toContain('Ausgewählt: JSONBAgg (Class) in django/contrib/postgres/aggregates/general.py:50-54.');+ expect(answer()).toContain('Ausgewählt: JSONBAgg (Klasse) in django/contrib/postgres/aggregates/general.py:50-54.');expect(answer()).toContain('Eingehend: 23 Beziehungen von 12 Symbolen (CALLS 11, TESTS 11, DEFINES 1).');expect(answer()).toContain('Ausschnitt: 1 Schritt in beide Richtungen');expect(answer()).toContain('JSONBAgg setzt function auf "JSONB_AGG".');@@ -1562,7 +1563,7 @@ describe('general questions, prompts without a question and configuration filesruntime.chat.mockResolvedValueOnce('JSONBAgg gibt eine Liste von Werten zurück.');await render({ ...props, proactiveSelection: jsonbAggEvidence(), readSource: vi.fn(async () => snippet) }); await click('Download & load');await type('was kansnt du mir über den code sagen'); await click('Send ↑');- expect(answer()).toContain('Ausgewählt: JSONBAgg (Class)');+ expect(answer()).toContain('Ausgewählt: JSONBAgg (Klasse)');expect(answer()).not.toContain('gibt eine Liste');expect(answer()).toContain('Der Satz des Modells behauptete etwas, das der Quelltext nicht zeigt (hier: „gibt … zurück“), und wurde weggelassen.');});diff --git a/graph-ui/src/browser-ai/BrowserChatDock.tsx b/graph-ui/src/browser-ai/BrowserChatDock.tsxindex 179756c96..98371ff89 100644--- a/graph-ui/src/browser-ai/BrowserChatDock.tsx+++ b/graph-ui/src/browser-ai/BrowserChatDock.tsx@@ -10,7 +10,7 @@ import { AUTO_INPUT_TOKENS, AUTO_OUTPUT_TOKENS, citedInterpretation, explanationimport { carriedSource, selectionSubject, SYMBOL_SOURCE_LINES, sourceTargetOf, symbolSource, type SymbolSourceReader } from './symbol-source';import { relationshipAnswer, relationshipSuggestion } from './relationship-answer';import { clampTokenLimits, tokenLimitBounds, tokenLimitsFor, useAgentPreferences, type TokenLimits } from './agent-preferences';-import { browserChatText, groundedText, relationshipWords } from './strings';+import { browserChatText, groundedText, relationshipWords, topicText } from './strings';import { isGpuRuntimeFailure, BrowserRuntimeFatalError } from './runtime-fault';import ChatMarkdown from './ChatMarkdown';import AgentSettingsDialog from './AgentSettingsDialog';@@ -882,7 +882,7 @@ export default function BrowserChatDock({ proactiveSelection, selectionScope = "{turns.length === 0 && !(proactive && automatic && selected) && <div className="cbm-chat-empty"><span aria-hidden="true">⌁</span><h3>Ask about the code.</h3><p>{readerContext ? 'The current file is included automatically. Mark code to focus your next message on that exact selection.' : 'Ask a question, or add source and graph context to your next message.'}</p></div>}{turns.map((turn, index) => { const replyWords = relationshipWords[turn.replyLanguage === 'de' ? 'de' : 'en']; return <article className="cbm-chat-turn" key={turn.id}>{turn.topic && index > 0 && turn.topic.key !== turns.slice(0, index).reverse().find(item => item.topic)?.topic?.key- && <p className="cbm-chat-topic-break">{browserChatText.topicBreak(turn.topic.label)}</p>}+ && <p className="cbm-chat-topic-break">{topicText[turn.replyLanguage ?? questionLanguage(turn.prompt)].topicBreak(turn.topic.label)}</p>}<div className="cbm-chat-question"><span className="cbm-chat-speaker">You</span><ChatMarkdown text={turn.prompt} /></div><div className="cbm-chat-answer"><SourceDisclosure>{turn.evidence || turn.attachment || turn.readerContext?.source || turn.context?.length ? <>diff --git a/graph-ui/src/browser-ai/BrowserChatDock.wording.test.tsx b/graph-ui/src/browser-ai/BrowserChatDock.wording.test.tsxindex 7b8ce6ae8..b9204b1b9 100644--- a/graph-ui/src/browser-ai/BrowserChatDock.wording.test.tsx+++ b/graph-ui/src/browser-ai/BrowserChatDock.wording.test.tsx@@ -161,3 +161,19 @@ describe('the note about names the answer was not given (W7)', () => {+ 'The answer is likely made up; do not rely on it.');});});++describe('the topic divider in the language of its turn (W8)', () => {+ it('heads a German question with a German divider and an English one with an English divider', async () => {+ const { props } = fixture();+ const workflow = reader('name: New contributor message', '.github/workflows/new_contributor_pr.yml');+ await render({ ...props, selectionScope: 'django-demo:explore', readerContext: workflow }); await load();+ await ask('Which jobs does it run?');+ await render({ ...props, selectionScope: 'django-demo:galaxy', proactiveSelection: jsonbAggEvidence() });+ await ask('Wer ruft JSONBAgg auf?');+ await render({ ...props, selectionScope: 'django-demo:explore', readerContext: { ...workflow, path: 'tox.ini', source: { ...workflow.source!, id: 'reader-tox', path: 'tox.ini' } } });+ await ask('What is in this file?');+ expect([...container.querySelectorAll('.cbm-chat-topic-break')].map(item => item.textContent)).toEqual([+ 'Neues Thema: JSONBAgg. Frühere Nachrichten werden bei diesen Fragen nicht mitgeschickt.',+ 'New topic: tox.ini. Earlier messages are not sent with these questions.']);+ });+});diff --git a/graph-ui/src/browser-ai/chat-wording.test.ts b/graph-ui/src/browser-ai/chat-wording.test.tsindex a835cb251..b856bcf45 100644--- a/graph-ui/src/browser-ai/chat-wording.test.ts+++ b/graph-ui/src/browser-ai/chat-wording.test.ts@@ -3,7 +3,7 @@ import { prepareExplanationContext, selectionSummary } from './explanation-conteimport { explanationSentence, formatExplanationEvidence, namesNotIn } from './explanation-response';import { jsonbAggEvidence, jsonbAggRenderLimited } from './galaxy-evidence.fixture';import { relationshipAnswer } from './relationship-answer';-import { browserChatText, groundedText } from './strings';+import { browserChatText, groundedText, topicText } from './strings';import { sourceTargetOf, symbolSource } from './symbol-source';/* Wording of the chat texts after the third review of the hand test (2026-10-04, W1 to W10). */@@ -184,3 +184,37 @@ describe('the note about names the answer was not given (W7)', () => {expect(browserChatText.unsupportedNames(names(2))).toBe('Not in the source or graph facts this answer was given: made_up_0, made_up_1. Check these names before relying on them.');});});++describe('German answers in German, with the controls named as the UI shows them (W8)', () => {+ const line = (markdown: string, type: string) => markdown.split('\n').find(item => item.startsWith(`- **${type} (`)) ?? '';++ it('writes the kinds of symbols in German in German answers and leaves English ones as they are', () => {+ expect(selectionSummary(jsonbAggEvidence(), 'de')[0]).toBe('Ausgewählt: JSONBAgg (Klasse) in django/contrib/postgres/aggregates/general.py:50-54.');+ expect(selectionSummary(jsonbAggEvidence())[0]).toBe('Selected: JSONBAgg (Class) in django/contrib/postgres/aggregates/general.py:50-54.');+ const german = relationshipAnswer('Wer ruft JSONBAgg auf?', [jsonbAggEvidence()])!.markdown;+ expect(line(german, 'CALLS')).toContain('(Methode, `tests/postgres_tests/test_aggregates.py`)');+ expect(german).not.toMatch(/\((?:Method|Class|File|Function),/);+ expect(line(relationshipAnswer('Was ruft JSONBAgg auf?', [jsonbAggEvidence()])!.markdown, 'INHERITS')).toContain('(Klasse, `django/contrib/postgres/aggregates/mixins.py`)');+ expect(line(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggEvidence()])!.markdown, 'CALLS')).toContain('(Method, `tests/postgres_tests/test_aggregates.py`)');+ // The prompt stays English.+ expect(formatExplanationEvidence(prepareExplanationContext(undefined, jsonbAggEvidence(), 3200))).toContain('Selected: JSONBAgg (Class) in');+ });++ it('names the Galaxy controls by their labels when a side or a layer is missing', () => {+ expect(relationshipAnswer('Wer ruft JSONBAgg auf?', [jsonbAggEvidence({ direction: 'outbound' })])!.markdown)+ .toContain('Der aktuelle Ausschnitt folgt keinen eingehenden Beziehungen. Wähle in Galaxy „Incoming“ oder „Both directions“ und frage dann noch einmal.');+ expect(relationshipAnswer('Was ruft JSONBAgg auf?', [jsonbAggEvidence({ direction: 'inbound' })])!.markdown)+ .toContain('Wähle in Galaxy „Outgoing“ oder „Both directions“ und frage dann noch einmal.');+ expect(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggEvidence({ direction: 'outbound' })])!.markdown)+ .toContain('The current scope does not follow incoming relationships. Choose "Incoming" or "Both directions" in Galaxy, then ask again.');+ expect(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggEvidence({ depth: 0 })])!.markdown)+ .toContain('The current scope shows the selection only. Click "Expand +1" in Galaxy, then ask again.');+ expect(relationshipAnswer('Wer ruft JSONBAgg auf?', [jsonbAggEvidence({ depth: 0 })])!.markdown)+ .toContain('Der aktuelle Ausschnitt zeigt nur die Auswahl. Klicke in Galaxy auf „Expand +1“ und frage dann noch einmal.');+ });++ it('has the topic divider in both languages', () => {+ expect(topicText.en.topicBreak('tox.ini')).toBe('New topic: tox.ini. Earlier messages are not sent with these questions.');+ expect(topicText.de.topicBreak('tox.ini')).toBe('Neues Thema: tox.ini. Frühere Nachrichten werden bei diesen Fragen nicht mitgeschickt.');+ });+});diff --git a/graph-ui/src/browser-ai/galaxy-evidence.ts b/graph-ui/src/browser-ai/galaxy-evidence.tsindex 055bc2ee1..e252eae18 100644--- a/graph-ui/src/browser-ai/galaxy-evidence.ts+++ b/graph-ui/src/browser-ai/galaxy-evidence.ts@@ -116,7 +116,8 @@ export function relationshipLine(group: RelationshipGroup, _side: 'incoming' | 'if (head.length + more(0).length > budget) return { text: '', listed: 0 };for (const file of group.files) {const kinds = new Set(file.symbols.map(symbol => symbol.kind));- const where = [kinds.size === 1 ? file.symbols[0].kind : undefined, file.path ? quote(file.path) : undefined].filter(Boolean).join(', ');+ const kind = kinds.size === 1 ? file.symbols[0].kind : undefined;+ const where = [kind ? words.kindName(kind) : undefined, file.path ? quote(file.path) : undefined].filter(Boolean).join(', ');const suffix = where ? ` (${where})` : '';let chunk = '';for (const symbol of file.symbols) {@@ -155,11 +156,13 @@ export function selectionSentence(evidence: GalaxyEvidence, words: RelationshipWconst [first] = evidence.roots;const range = (root: GalaxyEvidence['roots'][number]) => root.filePath? ` in ${root.filePath}${root.startLine ? `:${root.startLine}${root.endLine && root.endLine !== root.startLine ? `-${root.endLine}` : ''}` : ''}` : '';+ // Kinds in the words of the answer: "(Klasse)" in a German one (W8).+ const kind = (root: GalaxyEvidence['roots'][number]) => root.kind ? ` (${words.kindName(root.kind)})` : '';if (evidence.rootCount <= 1 && first) {- return [words.selected(`${first.name}${first.kind ? ` (${first.kind})` : ''}${range(first)}`),+ return [words.selected(`${first.name}${kind(first)}${range(first)}`),...first.documentation ? [words.documentation(first.documentation)] : []];}- if (!first) return [words.notInScope(evidence.label, evidence.selectionKind)];- const listed = evidence.roots.map(root => `${root.name}${root.kind ? ` (${root.kind})` : ''}`).join(', ');- return [words.selectedGroup(evidence.selectionKind, evidence.label, evidence.rootCount, listed, evidence.rootCount - evidence.roots.length)];+ if (!first) return [words.notInScope(evidence.label, words.kindName(evidence.selectionKind))];+ const listed = evidence.roots.map(root => `${root.name}${kind(root)}`).join(', ');+ return [words.selectedGroup(words.kindName(evidence.selectionKind), evidence.label, evidence.rootCount, listed, evidence.rootCount - evidence.roots.length)];}diff --git a/graph-ui/src/browser-ai/grounded-explanation.test.ts b/graph-ui/src/browser-ai/grounded-explanation.test.tsindex 910d5a434..0ffc76102 100644--- a/graph-ui/src/browser-ai/grounded-explanation.test.ts+++ b/graph-ui/src/browser-ai/grounded-explanation.test.ts@@ -137,7 +137,7 @@ describe('the selected symbol source in a Galaxy explanation (K14)', () => {it('summarizes the selection in German for a German question (C5)', () => {expect(selectionSummary(jsonbAggEvidence(), 'de')).toEqual([- 'Ausgewählt: JSONBAgg (Class) in django/contrib/postgres/aggregates/general.py:50-54.',+ 'Ausgewählt: JSONBAgg (Klasse) in django/contrib/postgres/aggregates/general.py:50-54.','Eingehend: 23 Beziehungen von 12 Symbolen (CALLS 11, TESTS 11, DEFINES 1).','Ausgehend: 2 Beziehungen zu 2 Symbolen (INHERITS 2).','Ausschnitt: 1 Schritt in beide Richtungen, alle Beziehungstypen; 15 Symbole und 25 Beziehungen; vollständig geladen.',diff --git a/graph-ui/src/browser-ai/relationship-answer.test.ts b/graph-ui/src/browser-ai/relationship-answer.test.tsindex 22aeeef75..80fb9d427 100644--- a/graph-ui/src/browser-ai/relationship-answer.test.ts+++ b/graph-ui/src/browser-ai/relationship-answer.test.ts@@ -109,7 +109,7 @@ describe('listed relationship answers', () => {it('never reports "no callers" for a side the scope did not load or while it is still loading', () => {expect(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggEvidence({ direction: 'outbound' })])!.markdown).toContain('does not follow incoming relationships');- expect(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggEvidence({ depth: 0 })])!.markdown).toContain('Expand it by one layer');+ expect(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggEvidence({ depth: 0 })])!.markdown).toContain('Click "Expand +1" in Galaxy');expect(relationshipAnswer('Who calls JSONBAgg?', [jsonbAggEvidence({ state: 'loading-partial-preview' })])!.markdown).toContain('still loading; this list can grow');});diff --git a/graph-ui/src/browser-ai/strings.ts b/graph-ui/src/browser-ai/strings.tsindex 955007a3f..a2790f299 100644--- a/graph-ui/src/browser-ai/strings.ts+++ b/graph-ui/src/browser-ai/strings.ts@@ -38,6 +38,16 @@ export const browserAiText = {* written as the language writes them: 5,548 and 5.548 (C1). */const en = (value: number) => value.toLocaleString('en-US');const de = (value: number) => value.toLocaleString('de-DE');+/** Node kinds of the index in German: the noun, its plural and its gender (W8, W9). */+const GERMAN_KINDS: Readonly<Record<string, readonly [string, string, 'f' | 'm' | 'n']>> = {+ project: ['Projekt', 'Projekte', 'n'], package: ['Paket', 'Pakete', 'n'], folder: ['Ordner', 'Ordner', 'm'], file: ['Datei', 'Dateien', 'f'],+ module: ['Modul', 'Module', 'n'], class: ['Klasse', 'Klassen', 'f'], function: ['Funktion', 'Funktionen', 'f'], method: ['Methode', 'Methoden', 'f'],+ interface: ['Schnittstelle', 'Schnittstellen', 'f'], enum: ['Aufzählung', 'Aufzählungen', 'f'], type: ['Typ', 'Typen', 'm'], variable: ['Variable', 'Variablen', 'f'],+ route: ['Route', 'Routen', 'f'], resource: ['Ressource', 'Ressourcen', 'f'], section: ['Abschnitt', 'Abschnitte', 'm'], field: ['Feld', 'Felder', 'n'],+ struct: ['Struktur', 'Strukturen', 'f'], trait: ['Trait', 'Traits', 'm'], macro: ['Makro', 'Makros', 'n'], constant: ['Konstante', 'Konstanten', 'f'],+ namespace: ['Namensraum', 'Namensräume', 'm'], property: ['Eigenschaft', 'Eigenschaften', 'f'], decorator: ['Dekorator', 'Dekoratoren', 'm'],+ test: ['Test', 'Tests', 'm'], channel: ['Kanal', 'Kanäle', 'm'], node: ['Knoten', 'Knoten', 'm'], symbol: ['Symbol', 'Symbole', 'n'],+};const englishRelationshipWords = {more: (count: number) => `+${en(count)} more`,hops: (depth: number) => depth === 0 ? 'the selection only' : depth === 1 ? '1 hop' : `${depth} hops`,@@ -56,6 +66,8 @@ const englishRelationshipWords = {+ `the render limit of ${en(limit)} ${kind}; the scene draws at most ${en(limit)} ${kind}, `+ (layer > 1 ? 'so counts and names further out can be incomplete' : 'so counts and names can be incomplete, the direct relationships included'),exhausted: 'nothing further beyond this depth',+ /** A node kind as the answer's language writes it: "Class", "Klasse" (W8). */+ kindName: (kind: string) => kind,scope: (shape: string, size: string, state: string) => `Scope: ${shape}; ${size}; ${state}.`,/** Each number with its unit: "Incoming: 23 relationships from 12 symbols", never "23 from 12", which reads like a score (W2). */incoming: (total: number, symbols?: number) => `Incoming: ${en(total)} ${total === 1 ? 'relationship' : 'relationships'}`@@ -95,10 +107,11 @@ const englishRelationshipWords = {noCalls: (name: string, side: 'incoming' | 'outgoing') => side === 'incoming'? `No CALLS edge reaches ${name} in this scope.` : `${name} has no outgoing CALLS edge in this scope.`,otherRelationships: (side: 'incoming' | 'outgoing') => `Other ${side} relationships:`,+ /** The Galaxy controls as the UI labels them: the direction select and Expand +1 (W8). */notLoaded: (side: 'incoming' | 'outgoing'): string => side === 'incoming'- ? 'The current scope does not follow incoming relationships. Trace incoming or both directions, then ask again.'- : 'The current scope does not follow outgoing relationships. Trace outgoing or both directions, then ask again.',- notExpanded: 'The current scope shows the selection only. Expand it by one layer, then ask again.',+ ? 'The current scope does not follow incoming relationships. Choose "Incoming" or "Both directions" in Galaxy, then ask again.'+ : 'The current scope does not follow outgoing relationships. Choose "Outgoing" or "Both directions" in Galaxy, then ask again.',+ notExpanded: 'The current scope shows the selection only. Click "Expand +1" in Galaxy, then ask again.',stillLoading: 'The scope is still loading; this list can grow.',listedFromGraph: 'Listed from the indexed graph; not generated by the model.',didYouMean: (side: 'incoming' | 'outgoing', name: string) => side === 'incoming' ? `Did you mean: callers of ${name}?` : `Did you mean: what ${name} calls?`,@@ -130,6 +143,7 @@ export const relationshipWords: { en: RelationshipWords; de: RelationshipWords }+ (layer > 1 ? 'daher können Anzahlen und Namen weiter außen fehlen' : 'daher können Anzahlen und Namen fehlen, auch bei den direkten Beziehungen');},exhausted: 'dahinter folgt nichts mehr',+ kindName: (kind: string) => GERMAN_KINDS[kind.toLowerCase()]?.[0] ?? kind,scope: (shape: string, size: string, state: string) => `Ausschnitt: ${shape}; ${size}; ${state}.`,incoming: (total: number, symbols?: number) => `Eingehend: ${de(total)} ${total === 1 ? 'Beziehung' : 'Beziehungen'}`+ `${symbols === undefined ? '' : ` von ${de(symbols)} ${symbols === 1 ? 'Symbol' : 'Symbolen'}`}.`,@@ -146,7 +160,7 @@ export const relationshipWords: { en: RelationshipWords; de: RelationshipWords }beyond: (summary: string) => `Weiter außen im Ausschnitt: ${summary}.`,selected: (what: string) => `Ausgewählt: ${what}.`,documentation: (text: string) => `Dokumentation: ${text}`,- notInScope: (label: string, kind: string) => `Ausgewählt: ${label} (${kind}); seine Symbole sind nicht im geladenen Ausschnitt.`,+ notInScope: (label: string, kind: string) => `Ausgewählt: ${label} (${kind}); die Symbole der Auswahl sind nicht im geladenen Ausschnitt.`,selectedGroup: (kind: string, label: string, count: number, listed: string, omitted: number) =>`Ausgewählt (${kind}): ${label} mit ${de(count)} Symbolen: ${listed}${omitted > 0 ? `; +${de(omitted)} weitere` : ''}.`,callers: (name: string, count: number) => `${de(count)} Aufrufer (CALLS) von ${name} im geladenen Graphen.`,@@ -169,9 +183,9 @@ export const relationshipWords: { en: RelationshipWords; de: RelationshipWords }/** "Andere": the types other than CALLS, also where no CALLS edge exists (W3). */otherRelationships: (side: 'incoming' | 'outgoing') => `Andere ${side === 'incoming' ? 'eingehende' : 'ausgehende'} Beziehungen:`,notLoaded: (side: 'incoming' | 'outgoing') => side === 'incoming'- ? 'Der aktuelle Ausschnitt folgt keinen eingehenden Beziehungen. Verfolge eingehend oder beide Richtungen und frage noch einmal.'- : 'Der aktuelle Ausschnitt folgt keinen ausgehenden Beziehungen. Verfolge ausgehend oder beide Richtungen und frage noch einmal.',- notExpanded: 'Der aktuelle Ausschnitt zeigt nur die Auswahl. Erweitere ihn um eine Ebene und frage noch einmal.',+ ? 'Der aktuelle Ausschnitt folgt keinen eingehenden Beziehungen. Wähle in Galaxy „Incoming“ oder „Both directions“ und frage dann noch einmal.'+ : 'Der aktuelle Ausschnitt folgt keinen ausgehenden Beziehungen. Wähle in Galaxy „Outgoing“ oder „Both directions“ und frage dann noch einmal.',+ notExpanded: 'Der aktuelle Ausschnitt zeigt nur die Auswahl. Klicke in Galaxy auf „Expand +1“ und frage dann noch einmal.',stillLoading: 'Der Ausschnitt lädt noch; die Liste kann wachsen.',listedFromGraph: 'Aus dem indizierten Graphen gelistet, nicht vom Modell erzeugt.',didYouMean: (side: 'incoming' | 'outgoing', name: string) => side === 'incoming' ? `Meintest du: Aufrufer von ${name}?` : `Meintest du: von ${name} aufgerufene Symbole?`,@@ -236,7 +250,7 @@ export const browserChatText = {+ ' and was left out.',writingSentence: 'Reading the source; the model is adding one sentence…',readingFacts: 'Listing the facts…',- /** Above the first question about another file or selection (K17). */+ /** Above the first question about another file or selection (K17); topicText has it in both languages (W8). */topicBreak: (label: string) => `New topic: ${label}. Earlier messages are not sent with these questions.`,capacity: (nodes: number, edges: number, model: string, shown: number) =>`${nodes} nodes / ${edges} edges: too large for the local ${model} model; showing ${shown}`,@@ -250,6 +264,12 @@ export const browserChatText = {limitsNote: (input: number, output: number) => `Stored in this browser for each model. Automatic explanations use at most ${input.toLocaleString('en-US')} input and ${output.toLocaleString('en-US')} output tokens.`,};+/** The divider above the first question about another file or selection, in the language of that question (K17, W8). */+export const topicText = {+ en: { topicBreak: browserChatText.topicBreak },+ de: { topicBreak: (label: string) => `Neues Thema: ${label}. Frühere Nachrichten werden bei diesen Fragen nicht mitgeschickt.` },+};+/** Who wrote which part of the answer to a general question about a selection, in its language (C5). */export const groundedText = {en: { factsAndSentence: browserChatText.factsAndSentence, factsOnly: browserChatText.factsOnly, sentenceDropped: browserChatText.sentenceDropped,diff --git a/graph-ui/tools/handtest-fixes-chat.mjs b/graph-ui/tools/handtest-fixes-chat.mjsindex 152b17d0a..da5bdfb42 100644--- a/graph-ui/tools/handtest-fixes-chat.mjs+++ b/graph-ui/tools/handtest-fixes-chat.mjs@@ -393,7 +393,7 @@ async function k17(page) {const [back] = await sentSince(page, mark);const backText = promptText(back);const divider = await page.locator('.cbm-chat-topic-break').allInnerTexts();- await shot(page, 'K17', 'explore-return', 'Back in Explore on the same file: a divider "New topic: .github/workflows/new_contributor_pr.yml"; the earlier answer is not in the prompt.');+ await shot(page, 'K17', 'explore-return', 'Back in Explore on the same file: a German divider "Neues Thema: .github/workflows/new_contributor_pr.yml" above the German question; the earlier answer is not in the prompt.');const dividerBox = await page.locator('.cbm-chat-topic-break').last().boundingBox();if (dividerBox) await shot(page, 'K17', 'explore-return-crop', 'Crop of the divider above the returned question.', { clip: { x: dividerBox.x - 8, y: Math.max(0, dividerBox.y - 8), width: dividerBox.width + 16, height: 220 } });const backAssistant = (back?.messages ?? []).filter((message) => message.role === 'assistant').length;@@ -401,7 +401,7 @@ async function k17(page) {check('K17', 'Earlier answers about another file are not resent, also not on the way back; topic breaks and New conversation visible', Boolean(request) && !/Welche Aktion nutzt dieses aktuelle File/.test(text)&& !text.includes(exploreAnswer.slice(-60).trim()) && assistantTurns === 0 && /New conversation/.test(header) && divider.some((item) => /New topic: JSONBAgg/.test(item))&& Boolean(back) && backAssistant === 0 && !/Welche Aktion nutzt dieses aktuelle File/.test(backText) && !backText.includes(exploreAnswer.slice(-60).trim())- && JSON.stringify(backUsers) === JSON.stringify(['Und was noch?']) && divider.some((item) => /New topic: \.github\/workflows\/new_contributor_pr\.yml\. Earlier messages are not sent/.test(item)),+ && JSON.stringify(backUsers) === JSON.stringify(['Und was noch?']) && divider.some((item) => /Neues Thema: \.github\/workflows\/new_contributor_pr\.yml\. Frühere Nachrichten werden bei diesen Fragen nicht mitgeschickt/.test(item)),{ assistantMessagesInPrompt: assistantTurns, flake8InPrompt: /flake8/i.test(text), exploreQuestionInPrompt: /aktuelle File/.test(text), header, divider, exploreAnswer: exploreAnswer.slice(0, 200), galaxyAnswer: galaxyAnswer.slice(0, 200),returnPrompt: { assistantMessages: backAssistant, userMessages: backUsers, earlierExploreAnswerInPrompt: backText.includes(exploreAnswer.slice(-60).trim()) }, returnAnswer: returnAnswer.slice(0, 200) });await save('K17', 'prompt-galaxy.txt', text);