Skip to content

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

Merged
TkDodo merged 2 commits intoTanStack:mainfrom
grzdev:feat/angular-devtools-theme-option
May 3, 2026
Merged

feat(angular-query): add devtools theme option#10609
TkDodo merged 2 commits 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. The theme can be applied dynamically to existing devtools instances and is respected on initial load; when unspecified it defaults to the system preference.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c60ace12-612a-4f39-a33a-0ebf13dd3a19

📥 Commits

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

📒 Files selected for processing (1)
  • packages/angular-query-experimental/src/devtools/with-devtools.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/angular-query-experimental/src/devtools/with-devtools.ts

📝 Walkthrough

Walkthrough

Theme option support is added to Angular floating devtools. The DevtoolsOptions interface gains an optional theme property, and the devtools update flow now reads this option and calls setTheme() on existing devtools instances.

Changes

Theme option support

Layer / File(s) Summary
Data Shape
packages/angular-query-experimental/src/devtools/types.ts
Add optional theme?: Theme to exported DevtoolsOptions.
Core Implementation
packages/angular-query-experimental/src/devtools/with-devtools.ts
Read theme from devtoolsOptions() in the devtools update effect and, when truthy and an instance exists, call devtools.setTheme(theme).
Release Note
.changeset/angular-devtools-theme-option.md
Add patch-level changeset documenting the new theme option for Angular floating devtools.

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 dress in colors so bright,
Toggling themes with a flick—what a delight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(angular-query): add devtools theme option' clearly and concisely summarizes the main change: adding theme option support to Angular devtools.
Description check ✅ Passed The description follows the template structure with complete 'Changes' section explaining the feature, a checklist with most items checked, and release impact confirmed. The explanation is clear and contextualizes the change within the broader framework.
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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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 2a924f5

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

☁️ Nx Cloud last updated this comment at 2026-05-03 14:09:49 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: 2a924f5

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

Comment thread packages/angular-query-experimental/src/devtools/with-devtools.ts Outdated
@TkDodo TkDodo merged commit bf902df into TanStack:main May 3, 2026
8 checks passed
@github-actions github-actions Bot mentioned this pull request May 3, 2026
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.

2 participants