Skip to content

improvement(home): consolidate chat context kind icon registry#4397

Merged
waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1/logs-resource-icon
May 2, 2026
Merged

improvement(home): consolidate chat context kind icon registry#4397
waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1/logs-resource-icon

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add CHAT_CONTEXT_KIND_REGISTRY keyed by ChatContextKind as the single source of truth for chip icon/label; the Record<ChatContextKind, …> typing makes it a compile error to add a new kind without an icon entry
  • Fix missing book icon on logs resource chips in the home user-input
  • Replace the switch in mapResourceToContext with a typed Record<MothershipResourceType, …> map; also wires the previously missing log → logs conversion so logs chips carry an executionId

Type of Change

  • Bug fix
  • Improvement

Testing

Tested manually — @-mention each resource type (workflow, knowledge, table, file, folder, past chat, logs) and confirmed each chip renders the correct icon.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 2, 2026 5:17am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 2, 2026

PR Summary

Low Risk
Low risk UI/typing refactor; main behavior change is adding explicit loglogs context mapping (with executionId) which could affect how log chips render/behave if any downstream expects the old default docs mapping.

Overview
Introduces a typed CHAT_CONTEXT_KIND_REGISTRY as the single source of truth for context-chip labels/icons (including adding the missing logs/Library icon) and updates ContextMentionIcon to render via this registry.

Refactors mapResourceToContext to a Record<MothershipResourceType, …> conversion map, and fixes the previously missing log resource mapping so log mentions become logs contexts carrying an executionId.

Reviewed by Cursor Bugbot for commit 13409d7. Configure here.