improvement(kb): removed zustand cache syncing in kb, added chunk text tokenizer#2647
Merged
waleedlatif1 merged 9 commits intostagingfrom Dec 31, 2025
Merged
improvement(kb): removed zustand cache syncing in kb, added chunk text tokenizer#2647waleedlatif1 merged 9 commits intostagingfrom
waleedlatif1 merged 9 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryRefactored knowledge base state management from Zustand to React Query, removing 923 lines of complex cache synchronization code. Added interactive chunk tokenizer visualization using Key Changes:
Architecture Impact:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Component
participant ReactQuery
participant API
participant Database
Note over User,Database: Knowledge Base Data Flow (Before: Zustand Store)
User->>Component: View knowledge base
Component->>ReactQuery: useKnowledgeBaseQuery(id)
ReactQuery->>API: GET /api/knowledge/:id
API->>Database: Query knowledge base
Database-->>API: Knowledge base data
API-->>ReactQuery: Response
ReactQuery-->>Component: Cached data
Component-->>User: Display knowledge base
Note over User,Database: Chunk Editing with Tokenizer
User->>Component: Edit chunk content
Component->>Component: Toggle tokenizer ON
Component->>Component: getTokenStrings(text)
Component->>Component: Render colored tokens
User->>Component: Save changes
Component->>API: PATCH /api/knowledge/:kbId/documents/:docId/chunks/:chunkId
API->>Database: Update chunk
Database-->>API: Success
API-->>Component: Updated chunk
Component->>ReactQuery: invalidateQueries(knowledgeKeys)
ReactQuery->>API: Refetch data
API->>Database: Query fresh data
Database-->>API: Updated data
API-->>ReactQuery: Fresh data
ReactQuery-->>Component: Updated cache
Component-->>User: Display updated chunk
Note over User,Database: Context Menu Actions
User->>Component: Right-click on chunk
Component->>Component: Show ChunkContextMenu
User->>Component: Select action (Edit/Delete/Copy)
Component->>API: Execute action API call
API->>Database: Perform operation
Database-->>API: Success
API-->>Component: Result
Component->>ReactQuery: invalidateQueries(knowledgeKeys)
ReactQuery-->>Component: Trigger refetch
Component-->>User: Updated UI
|
Collaborator
Author
|
@greptile |
Sg312
pushed a commit
that referenced
this pull request
Jan 3, 2026
…t tokenizer (#2647) * improvement(kb): removed zustand cache syncing in kb, added chunk text tokenizer * removed dead code * removed redundant hook * remove unused hook * remove alert notification and use simple error * added more popover actions * removed debug instrumentation * remove extraneous comments * removed unused handler
waleedlatif1
added a commit
that referenced
this pull request
Jan 8, 2026
…t tokenizer (#2647) * improvement(kb): removed zustand cache syncing in kb, added chunk text tokenizer * removed dead code * removed redundant hook * remove unused hook * remove alert notification and use simple error * added more popover actions * removed debug instrumentation * remove extraneous comments * removed unused handler
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.
Summary
Type of Change
Testing
Tested manually
Checklist