Skip to content

fix(web): model picker shortcut closes open popups before opening - #47167

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-model-picker-shortcut-closes-open-popups
Dec 2, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
only21mil:fix/web-model-picker-shortcut-closes-open-popups

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

When a menu, select, or combobox (such as the composer's Permissions menu) is open and you press Mod+Shift+M, the model picker opens on top instead of closing it first, because no outside press dismisses it.

Change

In apps/web/src/components/chat/composerShortcuts.ts:20-22, modelPicker.toggle calls closeOpenPopups() (open-popups.tsx, following #45341 and #45435) before toggleModelPicker() only when !composerRef.current.isModelPickerOpen() (line 21), so a second press still closes an open picker (and nested Permissions menu) without main↔side chat stacking. A test in useChatShortcuts.browser.test.tsx verifies Ctrl+Shift+M closes a Menu, focuses Search models..., and toggles off a Popover on a second press.

Scope

Bug fix: a shortcut leaves two popups stacked; small fix for an obvious bug, so no issue. apps/web (web and desktop; mobile omits modelPicker.toggle). Modal dialogs are not registered popups and are left alone (as is Ctrl+F find). composer.effort, composer.mode, and composer.workspace close popups via openControl (verified live; composer.host shares it).

Verification

Setup: Linux Chromium 1280×800, light theme, isolated vp run dev (T3CODE_DEV_SEED=0), fresh data + Replay (dev) (showcase) in a scratch repo per commit; input via Browser panel.

Steps: new draft thread → click Permissions: Full access → press Ctrl+Shift+M

c9cfe9e2c458 bec3071480f0
Permissions menu stays open below model picker
Permissions menu stays open below model picker
Permissions menu closes; Search models focused
Permissions menu closes; Search models focused

Project picker (combobox-popup) and Workspace select (select-popup) also went from 2 popups on c9cfe9e2c458 to 1 (popover-popup, Search models... focused) on bec3071480f0; second press closes the picker and modal dialogs stay open. Merged with green main (9968d94fe773, stacked 2): 1 popup (Search models... focused), toggle-off and side-chat Ctrl+Shift+M work.

Not shown

  • macOS and Windows desktop builds (same apps/web handler; Linux web checked).
  • composer.branch (Mod+Shift+G) stacking over an open menu is a separate fault this PR does not touch.
Automated checks
  • Base (c9cfe9e2c458): new test failed (menuitem "Rename" stayed in DOM); removing !composerRef.current.isModelPickerOpen() failed on the second press (Search models... stayed in DOM).
  • Head (bec3071480f0): useChatShortcuts, ComposerPermissionsSection, ProviderModelPicker — 39/39 passed; merged with 9968d94fe773: useChatShortcuts + ComposerPermissionsSection — 34/34 passed.
  • Stress (useChatShortcuts.browser.test.tsx): 2 × 100 concurrent runs — 200/200 passed, 0 failures.
  • vp run check:changed c9cfe9e2c458: format, lint, knip, typecheck, test (25/25), react compiler passed.

Generated with Gemini 4 Neon in T3 Code Nightly

Opening the composer model picker with Mod+Shift+M left an already-open menu, select, or combobox stacked alongside it because no outside pointer press dismissed the prior popup. Close registered open popups before opening the model picker from modelPicker.toggle, leaving an already-open picker and its toggle-off path untouched.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 2, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at bec3071

Macroscope's review found this PR approvable — The model-picker shortcut now closes existing popups before opening the picker while preserving its closing behavior. This is a narrowly scoped UI interaction change with no material data or operational exposure.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bec3071 and c91d127.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The model-picker shortcut now closes open popups before opening the picker. Browser tests cover popup closure, search-input focus, and closing the picker on a second shortcut press.

Changes: Model picker shortcut

Layer / File(s) Summary
Shortcut behavior and browser coverage
apps/web/src/components/chat/composerShortcuts.ts, apps/web/src/components/chat/useChatShortcuts.browser.test.tsx
The shortcut ignores repeated events and missing composers. When the picker is closed, it closes open popups before toggling the picker. Browser tests check menu closure, search-input focus, and picker toggling. Composer mocks now include isModelPickerOpen.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · previous review bec30

The model-picker shortcut now closes stacked menus before opening the picker, and an open picker still closes on a second press. The change is small and tested, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the model picker shortcut now closes open popups before it opens. It matches the summary, which shows modelPicker.toggle calling closeOpenPopups() before toggling the …
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem names the stacked Permissions menu case. The Change c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the model picker shortcut now closes open popups before it opens. It matches the summary, which shows modelPicker.toggle calling closeOpenPopups() before toggling the picker. The title uses the conventional commit form with a plain-language subject.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem names the stacked Permissions menu case. The Change cites the file, lines, and the condition that gates closeOpenPopups(). The Scope explains why no issue is linked and states the affected clients. The Verification lists the environment, manual steps, before/after screenshots, and automated test results, and it names what was not checked (macOS and Windows desktop). The template asks for the agent model and harness at the end. The description ends with 'Generated with Gemini 4 Neon in T3 Code Nightly', which names a model and harness, so that requirement is met. The Scope section cites PR numbers and commit links, and the Verification section includes a commit table; neither is a problem for the template.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1e6e7d7 and bec3071.

Files selected for processing: 2

  • apps/web/src/components/chat/composerShortcuts.ts
  • apps/web/src/components/chat/useChatShortcuts.browser.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 2, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

On both commits: open the seeded Replay (dev) thread; use the model picker footer Permissions control to select Supervised, then dismiss the picker. Click the composer's Supervised chip; press Ctrl+Shift+M, observe the picker and search focus, then press it again. Dismiss any stale Permissions menu with Escape. Open the right-panel Branch: main ref combobox (the same Search refs control as Select ref); press Ctrl+Shift+M, observe the picker and search focus, then press it again.

Environment on both sides: real web dev app, Chromium, light theme, 1440×900 CSS viewport (recorded at 1280×800), fresh per-commit database and synthetic Replay (dev) thread. Recordings start after setup.

Before After
b4b58d231c c91d127764
Watch before recording Watch after recording
Permissions and the ref list each stay visible when the picker opens; the second shortcut closes the picker but leaves the earlier popup behind. Each earlier popup is dismissed, Search models receives focus, and the second shortcut closes the picker without leaving a stale popup.

Seed script · Browser action driver

The seeded repository has main selected, so its ref trigger reads “Branch: main” rather than “Select ref”; both open the same “Search refs...” combobox.

Not shown:

  • Workspace select and other popup types were not exercised; the real-app proof covers the reported Permissions menu and ref combobox paths.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 2, 2026
@juliusmarminge
juliusmarminge merged commit 06d024e into pingdotgg:main Dec 2, 2026
57 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 2, 2026
imetn added a commit to imetn/t4code that referenced this pull request Dec 2, 2026
…ingdotgg#45341

Ported prerequisite pingdotgg#45341 (open-popups) and 27 of 28 upstream commits
from b4b58d2..7538a0f, preserving all locked T4 customizations,
zero telemetry, and T4 branding:
- Bounded command projection reads (pingdotgg#47115)
- Move threads between projects & recover missing workspace folders (pingdotgg#47234)
- Mention menu highlight update (pingdotgg#47210, enabling files mention in test for T4 Lock pingdotgg#18)
- Mobile image-chip-without-text send (pingdotgg#47173)
- Antigravity Argon pricing (pingdotgg#47202), OpenCode 64-char MCP tool names (pingdotgg#43800)
- GitHub HTTPS->SSH clone fallback (pingdotgg#47239), open popup coordination (pingdotgg#47167)
- Plus 19 additional upstream fixes across server, web, mobile, and providers
- Auto-synced all 30 GT v12 i18n catalogs via sync:t4-i18n (0 untranslated)
- Deferred pingdotgg#47163 (depends on unported workflow-subjects) in .t4-upstream-sync.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants