Skip to content

feat(angular-query): add devtools theme option#10609

Open
grzdev wants to merge 1 commit intoTanStack:mainfrom
grzdev:feat/angular-devtools-theme-option
Open

feat(angular-query): add devtools theme option#10609
grzdev wants to merge 1 commit intoTanStack:mainfrom
grzdev:feat/angular-devtools-theme-option

Conversation

@grzdev
Copy link
Copy Markdown
Contributor

@grzdev grzdev commented Apr 28, 2026

🎯 Changes

Add theme option support to Angular floating devtools.

React, Vue, and Solid devtools already expose the shared theme?: Theme option. This adds the same option to Angular floating devtools and updates an existing devtools instance with setTheme(theme) when the option changes.

This keeps Angular devtools aligned with the shared query devtools API and sibling framework bindings.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

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

Summary by CodeRabbit

  • New Features
    • Added theme option support to the Angular floating devtools, enabling light, dark, or system theme selection for the devtools panel.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

Theme option support is added to Angular floating devtools. The DevtoolsOptions interface gains an optional theme property, and the devtools initialization logic now reads and applies this theme to existing instances via setTheme().

Changes

Cohort / File(s) Summary
Changesets
.changeset/angular-devtools-theme-option.md
Patch-level release note documenting theme option support for Angular floating devtools.
Theme Option Support
packages/angular-query-experimental/src/devtools/types.ts, packages/angular-query-experimental/src/devtools/with-devtools.ts
Adds optional theme property to DevtoolsOptions interface and implements theme application logic that reads the theme from options and calls setTheme() on existing devtools instances.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A theme option hops into view,
Light, dark, or system—the choice is for you!
The devtools now style to your taste,
No theme confusion, no visual waste! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a devtools theme option to Angular query, which is the primary focus of all modifications.
Description check ✅ Passed The description covers the required sections with clear motivation, follows the template structure, includes a changeset reference, and aligns with the actual code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 28, 2026

View your CI Pipeline Execution ↗ for commit feb8b3f

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 1m 53s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-28 20:23:03 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 28, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10609

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10609

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10609

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10609

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10609

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10609

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10609

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10609

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10609

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10609

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10609

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10609

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10609

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10609

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10609

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10609

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10609

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10609

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10609

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10609

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10609

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10609

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10609

commit: feb8b3f

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/angular-query-experimental/src/devtools/with-devtools.ts (1)

138-147: ⚠️ Potential issue | 🟡 Minor

Remove the truthy guard when syncing theme updates.

On line 146, the if (theme) guard prevents updates when theme becomes undefined, so an existing instance retains stale theme instead of resetting to default. React and Preact implementations call setTheme() directly without guards, and the method signature accepts optional values. Removing the guard aligns with other frameworks and allows proper synchronization when the option is removed.

Suggested fix
-                if (theme) devtools.setTheme(theme)
+                devtools.setTheme(theme)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/angular-query-experimental/src/devtools/with-devtools.ts` around
lines 138 - 147, The theme update guard prevents clearing a previously set
theme; instead of conditionally calling devtools.setTheme only when theme is
truthy, always call devtools.setTheme(theme) in the same update block so
undefined resets to default; update the code in with-devtools.ts where devtools
is updated (the block that calls client && devtools.setClient(...), position &&
devtools.setPosition(...), etc.) to remove the if (theme) check and invoke
devtools.setTheme(theme) unconditionally.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/angular-query-experimental/src/devtools/with-devtools.ts`:
- Around line 138-147: The theme update guard prevents clearing a previously set
theme; instead of conditionally calling devtools.setTheme only when theme is
truthy, always call devtools.setTheme(theme) in the same update block so
undefined resets to default; update the code in with-devtools.ts where devtools
is updated (the block that calls client && devtools.setClient(...), position &&
devtools.setPosition(...), etc.) to remove the if (theme) check and invoke
devtools.setTheme(theme) unconditionally.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9aecca21-4e5e-4db4-9062-902bd73e6a72

📥 Commits

Reviewing files that changed from the base of the PR and between c5ab5a1 and feb8b3f.

📒 Files selected for processing (3)
  • .changeset/angular-devtools-theme-option.md
  • packages/angular-query-experimental/src/devtools/types.ts
  • packages/angular-query-experimental/src/devtools/with-devtools.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant