Skip to content

refactor(web): migrate workflow app context consumers#38552

Merged
hyoban merged 2 commits into
mainfrom
0708-workflow-context
Jul 8, 2026
Merged

refactor(web): migrate workflow app context consumers#38552
hyoban merged 2 commits into
mainfrom
0708-workflow-context

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

Related to #38514.

Migrates workflow editor AppContext consumers to direct bootstrap atom reads. This keeps workflow-specific calculations at the original call sites while narrowing subscriptions for user profile, workspace, and permission-key dependencies.

Updated focused workflow tests to mock the exact app-context-state atoms used by the migrated components.

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 --dir web test app/components/workflow/comment/comment-input.spec.tsx app/components/workflow/comment/comment-icon.spec.tsx app/components/workflow/comment/thread.spec.tsx app/components/workflow/panel/comments-panel/__tests__/index.spec.tsx app/components/workflow/hooks/__tests__/use-workflow-comment.spec.ts app/components/workflow/__tests__/selection-contextmenu.spec.tsx app/components/workflow/nodes/human-input/components/delivery-method/__tests__/method-item.spec.tsx app/components/workflow/nodes/human-input/components/delivery-method/__tests__/email-configure-modal.spec.tsx app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsx app/components/workflow/nodes/human-input/components/delivery-method/recipient/__tests__/index.spec.tsx app/components/workflow/panel/version-history-panel/__tests__/index.spec.tsx app/components/workflow/header/__tests__/header-in-restoring.spec.tsx app/components/workflow/header/__tests__/header-layouts.spec.tsx
  • pnpm --dir web type-check
  • Pre-commit staged eslint: eslint --fix --pass-on-unpruned-suppressions

Note: pnpm --dir web exec vp staged is currently unavailable in this checkout because no staged config is defined in web/vite.config.ts.

From Codex

@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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.34%. Comparing base (dce45ef) to head (27388de).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #38552   +/-   ##
=======================================
  Coverage   85.34%   85.34%           
=======================================
  Files        5013     5013           
  Lines      265940   265942    +2     
  Branches    50558    50558           
=======================================
+ Hits       226978   226980    +2     
  Misses      34509    34509           
  Partials     4453     4453           
Flag Coverage Δ
dify-ui 94.61% <ø> (ø)
web 84.91% <100.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 09:00
@hyoban hyoban requested review from iamjoel and zxhlyh as code owners July 8, 2026 09:00
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. refactor labels Jul 8, 2026
@hyoban hyoban enabled auto-merge July 8, 2026 09:00
@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 eca2d41 Jul 8, 2026
38 checks passed
@hyoban hyoban deleted the 0708-workflow-context branch July 8, 2026 09:09
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