Skip to content

refactor(web): migrate account settings app context consumers#38544

Merged
hyoban merged 6 commits into
mainfrom
0708-account-context-migration
Jul 8, 2026
Merged

refactor(web): migrate account settings app context consumers#38544
hyoban merged 6 commits into
mainfrom
0708-account-context-migration

Conversation

@hyoban

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

Migrate account settings, account dropdown/header, and delete-account AppContext consumers to direct bootstrap atom reads.

This keeps the existing compatibility provider in place while narrowing subscriptions to exact account, workspace, permission, role, version, and refresh atoms at each use site. It also updates related tests to mock the precise app-context-state atoms used by the migrated components.

Refs #38514

From Codex

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:

  • pnpm -C web exec eslint --fix --cache --quiet <changed TS/TSX files>
  • pnpm -C web type-check
  • pnpm -C web test app/components/header/account-dropdown/__tests__/index.spec.tsx app/components/header/env-nav/__tests__/index.spec.tsx app/components/header/account-setting/__tests__/index.spec.tsx app/components/header/account-setting/members-page/__tests__/index.spec.tsx app/components/header/account-setting/members-page/__tests__/invite-button.spec.tsx app/components/header/account-setting/members-page/edit-workspace-modal/__tests__/index.spec.tsx app/components/header/account-setting/members-page/edit-workspace-modal/__tests__/dialog.spec.tsx app/components/header/account-setting/members-page/transfer-ownership-modal/__tests__/index.spec.tsx app/components/header/account-setting/permissions-page/__tests__/index.spec.tsx app/components/header/account-setting/permissions-page/role-list/__tests__/row-menu.spec.tsx app/components/header/account-setting/api-based-extension-page/__tests__/index.spec.tsx app/components/header/account-setting/access-rules-page/__tests__/access-rule-section.spec.tsx app/components/header/account-setting/model-provider-page/system-model-selector/__tests__/index.spec.tsx app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/index.spec.tsx app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.spec.tsx app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list-item.spec.tsx app/components/header/account-setting/preference-page/__tests__/index.spec.tsx

Note: pnpm -C web exec vp staged currently exits before checks with No "staged" config found in vite.config.ts, so I ran the equivalent explicit frontend checks above.

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

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.34%. Comparing base (5a210cf) to head (6dfcfc2).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
web/__tests__/utils/mock-app-context-state.ts 69.23% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #38544   +/-   ##
=======================================
  Coverage   85.34%   85.34%           
=======================================
  Files        5013     5013           
  Lines      265817   265842   +25     
  Branches    50538    50545    +7     
=======================================
+ Hits       226863   226886   +23     
- Misses      34506    34508    +2     
  Partials     4448     4448           
Flag Coverage Δ
dify-ui 94.61% <ø> (ø)
web 84.91% <92.00%> (+<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 8, 2026 08:14
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 8, 2026
@hyoban hyoban enabled auto-merge July 8, 2026 08:14
@dosubot dosubot Bot added the refactor label Jul 8, 2026
@hyoban hyoban added this pull request to the merge queue Jul 8, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 8, 2026
Merged via the queue into main with commit dce45ef Jul 8, 2026
38 checks passed
@hyoban hyoban deleted the 0708-account-context-migration branch July 8, 2026 08:24
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.

2 participants