Skip to content

Compact thinking control in narrow composers - #7150

Merged
shimmyshimmer merged 2 commits into
mainfrom
agent/compact-thinking-control
Jul 15, 2026
Merged

shimmyshimmer merged 2 commits into
mainfrom
agent/compact-thinking-control

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

Summary

  • Collapse the Thinking control to a 32px bulb-only trigger when the composer is 36rem wide or narrower.
  • Keep the full label and effort chevron at normal composer widths.
  • Preserve the existing toggle and dropdown behavior in standard and compare composers.
  • Add responsive layout regression coverage.

Why

Opening Canvas narrows the chat composer. The full Thinking pill can consume enough horizontal space to wrap the right-side controls onto another line and distort the composer layout.

The composer now queries its own width, so split layouts adapt independently of the browser viewport.

User impact

Narrow composers keep the Thinking control on the same row as dictation and send controls. The bulb remains clickable and continues to open reasoning settings or toggle thinking.

Validation

  • npm run typecheck
  • npm run build
  • Focused responsive contract assertions
  • Browser verification at 560px and 700px composer widths, including compact trigger interaction

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

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.

Code Review

This pull request implements a responsive, compact layout for the 'Thinking' pill control within narrow composer containers. It adds specific class names and data attributes to the TSX components, defines container queries in the CSS to collapse the label and caret on small screens, and introduces a test suite to verify these elements. The review feedback recommends specifying encoding='utf-8' when reading files in the tests to prevent platform-dependent encoding issues with non-ASCII characters.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


def test_thinking_control_has_compact_hooks_in_both_composers():
for path in (THREAD_TSX, SHARED_TSX):
source = path.read_text()

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.

medium

When reading source files in tests, always specify encoding='utf-8' to prevent platform-dependent encoding failures (e.g., on Windows) where default codecs might fail on non-ASCII characters like · (middle dot).

Suggested change
source = path.read_text()
source = path.read_text(encoding="utf-8")



def test_narrow_composer_collapses_thinking_to_the_bulb():
css = INDEX_CSS.read_text()

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.

medium

When reading the CSS file in tests, always specify encoding='utf-8' to prevent platform-dependent encoding failures (e.g., on Windows) where default codecs might fail on non-ASCII characters like − (minus sign, U+2212) present in index.css.

Suggested change
css = INDEX_CSS.read_text()
css = INDEX_CSS.read_text(encoding="utf-8")

@shimmyshimmer
shimmyshimmer marked this pull request as ready for review July 15, 2026 16:47
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: b56db39cc1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shimmyshimmer
shimmyshimmer merged commit c5ae208 into main Jul 15, 2026
20 of 40 checks passed
@shimmyshimmer
shimmyshimmer deleted the agent/compact-thinking-control branch July 15, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant