From 96fe5a50d6051d2086ea120abeaeb6d090fa7dfd Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Tue, 10 Jun 2025 21:51:13 -0400 Subject: [PATCH] Update repo.md (#9054) --- .openhands/microagents/repo.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.openhands/microagents/repo.md b/.openhands/microagents/repo.md index e8095b2f17..66d7cda666 100644 --- a/.openhands/microagents/repo.md +++ b/.openhands/microagents/repo.md @@ -44,12 +44,13 @@ Frontend: - Available variables: VITE_BACKEND_HOST, VITE_USE_TLS, VITE_INSECURE_SKIP_VERIFY, VITE_FRONTEND_PORT - Internationalization: - Generate i18n declaration file: `npm run make-i18n` -- State Management: - - We use TanStack Query (React Query) for server state management +- Data Fetching & Cache Management: + - We use TanStack Query (fka React Query) for data fetching and cache management + - Data Access Layer: API client methods are located in `frontend/src/api` and should never be called directly from UI components - they must always be wrapped with TanStack Query - Custom hooks are located in `frontend/src/hooks/query/` and `frontend/src/hooks/mutation/` - - Query hooks should follow the pattern `use[Resource]` (e.g., `useConversationMicroagents`) - - Mutation hooks should follow the pattern `use[Action]` (e.g., `useDeleteConversation`) - + - Query hooks should follow the pattern use[Resource] (e.g., `useConversationMicroagents`) + - Mutation hooks should follow the pattern use[Action] (e.g., `useDeleteConversation`) + - Architecture rule: UI components → TanStack Query hooks → Data Access Layer (`frontend/src/api`) → API endpoints ## Template for Github Pull Request