Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how knowledgebase data is loaded and managed throughout the application, moving away from a centralized store to more localized, on-demand fetching. It also removes unused resource selection logic from assistants and projects, and cleans up related test code. The most important changes are grouped below.
Knowledgebase Data Fetching and State Management
useAppStorefor knowledgebases with direct data fetching vialistKnowledgebasesand a newuseKnowledgebaseshook in both the knowledgebases list page (app/(main)/knowledgebases/page.tsx) and the project page (app/(main)/projects/[id]/page.tsx). This allows for more localized state and easier refreshes after mutations [1] [2] [3] app/(main)/projects/[id]/page.tsxR49-R53, app/(main)/projects/[id]/page.tsxL86-L93, app/(main)/projects/[id]/page.tsxL142-R143, app/(main)/projects/[id]/page.tsxL321-R309).app/(main)/knowledgebases/[id]/page.tsx) to fetch its own data usinggetKnowledgebaseand manage its own loading state, removing reliance on global hydration and store (app/(main)/knowledgebases/[id]/page.tsxL12, app/(main)/knowledgebases/[id]/page.tsxR25, app/(main)/knowledgebases/[id]/page.tsxL39-R70, app/(main)/knowledgebases/[id]/page.tsxL75-L79, app/(main)/knowledgebases/[id]/page.tsxR99-R103).onSuccesscallback for refreshing the list, instead of directly calling a store action [1] [2] [3].Resource Selection Logic Cleanup
onToggleResource, resourceUris inonBulkSelect, and related props) from both the assistants and projects pages, simplifying tool/resource selection to just tools (app/(main)/assistants/[id]/page.tsxL154-L181, app/(main)/assistants/[id]/page.tsxL363-L365, app/(main)/projects/[id]/page.tsxL166-L193).Test Code Cleanup
getAssistant,getProject, andgetPromptimports and their corresponding test suites from assistants, projects, and prompts test files, respectively, reducing test bloat and improving clarity [1] [2] [3] [4] [5] [6].These changes collectively improve code maintainability, reduce unnecessary global state, and make the UI more responsive to knowledgebase changes.