Skip to content

refactor(web): migrate shell navigation app context consumers#38560

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

refactor(web): migrate shell navigation app context consumers#38560
hyoban merged 2 commits into
mainfrom
0708-shell-nav-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 [Refactor/Chore] Clarify and decouple web AppContext bootstrap dependencies #38514.
  • Migrates shell navigation AppContext consumers to direct bootstrap atom reads.
  • Replaces broad context reads in main navigation, detail sidebar, and app sidebar surfaces with field-level app context state atoms.
  • Adds scalar role flag atoms for editor and dataset operator checks used by the navigation shell.
  • Updates affected shell/sidebar tests to mock the exact app-context-state atoms consumed by production code.

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 context/app-context-state.ts __tests__/utils/mock-app-context-state.ts app/components/main-nav/index.tsx app/components/main-nav/layout.tsx app/components/main-nav/components/web-apps-section.tsx app/components/main-nav/components/account-section.tsx app/components/main-nav/components/support-menu.tsx app/components/main-nav/components/help-menu.tsx app/components/main-nav/components/workspace-card.tsx app/components/detail-sidebar/index.tsx app/components/app-sidebar/app-detail-section.tsx app/components/app-sidebar/dataset-detail-section.tsx app/components/app-sidebar/app-info/index.tsx app/components/app-sidebar/app-info/app-info-detail-panel.tsx app/components/app-sidebar/dataset-info/dropdown.tsx app/components/app-sidebar/snippet-info/dropdown.tsx app/components/main-nav/__tests__/index.spec.tsx app/components/main-nav/__tests__/layout.spec.tsx app/components/main-nav/components/__tests__/support-menu.spec.tsx app/components/main-nav/components/__tests__/workspace-card.spec.tsx app/components/detail-sidebar/__tests__/index.spec.tsx app/components/app-sidebar/__tests__/app-detail-section.spec.tsx app/components/app-sidebar/__tests__/dataset-detail-section.spec.tsx app/components/app-sidebar/app-info/__tests__/app-info-detail-panel.spec.tsx app/components/app-sidebar/dataset-info/__tests__/index.spec.tsx app/components/app-sidebar/dataset-info/__tests__/dropdown-callbacks.spec.tsx app/components/app-sidebar/snippet-info/__tests__/dropdown.spec.tsx --cache --quiet
  • pnpm -C web type-check
  • pnpm -C web test app/components/main-nav/__tests__/index.spec.tsx app/components/main-nav/__tests__/layout.spec.tsx app/components/main-nav/components/__tests__/support-menu.spec.tsx app/components/main-nav/components/__tests__/workspace-card.spec.tsx app/components/detail-sidebar/__tests__/index.spec.tsx app/components/app-sidebar/__tests__/app-detail-section.spec.tsx app/components/app-sidebar/__tests__/dataset-detail-section.spec.tsx app/components/app-sidebar/app-info/__tests__/app-info-detail-panel.spec.tsx app/components/app-sidebar/dataset-info/__tests__/index.spec.tsx app/components/app-sidebar/dataset-info/__tests__/dropdown-callbacks.spec.tsx app/components/app-sidebar/snippet-info/__tests__/dropdown.spec.tsx

@hyoban hyoban requested review from JzoNgKVO and iamjoel as code owners July 8, 2026 09:55
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. refactor labels Jul 8, 2026
@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 93.93939% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.34%. Comparing base (af5b08a) to head (1729a1b).

Files with missing lines Patch % Lines
web/context/app-context-state.ts 50.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #38560   +/-   ##
=======================================
  Coverage   85.34%   85.34%           
=======================================
  Files        5013     5013           
  Lines      265942   265958   +16     
  Branches    50558    50560    +2     
=======================================
+ Hits       226979   226994   +15     
- Misses      34510    34511    +1     
  Partials     4453     4453           
Flag Coverage Δ
dify-ui 94.61% <ø> (ø)
web 84.91% <93.93%> (+<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 draft July 8, 2026 10:00
@hyoban hyoban marked this pull request as ready for review July 8, 2026 10:10
@hyoban hyoban enabled auto-merge July 8, 2026 10:11
@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 94ba597 Jul 8, 2026
38 checks passed
@hyoban hyoban deleted the 0708-shell-nav-context branch July 8, 2026 10:18
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