Revert "fix(ui): improve narration suppression and reduce flicker (#2… (#24857)

This commit is contained in:
Christian Gunderman
2026-04-07 22:45:40 +00:00
committed by GitHub
parent 3c5b5db034
commit f96d5f98fe
2 changed files with 9 additions and 192 deletions

View File

@@ -91,47 +91,20 @@ export const MainContent = () => {
const flags = new Array<boolean>(combinedHistory.length).fill(false);
if (topicUpdateNarrationEnabled) {
let turnIsIntermediate = false;
let hasTopicToolInTurn = false;
let toolGroupInTurn = false;
for (let i = combinedHistory.length - 1; i >= 0; i--) {
const item = combinedHistory[i];
if (item.type === 'user' || item.type === 'user_shell') {
turnIsIntermediate = false;
hasTopicToolInTurn = false;
toolGroupInTurn = false;
} else if (item.type === 'tool_group') {
const hasTopic = item.tools.some((t) => isTopicTool(t.name));
const hasNonTopic = item.tools.some((t) => !isTopicTool(t.name));
if (hasTopic) {
hasTopicToolInTurn = true;
}
if (hasNonTopic) {
turnIsIntermediate = true;
}
toolGroupInTurn = item.tools.some((t) => isTopicTool(t.name));
} else if (
item.type === 'thinking' ||
item.type === 'gemini' ||
item.type === 'gemini_content'
(item.type === 'thinking' ||
item.type === 'gemini' ||
item.type === 'gemini_content') &&
toolGroupInTurn
) {
// Rule 1: Always suppress thinking when narration is enabled to avoid
// "flashing" as the model starts its response, and because the Topic
// UI provides the necessary high-level intent.
if (item.type === 'thinking') {
flags[i] = true;
continue;
}
// Rule 2: Suppress text in intermediate turns (turns containing non-topic
// tools) to hide mechanical narration.
if (turnIsIntermediate) {
flags[i] = true;
}
// Rule 3: Suppress text that precedes a topic tool in the same turn,
// as the topic tool "replaces" it.
if (hasTopicToolInTurn) {
flags[i] = true;
}
flags[i] = true;
}
}
}