Skip to content

fix(devtools): respect URL gating for the modal host - #580

Open
pcbeingused333 wants to merge 1 commit into
TanStack:mainfrom
pcbeingused333:fix/devtools-modal-url-flag
Open

pcbeingused333 wants to merge 1 commit into
TanStack:mainfrom
pcbeingused333:fix/devtools-modal-url-flag

Conversation

@pcbeingused333

@pcbeingused333 pcbeingused333 commented Nov 25, 2026 •

Copy link
Copy Markdown

🎯 Changes

With openAsModal and requireUrlFlag enabled, the modal host could open over an application dialog even when the URL flag hid the devtools panel. The resulting empty modal made the application dialog inert.

Use the panel's existing URL visibility condition for the modal host as well. The condition still allows the panel in Picture-in-Picture.

Add a Playwright regression that starts with defaultOpen, omits the required URL flag, and clicks a button in the application dialog while the devtools panel is absent.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

pnpm test:pr passes. The new Playwright test in e2e/apps/react-vite/tests/open-as-modal.spec.ts fails on main (the click on the app dialog button times out because the dialog is inert) and passes with this change, together with the rest of that spec.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

AI assistance was used to prepare the patch and regression test.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed modal behavior when a required URL flag hides the Devtools panel. App dialogs remain interactive, and their buttons can still be clicked and focused.
    • The modal no longer blocks interaction with the app when the panel is not visible.

@changeset-bot

changeset-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a72c305

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@tanstack/devtools Patch
@tanstack/angular-devtools Patch
@tanstack/preact-devtools Patch
@tanstack/react-devtools Patch
@tanstack/solid-devtools Patch
@tanstack/svelte-devtools Patch
@tanstack/vue-devtools Patch
@tanstack/devtools-example-angular-a11y-devtools Patch
@tanstack/devtools-example-angular-basic Patch
@tanstack/devtools-example-angular-panel Patch
@tanstack/devtools-example-angular-with-devtools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The modal host now renders only when modal mode is enabled and the Devtools panel is visible. The React Vite test app supports a URL-controlled default-open setting, and an end-to-end test checks app-dialog interaction when the gated panel is hidden.

Changes: Modal visibility gating

Layer / File(s) Summary
Gate the modal host on panel visibility
packages/devtools/src/devtools.tsx
A shared visibility check covers PiP, URL-flag enforcement, and the current query string. The modal host and panel render condition use this check.
Configure and test the gated modal case
e2e/apps/react-vite/src/main.tsx, e2e/apps/react-vite/tests/open-as-modal.spec.ts, .changeset/quiet-dialog-flag.md
The test app sets defaultOpen from the URL. The end-to-end test checks that the panel is absent and the app-dialog button remains clickable and focused. A patch changeset records the change.

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

Change: Bug fix

Possibly related PRs

  • TanStack/devtools#550: Adds the modal host and openAsModal option that this change updates to account for panel visibility.

Suggested reviewers: alemtuzlak

Merge Risk: Minimal · up to a72c3

This change stops an empty modal host from making an application dialog inert when the required URL flag is missing. It is a small, localized fix with a regression test, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the modal host now respects the URL gating that the panel already uses. It matches the changeset, the devtools.tsx change, and the regression test. The title follows t…
Description check Passed The description follows the template. It has the Changes section explaining the bug, the fix, and the Playwright regression. The checklist items are marked, and the Release Impact section is filled in…
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 modal host now respects the URL gating that the panel already uses. It matches the changeset, the devtools.tsx change, and the regression test. The title follows the conventional fix(scope) form, is 8 words, and avoids vague terms.

Full details: Description check

Explanation

The description follows the template. It has the Changes section explaining the bug, the fix, and the Playwright regression. The checklist items are marked, and the Release Impact section is filled in with a changeset noted. The first checklist item and the AI-understanding item are left partly unverified, but the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1ff6734 and a72c305.

Files selected for processing: 4

  • .changeset/quiet-dialog-flag.md
  • e2e/apps/react-vite/src/main.tsx
  • e2e/apps/react-vite/tests/open-as-modal.spec.ts
  • packages/devtools/src/devtools.tsx

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

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.

1 participant