-
Notifications
You must be signed in to change notification settings - Fork 3.1k
improvement(display-names): move display name mapping to central store + access pattern via hook #1881
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 SummaryRefactored display name management from scattered local state to a centralized Zustand store with automatic hydration via hooks. This eliminates the rehydration issue where workflow block previews showed IDs instead of names. Key Changes:
Impact:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant WB as WorkflowBlock
participant SBR as SubBlockRow
participant UDN as useDisplayName
participant UCD as useCredentialDisplay
participant DNS as DisplayNamesStore
participant API as API Endpoints
participant SEL as Selector Components
Note over WB,SEL: Initial Render Flow
WB->>SBR: Render with subBlock config + rawValue
SBR->>UCD: Check credential display (if oauth-input)
UCD->>DNS: Get cached credential name
alt Cache Miss
UCD->>API: GET /api/auth/oauth/credentials
API-->>UCD: Return credentials list
UCD->>DNS: setDisplayNames('credentials', provider, map)
end
DNS-->>UCD: Return display name
SBR->>UDN: Check generic display name (if other selector)
UDN->>DNS: Get cached display name by type + context
alt Cache Miss
alt Channel Selector
UDN->>API: POST /api/tools/slack/channels
else File Selector
UDN->>API: Provider-specific file endpoint
else Folder Selector
UDN->>API: Gmail/Outlook folders endpoint
else Project Selector
UDN->>API: Jira/Linear projects endpoint
else Document Selector
UDN->>API: GET /api/knowledge/{id}/documents
end
API-->>UDN: Return items list
UDN->>DNS: setDisplayNames(type, context, map)
end
DNS-->>UDN: Return display name
UDN-->>SBR: Return resolved name
SBR-->>WB: Display hydrated name
Note over SEL,DNS: Selector Component Flow
SEL->>API: Fetch items (on open/load)
API-->>SEL: Return items with id + name
SEL->>DNS: setDisplayNames(type, context, itemMap)
Note over DNS: Cache persists across renders
SEL->>SEL: Use cached display name for preview
|
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.
73 files reviewed, 1 comment
…e + access pattern via hook (#1881) * improvmenet(display-names-store): add displaynames store to map ids to human readable names for creds, etc * fix workflow in workflow * dot protection for secrets * hide from preview certain fields * fix rest of cases * fix confluence * fix type errors * remove redundant workflow dropdown code * remove comments * revert preview card * fix [object Object] bug * fix lint
…e + access pattern via hook (#1881) * improvmenet(display-names-store): add displaynames store to map ids to human readable names for creds, etc * fix workflow in workflow * dot protection for secrets * hide from preview certain fields * fix rest of cases * fix confluence * fix type errors * remove redundant workflow dropdown code * remove comments * revert preview card * fix [object Object] bug * fix lint
Summary
Preview should match Sidebar without odd rehydration.
Type of Change
Testing
Testing manually on staging environment.
Checklist