-
Notifications
You must be signed in to change notification settings - Fork 2.5k
improvement(selectors): consolidate all integration selectors to use the combobox #2020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR consolidates all integration selectors into a unified architecture, removing over 6,000 lines of duplicated code while improving maintainability and caching. Key Changes
Architecture Improvements
Code QualityThe refactoring follows established architectural patterns from the codebase and properly uses memoization, TypeScript interfaces, and error handling throughout. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant UI as UI Component<br/>(file-selector-input)
participant Resolution as Resolver<br/>(resolution.ts)
participant Combobox as SelectorCombobox
participant Query as useSelector<br/>Query Hooks
participant Registry as Selector<br/>Registry
participant API as Backend APIs
participant Cache as TanStack<br/>Query Cache
UI->>Resolution: resolveSelectorForSubBlock(subBlock, context)
Resolution->>Resolution: Analyze subBlock type and provider
Resolution-->>UI: selectorKey and context object
UI->>Combobox: Render with selectorKey and context
Combobox->>Query: useSelectorOptions(selectorKey, context, search)
Query->>Registry: getSelectorDefinition(selectorKey)
Registry-->>Query: Definition with fetchList and getQueryKey
Query->>Cache: Check cache with queryKey
alt Cache Hit
Cache-->>Query: Cached options array
else Cache Miss
Query->>Registry: fetchList with context and search
Registry->>API: fetchJson to integration endpoint
API-->>Registry: Raw data from integration
Registry->>Registry: Transform to SelectorOption array
Registry-->>Query: Normalized options
Query->>Cache: Store with staleTime
end
Query-->>Combobox: options data and loading state
alt User has existing value
Combobox->>Query: useSelectorOptionDetail(selectorKey, detailId)
Query->>Cache: Check detail cache
alt Detail Cache Miss
Query->>Registry: fetchById with context and detailId
Registry->>API: POST to detail endpoint
API-->>Registry: Detailed option data
Registry-->>Query: SelectorOption object
Query->>Cache: Store detail
end
Query-->>Combobox: detailOption
end
Combobox->>Combobox: Merge list and detail with useSelectorOptionMap
Combobox-->>UI: Render options with EditableCombobox
alt User selects option
UI->>Combobox: User selects value
Combobox->>Combobox: handleSelection with value
Combobox->>UI: setStoreValue updates store
Combobox->>UI: onOptionChange callback fires
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
34 files reviewed, no comments
Summary
Consolidate all integration selectors and remove display names cache to migrate to tanstack based access pattern.
Type of Change
Testing
Tested manually
Checklist