[PR #32148] refactor(web): remove workspace mutate/loading from AppContext #33578

Open
opened 2026-02-21 20:53:32 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/32148

State: open
Merged: No


Summary

  • Remove mutateCurrentWorkspace and isValidatingCurrentWorkspace from AppContext, replacing with useInvalidateCurrentWorkspace() hook in the service layer (consistent with the project's useInvalidateXxx pattern)
  • Remove redundant useEffect + invalidateQueries in ModelProviderPage that caused QuotaPanel to flash a loading spinner on every settings tab switch
  • QuotaPanel now derives its loading state internally from !currentWorkspace.id instead of receiving an isLoading prop driven by isFetching

Test plan

  • vitest tests for custom-web-app-brand and apps-full-in-dialog pass (10/10)
  • TypeScript type check passes (tsgo --noEmit)
  • Verify QuotaPanel no longer flashes loading when switching settings tabs
  • Verify custom webapp brand logo upload/restore/switch still invalidates workspace data correctly
**Original Pull Request:** https://github.com/langgenius/dify/pull/32148 **State:** open **Merged:** No --- ## Summary - Remove `mutateCurrentWorkspace` and `isValidatingCurrentWorkspace` from `AppContext`, replacing with `useInvalidateCurrentWorkspace()` hook in the service layer (consistent with the project's `useInvalidateXxx` pattern) - Remove redundant `useEffect` + `invalidateQueries` in `ModelProviderPage` that caused QuotaPanel to flash a loading spinner on every settings tab switch - `QuotaPanel` now derives its loading state internally from `!currentWorkspace.id` instead of receiving an `isLoading` prop driven by `isFetching` ## Test plan - [x] `vitest` tests for `custom-web-app-brand` and `apps-full-in-dialog` pass (10/10) - [x] TypeScript type check passes (`tsgo --noEmit`) - [ ] Verify QuotaPanel no longer flashes loading when switching settings tabs - [ ] Verify custom webapp brand logo upload/restore/switch still invalidates workspace data correctly
yindo added the pull-request label 2026-02-21 20:53:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33578