Skip to content

fix(ui): improve narration suppression and reduce flicker#24635

Merged
gundermanc merged 5 commits intomainfrom
gundermanc/topics-fit-n-finish
Apr 6, 2026
Merged

fix(ui): improve narration suppression and reduce flicker#24635
gundermanc merged 5 commits intomainfrom
gundermanc/topics-fit-n-finish

Conversation

@gundermanc
Copy link
Copy Markdown
Member

Summary

Improved the narration suppression logic in MainContent.tsx to resolve visual "flashing" and redundant "answering twice" issues when the Topics UX is enabled.

Details

  • Always suppress thinking: Thoughts stream in before tools. By hiding them immediately when narration is enabled, we prevent the flash that occurs before the first topic update arrives.
  • Suppress intermediate turns: Any turn containing functional (non-topic) tool calls is now fully suppressed to hide mechanical narration ("I will now search...").
  • Topic precedence: Text that precedes an update_topic tool call in the same turn is suppressed, as the Topic UI serves as a cleaner narrative alternative.
  • Final answer preservation: The logic ensures the final markdown response remains visible.
  • Unblock Build: Reverted a pre-existing breaking change in TableRenderer.tsx where StyledLine was missing from the ink dependency, and updated snapshots accordingly.

Related Issues

Related to internal topic UX polish.

How to Validate

  1. Enable experimental.topicUpdateNarration in settings.json.
  2. Interact with the agent (e.g., ask it to search for something).
  3. Observe that thoughts and "I will now..." text no longer flash or appear redundantly.
  4. Run npm test -w @google/gemini-cli -- src/ui/components/MainContent.test.tsx to verify suppression rules.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gundermanc gundermanc requested a review from a team as a code owner April 3, 2026 20:29
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the user interface experience by refining how the agent narrates its actions. By suppressing redundant thinking and intermediate tool-related text, the UI becomes cleaner and less prone to visual flashing. Additionally, this PR addresses a regression in the table rendering component to ensure stability.

Highlights

  • Narration Suppression: Implemented refined logic in MainContent.tsx to suppress thinking blocks and intermediate turns when narration is enabled, reducing visual flicker and redundant output.
  • Topic Precedence: Added rules to suppress narrative text preceding topic tool calls, ensuring the Topic UI remains the primary narrative source.
  • Table Rendering Fix: Reverted a breaking change in TableRenderer.tsx by removing the dependency on StyledLine and updating internal logic to use StyledChar arrays, accompanied by updated test snapshots.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces narration suppression logic to the MainContent component, hiding mechanical model narration and thinking states when experimental topic updates are active. Additionally, the TableRenderer was refactored to utilize StyledChar arrays for improved styling accuracy, and a vertical margin was added to table outputs. Review feedback highlighted an opportunity to improve maintainability by replacing a hardcoded margin value with a named constant and suggested that leaf components should generally remain flush to let parent layouts control spacing.


return (
<Box flexDirection="column">
<Box flexDirection="column" marginY={1}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The addition of a hardcoded margin value introduces magic numbers which hinder maintainability. Please replace this with a named constant. Additionally, avoid hardcoded vertical margins in leaf components; keep them flush and let the parent layout manage spacing to ensure consistency.

Suggested change
<Box flexDirection="column" marginY={1}>
<Box flexDirection="column" marginTop={TABLE_MARGIN_VERTICAL} marginBottom={TABLE_MARGIN_VERTICAL}>
References
  1. Magic numbers, especially those used for layout or padding, should be replaced with named constants to improve readability and maintainability.

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Apr 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

Size Change: +521 B (0%)

Total Size: 34 MB

Filename Size Change
./bundle/chunk-DJ3KCY7M.js 0 B -14.8 MB (removed) 🏆
./bundle/chunk-I64H5SQM.js 0 B -3.15 MB (removed) 🏆
./bundle/core-5QYYRYFK.js 0 B -45.2 kB (removed) 🏆
./bundle/devtoolsService-I5PFXSEG.js 0 B -28.4 kB (removed) 🏆
./bundle/interactiveCli-RGAWM3SE.js 0 B -1.64 MB (removed) 🏆
./bundle/oauth2-provider-5PSMK5YW.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-T3GLZDSV.js 14.8 MB +14.8 MB (new file) 🆕
./bundle/chunk-Z6X77QDX.js 3.15 MB +3.15 MB (new file) 🆕
./bundle/core-CAJQ4GPF.js 45.2 kB +45.2 kB (new file) 🆕
./bundle/devtoolsService-VF5PVGXF.js 28.4 kB +28.4 kB (new file) 🆕
./bundle/interactiveCli-MV3ZXT5M.js 1.64 MB +1.64 MB (new file) 🆕
./bundle/oauth2-provider-OQCMIA5K.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
./bundle/bundled/third_party/index.js 8 MB
./bundle/chunk-34MYV7JD.js 2.45 kB
./bundle/chunk-5AUYMPVF.js 858 B
./bundle/chunk-5PS3AYFU.js 1.18 kB
./bundle/chunk-664ZODQF.js 124 kB
./bundle/chunk-DAHVX5MI.js 206 kB
./bundle/chunk-GFUOVHXW.js 1.96 MB
./bundle/chunk-IUUIT4SU.js 56.5 kB
./bundle/chunk-RJTRUG2J.js 39.8 kB
./bundle/devtools-36NN55EP.js 696 kB
./bundle/dist-T73EYRDX.js 356 B
./bundle/events-XB7DADIJ.js 418 B
./bundle/gemini.js 552 kB
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB
./bundle/memoryDiscovery-ACCRGPX3.js 980 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB
./bundle/src-QVCVGIUX.js 47 kB
./bundle/tree-sitter-7U6MW5PS.js 274 kB
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB

compressed-size-action

@gundermanc gundermanc enabled auto-merge April 4, 2026 04:04
@wissamblue69-dotcom
Copy link
Copy Markdown

Summary

Improved the narration suppression logic in MainContent.tsx to resolve visual "flashing" and redundant "answering twice" issues when the Topics UX is enabled.

Details

  • Always suppress thinking: Thoughts stream in before tools. By hiding them immediately when narration is enabled, we prevent the flash that occurs before the first topic update arrives.
  • Suppress intermediate turns: Any turn containing functional (non-topic) tool calls is now fully suppressed to hide mechanical narration ("I will now search...").
  • Topic precedence: Text that precedes an update_topic tool call in the same turn is suppressed, as the Topic UI serves as a cleaner narrative alternative.
  • Final answer preservation: The logic ensures the final markdown response remains visible.
  • Unblock Build: Reverted a pre-existing breaking change in TableRenderer.tsx where StyledLine was missing from the ink dependency, and updated snapshots accordingly.

Related Issues

Related to internal topic UX polish.

How to Validate

  1. Enable experimental.topicUpdateNarration in settings.json.
  2. Interact with the agent (e.g., ask it to search for something).
  3. Observe that thoughts and "I will now..." text no longer flash or appear redundantly.
  4. Run npm test -w @google/gemini-cli -- src/ui/components/MainContent.test.tsx to verify suppression rules.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@wissamblue69-dotcom
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the user interface experience by refining how the agent narrates its actions. By suppressing redundant thinking and intermediate tool-related text, the UI becomes cleaner and less prone to visual flashing. Additionally, this PR addresses a regression in the table rendering component to ensure stability.

Highlights

  • Narration Suppression: Implemented refined logic in MainContent.tsx to suppress thinking blocks and intermediate turns when narration is enabled, reducing visual flicker and redundant output.
  • Topic Precedence: Added rules to suppress narrative text preceding topic tool calls, ensuring the Topic UI remains the primary narrative source.
  • Table Rendering Fix: Reverted a breaking change in TableRenderer.tsx by removing the dependency on StyledLine and updating internal logic to use StyledChar arrays, accompanied by updated test snapshots.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gundermanc gundermanc added this pull request to the merge queue Apr 6, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 6, 2026
@gundermanc gundermanc added this pull request to the merge queue Apr 6, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 6, 2026
@gundermanc gundermanc added this pull request to the merge queue Apr 6, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 6, 2026
@gundermanc gundermanc added this pull request to the merge queue Apr 6, 2026
Merged via the queue into main with commit 7872d6d Apr 6, 2026
81 of 87 checks passed
@gundermanc gundermanc deleted the gundermanc/topics-fit-n-finish branch April 6, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants