Skip to content

refactor(web): split app context state atoms#38588

Merged
hyoban merged 1 commit into
mainfrom
0709-app-context-atoms
Jul 9, 2026
Merged

refactor(web): split app context state atoms#38588
hyoban merged 1 commit into
mainfrom
0709-app-context-atoms

Conversation

@hyoban

@hyoban hyoban commented Jul 9, 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

Issue: N/A

  • Split the previous app context state module into focused account, workspace, permission, system feature, and version atom modules.
  • Updated downstream imports to consume the focused atom modules directly instead of the removed app-context-state entry point.
  • Kept high-use field atoms while making intermediate query/role atoms private and moving dataset RBAC state under system features.
  • Updated app context test helpers and related mocks for the new module boundaries.

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 does not apply to typos!)
  • I have updated tests/mocks for the changed atom module boundaries, and I tried as much as possible to make a single atomic change.
  • I have 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

  • git diff --check
  • pnpm --dir web type-check
  • pnpm --dir web test context/__tests__/console-bootstrap.spec.tsx app/components/plugins/plugin-page/__tests__/use-reference-setting.spec.ts 'app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/__tests__/layout-main.spec.tsx' app/components/datasets/access-config/__tests__/index.spec.tsx app/components/datasets/settings/permission-selector/__tests__/index.spec.tsx app/components/datasets/list/dataset-card/components/__tests__/operations-dropdown.spec.tsx

From Codex

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

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.64865% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.34%. Comparing base (6540d17) to head (978aa25).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
web/__tests__/utils/mock-app-context-state.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #38588   +/-   ##
=======================================
  Coverage   85.34%   85.34%           
=======================================
  Files        5017     5021    +4     
  Lines      266979   266979           
  Branches    50824    50821    -3     
=======================================
+ Hits       227844   227847    +3     
+ Misses      34668    34665    -3     
  Partials     4467     4467           
Flag Coverage Δ
dify-ui 94.61% <ø> (ø)
web 84.85% <98.64%> (+<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 9, 2026 07:37
@hyoban hyoban enabled auto-merge July 9, 2026 07:37
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. refactor labels Jul 9, 2026
@hyoban hyoban added this pull request to the merge queue Jul 9, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 9, 2026
Merged via the queue into main with commit a5a7c76 Jul 9, 2026
38 checks passed
@hyoban hyoban deleted the 0709-app-context-atoms branch July 9, 2026 07:50
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:M This PR changes 30-99 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.

2 participants