Skip to content

fix(web): prefetch workspace and guard routes with contract query#36870

Merged
lyzno1 merged 3 commits into
mainfrom
codex/server-prefetch-current-workspace
May 31, 2026
Merged

fix(web): prefetch workspace and guard routes with contract query#36870
lyzno1 merged 3 commits into
mainfrom
codex/server-prefetch-current-workspace

Conversation

@lyzno1
Copy link
Copy Markdown
Member

@lyzno1 lyzno1 commented May 31, 2026

Summary

  • prefetch /workspaces/current in the common layout using the server oRPC query utils with per-request context
  • update RoleRouteGuard to consume the generated current workspace query directly and select only the workspace role
  • log root/common layout error-boundary errors and use safe local-storage helpers for education verification state

Tests

  • pnpm -C web test app/'(commonLayout)'/tests/role-route-guard.spec.tsx app/'(commonLayout)'/tests/hydration-boundary.spec.tsx
  • pnpm -C web test app/components/apps/tests/index.spec.tsx
  • pnpm -C web type-check
  • pnpm -C web exec eslint app/error.tsx app/'(commonLayout)'/error.tsx app/'(commonLayout)'/hydration-boundary.tsx app/'(commonLayout)'/tests/hydration-boundary.spec.tsx app/'(commonLayout)'/role-route-guard.tsx app/'(commonLayout)'/tests/role-route-guard.spec.tsx

@lyzno1 lyzno1 requested review from iamjoel and zxhlyh as code owners May 31, 2026 13:41
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. javascript labels May 31, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label May 31, 2026
@lyzno1 lyzno1 enabled auto-merge May 31, 2026 13:42
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.83%. Comparing base (f75725c) to head (b14d1e6).

Files with missing lines Patch % Lines
web/app/(commonLayout)/role-route-guard.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #36870      +/-   ##
==========================================
- Coverage   85.83%   85.83%   -0.01%     
==========================================
  Files        4553     4553              
  Lines      222811   222808       -3     
  Branches    41002    41001       -1     
==========================================
- Hits       191252   191248       -4     
- Misses      27869    27870       +1     
  Partials     3690     3690              
Flag Coverage Δ
dify-ui 95.57% <ø> (ø)
web 86.50% <80.00%> (-0.01%) ⬇️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lyzno1 lyzno1 requested a review from hjlarry May 31, 2026 13:47
@lyzno1 lyzno1 added this pull request to the merge queue May 31, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 31, 2026
Merged via the queue into main with commit 480d05b May 31, 2026
36 of 37 checks passed
@lyzno1 lyzno1 deleted the codex/server-prefetch-current-workspace branch May 31, 2026 14: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 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