improvement(display-names): move display name mapping to central store + access pattern via hook#1881
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
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
|
waleedlatif1
pushed a commit
that referenced
this pull request
Nov 12, 2025
…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
waleedlatif1
pushed a commit
that referenced
this pull request
Nov 12, 2025
…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
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
Preview should match Sidebar without odd rehydration.
Type of Change
Testing
Testing manually on staging environment.
Checklist