Skip to content

refactor(web): migrate local storage access to react hook#36888

Merged
lyzno1 merged 9 commits into
mainfrom
feat/local-storage-react-hook
Jun 1, 2026
Merged

refactor(web): migrate local storage access to react hook#36888
lyzno1 merged 9 commits into
mainfrom
feat/local-storage-react-hook

Conversation

@lyzno1
Copy link
Copy Markdown
Member

@lyzno1 lyzno1 commented Jun 1, 2026

Summary

  • add the foxact-style local storage hook and keep its public API aligned with upstream
  • bridge workflow localStorage persistence through a React boundary instead of direct store initialization hacks
  • migrate remaining web local-storage utility call sites to useLocalStorage/useSetLocalStorage and remove web/utils/local-storage.ts

Validation

  • vpr lint --fix --pass-on-unpruned-suppressions web/app/... web/hooks/use-local-storage/index.ts
  • pnpm -C web test app/components/header/tests/header-wrapper.spec.tsx app/components/header/tests/maintenance-notice.spec.tsx 'app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/tests/layout-main.spec.tsx' app/components/workflow/persistence/tests/local-storage-bridge.spec.tsx hooks/use-local-storage/tests/index.spec.tsx app/education-apply/tests/search-input.spec.tsx tests/billing/education-verification-flow.test.tsx
  • pnpm -C web type-check

@lyzno1 lyzno1 requested review from iamjoel and zxhlyh as code owners June 1, 2026 07:23
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. javascript refactor labels Jun 1, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Jun 1, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 92.02128% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.81%. Comparing base (becccbf) to head (d23eddc).

Files with missing lines Patch % Lines
web/hooks/use-local-storage/index.ts 92.66% 8 Missing ⚠️
.../(datasetDetailLayout)/[datasetId]/layout-main.tsx 66.66% 2 Missing ⚠️
web/app/components/workflow/index.tsx 81.81% 2 Missing ⚠️
...components/workflow/store/workflow/layout-slice.ts 66.66% 2 Missing ⚠️
...ents/workflow/persistence/local-storage-bridge.tsx 97.22% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #36888    +/-   ##
========================================
  Coverage   85.80%   85.81%            
========================================
  Files        4559     4562     +3     
  Lines      223152   223257   +105     
  Branches    41073    41095    +22     
========================================
+ Hits       191478   191584   +106     
+ Misses      27971    27970     -1     
  Partials     3703     3703            
Flag Coverage Δ
dify-ui 95.57% <ø> (ø)
web 86.47% <92.02%> (+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 enabled auto-merge June 1, 2026 07:29
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 1, 2026
@lyzno1 lyzno1 added this pull request to the merge queue Jun 1, 2026
Merged via the queue into main with commit 21711be Jun 1, 2026
37 checks passed
@lyzno1 lyzno1 deleted the feat/local-storage-react-hook branch June 1, 2026 08:05
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:XL This PR changes 500-999 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