Skip to content

refactor(web): reduce query atom subscriptions#38521

Merged
hyoban merged 3 commits into
mainfrom
0707-query-atoms
Jul 7, 2026
Merged

refactor(web): reduce query atom subscriptions#38521
hyoban merged 3 commits into
mainfrom
0707-query-atoms

Conversation

@hyoban

@hyoban hyoban commented Jul 7, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fixes #38520.

  • Document that jotai-tanstack-query query atoms do not support TanStack Query tracked properties in the local component-writing skill.
  • Add field-specific derived atoms for deployments query results using selectAtom.
  • Replace direct UI subscriptions to whole atomWithQuery / atomWithInfiniteQuery results with exact field subscriptions.
  • Keep full query result usage only where the workflow needs observer methods, such as refetch orchestration.
  • Update source app picker and source step tests for the narrower infinite-scroll query input shape.

Screenshots

Before After
N/A N/A

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Validation performed:

  • pnpm lint <affected deployments files and tests>
  • pnpm --filter dify-web test features/deployments/create-guide/ui/__tests__/source-step.spec.tsx features/deployments/create-release/ui/__tests__/source-app-picker.spec.tsx
  • git diff --check
  • rg "useAtomValue\([^)]*QueryAtom\)|useAtom\([^)]*QueryAtom\)" web/features/deployments -g "*.{ts,tsx}" -g "!**/__tests__/**"

Notes:

  • pnpm --filter dify-web type-check currently fails on existing .next/types/validator.ts generated route type errors unrelated to this change.
  • cd web && pnpm exec vp staged currently fails because no staged config is defined in vite.config.ts.

From Codex

@github-actions github-actions Bot added the web This relates to changes on the web. label Jul 7, 2026
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.72180% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.33%. Comparing base (56f3d0a) to head (fdb5665).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...features/deployments/detail/deployment-sidebar.tsx 0.00% 6 Missing ⚠️
...ployments/detail/releases/release-actions/state.ts 50.00% 4 Missing ⚠️
...features/deployments/create-guide/state/queries.ts 90.90% 2 Missing ⚠️
...atures/deployments/create-guide/ui/source-step.tsx 83.33% 2 Missing ⚠️
...features/deployments/create-release/state/index.ts 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #38521      +/-   ##
==========================================
- Coverage   85.33%   85.33%   -0.01%     
==========================================
  Files        5009     5009              
  Lines      265583   265654      +71     
  Branches    50499    50496       -3     
==========================================
+ Hits       226634   226691      +57     
- Misses      34499    34513      +14     
  Partials     4450     4450              
Flag Coverage Δ
dify-ui 94.72% <ø> (ø)
web 84.88% <88.72%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hyoban hyoban marked this pull request as ready for review July 7, 2026 15:09
@hyoban hyoban requested a review from lyzno1 as a code owner July 7, 2026 15:09
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 7, 2026
@hyoban hyoban enabled auto-merge July 7, 2026 15:09
@dosubot dosubot Bot added the refactor label Jul 7, 2026
@hyoban hyoban added this pull request to the merge queue Jul 7, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 7, 2026
Merged via the queue into main with commit 5308b95 Jul 7, 2026
38 checks passed
@hyoban hyoban deleted the 0707-query-atoms branch July 7, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor/Chore] Reduce deployments query atom subscriptions

2 participants