mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 19:34:38 +00:00
feat(chat): append and display context_display_info custom entry for attached assets
This commit is contained in:
@@ -90,6 +90,24 @@ export function ChatbotSidebar({ projectId, contextAssetId }: ChatbotSidebarProp
|
||||
}
|
||||
|
||||
const renderMessage = (msg: ChatMessage) => {
|
||||
if (msg.role === 'custom' && (msg as { customType?: string }).customType === 'context_display_info') {
|
||||
const details = msg.details as { assets?: Array<{ id: string; name: string; type: string }> } | undefined
|
||||
const assets = details?.assets || []
|
||||
if (assets.length === 0) return null
|
||||
return (
|
||||
<div key={msg.id} className="text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1">
|
||||
<div className="font-semibold">{m.assets_added_to_context()}</div>
|
||||
<ul className="list-disc list-inside space-y-0.5">
|
||||
{assets.map((asset) => (
|
||||
<li key={asset.id} className="truncate">
|
||||
{asset.name} <span className="text-muted-foreground/70">({asset.type})</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const isUser = msg.role === 'user'
|
||||
const isAssistant = msg.role === 'assistant'
|
||||
const isTool = msg.role === 'toolResult'
|
||||
|
||||
Reference in New Issue
Block a user