Uh oh!
There was an error while loading. Please reload this page.
improvement(home): consolidate chat context kind icon registry - #4397
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Refactors Reviewed by Cursor Bugbot for commit 13409d7. Configure here. |
Greptile SummaryThis PR consolidates chip icon/label logic into a new The PR also ships two genuine bug fixes: the missing Confidence Score: 5/5Safe to merge — clean refactor with exhaustiveness improvements and two bug fixes, no regressions identified. All changed code is narrowly scoped to icon/label rendering and resource-to-context mapping. The Record-typed registries enforce exhaustiveness at compile time and match all current union members. No P0/P1 issues found; the previously debated runtime fallback question was thoroughly resolved in the thread. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["ContextMentionIcon\n(context: ChatMessageContext)"] --> B["CHAT_CONTEXT_KIND_REGISTRY[context.kind]"]
B --> C{kind}
C --> D["workflow / current_workflow /\nworkflow_block → renderWorkflowSquare"]
C --> E["knowledge → Database icon"]
C --> F["table → TableIcon"]
C --> G["file → getDocumentIcon"]
C --> H["folder → FolderIcon"]
C --> I["past_chat → Blimp"]
C --> J["logs → Library icon ✅ (bug fix)"]
C --> K["blocks / templates /\ndocs / slash_command → null"]
L["mapResourceToContext(resource)"] --> M["RESOURCE_TO_CONTEXT[resource.type]"]
M --> N{MothershipResourceType}
N --> O["workflow → kind:'workflow'"]
N --> P["knowledgebase → kind:'knowledge'"]
N --> Q["table / file / folder"]
N --> R["task → kind:'past_chat'"]
N --> S["log → kind:'logs' + executionId ✅ (bug fix)"]
N --> T["generic → kind:'docs'"]
Reviews (2): Last reviewed commit: "revert(home): drop unneeded mapResourceT..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.
waleedlatif1
commented
May 2, 2026
waleedlatif1
commented
May 2, 2026
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 13409d7. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Summary
CHAT_CONTEXT_KIND_REGISTRYkeyed byChatContextKindas the single source of truth for chip icon/label; theRecord<ChatContextKind, …>typing makes it a compile error to add a new kind without an icon entrymapResourceToContextwith a typedRecord<MothershipResourceType, …>map; also wires the previously missinglog → logsconversion so logs chips carry an executionIdType of Change
Testing
Tested manually — @-mention each resource type (workflow, knowledge, table, file, folder, past chat, logs) and confirmed each chip renders the correct icon.
Checklist