Commit Graph

4 Commits

Author SHA1 Message Date
yyh
d00367c7c9 fix(web): prevent false 404 during installed app refetch
- keep loading state when installed app list is refetching without a matched id

- align installed-app tests with TanStack Query isPending semantics

- add refetch regression assertions to avoid early 404 fallback
2026-02-14 14:14:51 +08:00
yyh
d32e23f877 refactor(web): remove ExploreContext and migrate to derived state with oRPC contracts
Replace ExploreContext with derived permission checks using useAppContext
and useMembers, eliminating redundant state synchronization. Add oRPC
contract for explore endpoints, extract TryAppSelection type, and migrate
app-publisher icons from @remixicon/react components to CSS icon classes.
Update all related tests to reflect the new context-free architecture.
2026-02-14 13:24:10 +08:00
yyh
063f6562cb refactor(web): remove React Query state sync anti-pattern from ExploreContext
Eliminate useEffect-based synchronization of React Query server state
into React Context, which caused extra renders, state drift, and
incorrect loading/empty states on the /explore/apps page.

- Remove installedApps, isFetchingInstalledApps, and
  controlUpdateInstalledApps from ExploreContext (dead code + anti-pattern)
- Sidebar and InstalledApp now consume useGetInstalledApps() directly
- Use isLoading (not isPending) for conditionally-enabled queries to
  avoid permanent loading state when query is disabled
- Derive hasEditPermission during render instead of via useEffect
- Replace FC type annotations with const arrow functions
- Add return type to fetchInstalledAppList
- Update all related unit and integration tests
2026-02-14 13:02:10 +08:00
3fd1eea4d7 feat(tests): add integration tests for explore app list, installed apps, and sidebar lifecycle flows (#32248)
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
2026-02-12 10:29:03 +08:00