Skip to content

fix(web): close slash command menu when thread is hidden - #46655

Open
ndycode wants to merge 2 commits into
pingdotgg:mainfrom
ndycode:fix/web-slash-command-tooltip-dismiss
Open

ndycode wants to merge 2 commits into
pingdotgg:mainfrom
ndycode:fix/web-slash-command-tooltip-dismiss

Conversation

@ndycode

@ndycode ndycode commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #46584. When Settings or Usage opens, the thread stays mounted but inert. The composer menu portal kept its open state, so a truncated description tooltip stayed painted over the modal.

Change

Gate the suggestion menu layer in apps/web/src/components/chat/ChatComposer.tsx on composerMenusClosed, which already tracks hiddenThread and collapsed-mobile controls. This unmounts the portal and its tooltip when the composer is covered.

Scope

Web composer menu layer only. No tooltip library or Settings changes.

Verification

  • Added a browser test in ChatView.browser.test.tsx that opens the slash menu, navigates to Settings, and asserts the menu and tooltip are removed from the DOM, then returns and asserts the menu reopens.
  • Commit hooks ran format, lint, and knip successfully.

Not in this change

  • No change to which commands the slash menu shows.
  • No tooltip dismissal on other navigation paths beyond the covered one.

Written and verified by gpt-6.2-astra via the Codex harness in T3 Code.

When Settings or Usage opens, the thread stays mounted but inert. The
composer menu portal kept its open state, so a truncated description
tooltip stayed painted over the modal.

Gate the suggestion menu layer on composerMenusClosed, which already
tracks hiddenThread and collapsed-mobile controls. This unmounts the
portal and its tooltip when the composer is covered.

Closes pingdotgg#46584
@ndycode
ndycode marked this pull request as ready for review December 1, 2026 12:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T12:32:46.685144Z cdbf257 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Dec 1, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at bc8d6f6

Macroscope's review found this PR approvable — The slash-command menu now follows the existing closure condition for hidden threads and collapsed composer controls. This is a narrowly scoped UI visibility fix with no persistent-data or external-system impact.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

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

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The command menu now requires composer menus to be open before it can appear. A browser test checks that the menu and tooltip disappear when navigating to Settings, then reappear when returning to the draft.

Changes: Slash-command menu dismissal

Layer / File(s) Summary
Menu visibility and navigation test
apps/web/src/components/chat/ChatComposer.tsx, apps/web/src/components/ChatView.browser.test.tsx
The command menu’s open condition now also checks that composer menus are not closed. The browser test verifies that the menu and tooltip disappear in Settings and that the menu reappears when returning to the draft.

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge, yash-singh1

Merge Risk: Minimal · up to bc8d6

The slash-command menu and its tooltip are now dismissed when the composer is covered, for example by Settings. No remaining merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(web): close slash command menu when thread is hidden" matches the main change: the composer suggestion menu layer is now gated on composerMenusClosed, so the slash menu and its tooltip …
Description check Passed The description follows the template sections (Problem, Change, Scope, Verification) and fills each one with specific content. The Problem section states the expected behavior and the bug (tooltip sta…
Linked Issues check Passed The only linked issue, #46584, is closed and completed. Under the assessment rules it supplies historical context only, so no active coding requirements apply. The PR still addresses the covered case …
Out of Scope Changes check Passed The PR changes two files per the raw summary. ChatComposer.tsx has a one-line gate (+1/-1) on the suggestion menu layer. ChatView.browser.test.tsx has a test extension (+24/-1) that covers the same Se…
Full details: Title check

Explanation

The title "fix(web): close slash command menu when thread is hidden" matches the main change: the composer suggestion menu layer is now gated on composerMenusClosed, so the slash menu and its tooltip unmount when the thread is hidden behind Settings or Usage. It follows the conventional commit style the template requests.

Full details: Description check

Explanation

The description follows the template sections (Problem, Change, Scope, Verification) and fills each one with specific content. The Problem section states the expected behavior and the bug (tooltip stays painted over the modal) and links issue #46584. The Change section names the file and the gating condition. The Verification section describes the browser test added and the hooks run. Gaps: the Problem section gives no reproduction steps, and the Verification section has no before/after screenshots, which the template asks for on UI changes. The Scope section also links the issue but does not explain why a bug-fix issue is the only link (it is provided). The template's closing note about naming the model and harness is present.

Full details: Linked Issues check

Explanation

The only linked issue, #46584, is closed and completed. Under the assessment rules it supplies historical context only, so no active coding requirements apply. The PR still addresses the covered case from the issue. The raw summary states that DeferredComposerCommandMenuLayer in ChatComposer.tsx now opens only when composerSuggestionsVisible is true and composerMenusClosed is false. composerMenusClosed already tracks hiddenThread, so a Settings or Usage cover unmounts the slash menu and its description tooltip. The browser test in ChatView.browser.test.tsx asserts that the menu and tooltip leave the DOM after navigating to Settings, and that the menu reopens on return. The file diff could not be read because changed blobs are missing from the checkout, so this verdict rests on the raw summary and PR description. The PR excludes other navigation paths, which the closed issue does not require.

Full details: Out of Scope Changes check

Explanation

The PR changes two files per the raw summary. ChatComposer.tsx has a one-line gate (+1/-1) on the suggestion menu layer. ChatView.browser.test.tsx has a test extension (+24/-1) that covers the same Settings transition. Both fall within the stated scope of the web composer menu layer. The PR description states that it makes no tooltip-library, Settings, or command-list changes, and the summary shows none. The full diff could not be read, so this verdict relies on the summary and description.

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 cdbf257 and bc8d6f6.

Files selected for processing: 1

  • apps/web/src/components/ChatView.browser.test.tsx

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cdbf257fd7

ℹ️ 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".

Comment on lines +1333 to +1334
await expect.element(page.getByRole("option", { name: /^\/model/ })).not.toBeInTheDocument();
expect(document.querySelector('[data-slot="tooltip-popup"]:not([data-ending-style])')).toBeNull();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Verify portal removal with a hidden-inclusive DOM query

When /model's description fits in the composer, both dismissal assertions can pass with the old code: ComposerCommandMenuItem never opens a tooltip, and the modal Settings dialog aria-hides the still-mounted menu, so the default getByRole query stops finding it. Assert that [data-composer-command-drawer] is actually removed, and establish that a truncated description's tooltip is present before navigation if tooltip removal is part of the regression test. Otherwise this does not provide the failing-before-fix proof required by docs/internals/15_testing.md.

AGENTS.md reference: AGENTS.md:L82-L82

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in bc8d6f6: the test asserts [data-composer-command-drawer] is removed from the DOM, and I verified it fails on the pre-fix code at that assertion.

await expect.element(permissions).not.toBeInTheDocument();
});

it("opening Settings with the slash menu open closes the menu and its tooltip", async () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fold this scenario into the existing Settings-dismissal test

The immediately preceding Settings test already mounts the same fake environment, draft, and AppRoot, navigates to Settings, returns to the draft, and checks composer-menu dismissal. The required testing guide, docs/internals/15_testing.md, explicitly says “Extend before you add” and instructs reviewers to flag new tests where an existing case fits. Extend that case with the slash-menu dismissal and reopening assertions instead of duplicating the full-app browser setup for the same workflow.

AGENTS.md reference: AGENTS.md:L82-L82

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in bc8d6f6: the slash menu scenario now extends the existing Settings-dismissal test, and the drawer removal is asserted with a DOM query since the modal aria-hides role lookups.

Extend the existing Settings-dismissal case with the slash menu instead of duplicating the app setup, and assert the command drawer leaves the DOM since the modal dialog aria-hides role queries.

Addresses review on pingdotgg#46655
@macroscopeapp
macroscopeapp Bot dismissed their stale review December 1, 2026 15:57

Dismissing prior approval to re-evaluate bc8d6f6

This branch has not been deployed

No deployments
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.

[Bug]: Slash-command description tooltip stays stuck on screen after switching views (e.g. to Usage → Limits)

1 participant