mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
fix: resolve conflicts
This commit is contained in:
parent
9e64c2cccf
commit
33e0860468
@ -83,76 +83,78 @@ export const AssistantMessage = memo(
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="overflow-hidden w-full">
|
<div className="overflow-hidden w-full">
|
||||||
<div className=" flex gap-2 items-center text-sm text-bolt-elements-textSecondary mb-2">
|
<>
|
||||||
{(codeContext || chatSummary) && (
|
<div className=" flex gap-2 items-center text-sm text-bolt-elements-textSecondary mb-2">
|
||||||
<Popover side="right" align="start" trigger={<div className="i-ph:info" />}>
|
{(codeContext || chatSummary) && (
|
||||||
{chatSummary && (
|
<Popover side="right" align="start" trigger={<div className="i-ph:info" />}>
|
||||||
<div className="max-w-chat">
|
{chatSummary && (
|
||||||
<div className="summary max-h-96 flex flex-col">
|
<div className="max-w-chat">
|
||||||
<h2 className="border border-bolt-elements-borderColor rounded-md p4">Summary</h2>
|
<div className="summary max-h-96 flex flex-col">
|
||||||
<div style={{ zoom: 0.7 }} className="overflow-y-auto m4">
|
<h2 className="border border-bolt-elements-borderColor rounded-md p4">Summary</h2>
|
||||||
<Markdown>{chatSummary}</Markdown>
|
<div style={{ zoom: 0.7 }} className="overflow-y-auto m4">
|
||||||
</div>
|
<Markdown>{chatSummary}</Markdown>
|
||||||
</div>
|
|
||||||
{codeContext && (
|
|
||||||
<div className="code-context flex flex-col p4 border border-bolt-elements-borderColor rounded-md">
|
|
||||||
<h2>Context</h2>
|
|
||||||
<div className="flex gap-4 mt-4 bolt" style={{ zoom: 0.6 }}>
|
|
||||||
{codeContext.map((x) => {
|
|
||||||
const normalized = normalizedFilePath(x);
|
|
||||||
return (
|
|
||||||
<Fragment key={normalized}>
|
|
||||||
<code
|
|
||||||
className="bg-bolt-elements-artifacts-inlineCode-background text-bolt-elements-artifacts-inlineCode-text px-1.5 py-1 rounded-md text-bolt-elements-item-contentAccent hover:underline cursor-pointer"
|
|
||||||
onClick={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
openArtifactInWorkbench(normalized);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{normalized}
|
|
||||||
</code>
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{codeContext && (
|
||||||
|
<div className="code-context flex flex-col p4 border border-bolt-elements-borderColor rounded-md">
|
||||||
|
<h2>Context</h2>
|
||||||
|
<div className="flex gap-4 mt-4 bolt" style={{ zoom: 0.6 }}>
|
||||||
|
{codeContext.map((x) => {
|
||||||
|
const normalized = normalizedFilePath(x);
|
||||||
|
return (
|
||||||
|
<Fragment key={normalized}>
|
||||||
|
<code
|
||||||
|
className="bg-bolt-elements-artifacts-inlineCode-background text-bolt-elements-artifacts-inlineCode-text px-1.5 py-1 rounded-md text-bolt-elements-item-contentAccent hover:underline cursor-pointer"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
openArtifactInWorkbench(normalized);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{normalized}
|
||||||
|
</code>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="context"></div>
|
||||||
|
</Popover>
|
||||||
|
)}
|
||||||
|
<div className="flex w-full items-center justify-between">
|
||||||
|
{usage && (
|
||||||
|
<div>
|
||||||
|
Tokens: {usage.totalTokens} (prompt: {usage.promptTokens}, completion: {usage.completionTokens})
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{(onRewind || onFork) && messageId && (
|
||||||
|
<div className="flex gap-2 flex-col lg:flex-row ml-auto">
|
||||||
|
{onRewind && (
|
||||||
|
<WithTooltip tooltip="Revert to this message">
|
||||||
|
<button
|
||||||
|
onClick={() => onRewind(messageId)}
|
||||||
|
key="i-ph:arrow-u-up-left"
|
||||||
|
className="i-ph:arrow-u-up-left text-xl text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary transition-colors"
|
||||||
|
/>
|
||||||
|
</WithTooltip>
|
||||||
|
)}
|
||||||
|
{onFork && (
|
||||||
|
<WithTooltip tooltip="Fork chat from this message">
|
||||||
|
<button
|
||||||
|
onClick={() => onFork(messageId)}
|
||||||
|
key="i-ph:git-fork"
|
||||||
|
className="i-ph:git-fork text-xl text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary transition-colors"
|
||||||
|
/>
|
||||||
|
</WithTooltip>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="context"></div>
|
</div>
|
||||||
</Popover>
|
|
||||||
)}
|
|
||||||
<div className="flex w-full items-center justify-between">
|
|
||||||
{usage && (
|
|
||||||
<div>
|
|
||||||
Tokens: {usage.totalTokens} (prompt: {usage.promptTokens}, completion: {usage.completionTokens})
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{(onRewind || onFork) && messageId && (
|
|
||||||
<div className="flex gap-2 flex-col lg:flex-row ml-auto">
|
|
||||||
{onRewind && (
|
|
||||||
<WithTooltip tooltip="Revert to this message">
|
|
||||||
<button
|
|
||||||
onClick={() => onRewind(messageId)}
|
|
||||||
key="i-ph:arrow-u-up-left"
|
|
||||||
className="i-ph:arrow-u-up-left text-xl text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary transition-colors"
|
|
||||||
/>
|
|
||||||
</WithTooltip>
|
|
||||||
)}
|
|
||||||
{onFork && (
|
|
||||||
<WithTooltip tooltip="Fork chat from this message">
|
|
||||||
<button
|
|
||||||
onClick={() => onFork(messageId)}
|
|
||||||
key="i-ph:git-fork"
|
|
||||||
className="i-ph:git-fork text-xl text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary transition-colors"
|
|
||||||
/>
|
|
||||||
</WithTooltip>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
<Markdown append={append} chatMode={chatMode} setChatMode={setChatMode} model={model} provider={provider} html>
|
<Markdown append={append} chatMode={chatMode} setChatMode={setChatMode} model={model} provider={provider} html>
|
||||||
{content}
|
{content}
|
||||||
</Markdown>
|
</Markdown>
|
||||||
|
@ -370,8 +370,8 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
|
|||||||
append={append}
|
append={append}
|
||||||
chatMode={chatMode}
|
chatMode={chatMode}
|
||||||
setChatMode={setChatMode}
|
setChatMode={setChatMode}
|
||||||
model={model}
|
|
||||||
provider={provider}
|
provider={provider}
|
||||||
|
model={model}
|
||||||
/>
|
/>
|
||||||
) : null;
|
) : null;
|
||||||
}}
|
}}
|
||||||
|
@ -151,7 +151,7 @@ export const Markdown = memo(
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
text: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
|
text: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
|
||||||
},
|
},
|
||||||
] as any, // Type assertion to bypass compiler check
|
] as any,
|
||||||
role: 'user',
|
role: 'user',
|
||||||
});
|
});
|
||||||
console.log('Message appended:', message);
|
console.log('Message appended:', message);
|
||||||
@ -164,7 +164,7 @@ export const Markdown = memo(
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
text: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
|
text: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
|
||||||
},
|
},
|
||||||
] as any, // Type assertion to bypass compiler check
|
] as any,
|
||||||
role: 'user',
|
role: 'user',
|
||||||
});
|
});
|
||||||
} else if (type === 'link' && typeof href === 'string') {
|
} else if (type === 'link' && typeof href === 'string') {
|
||||||
|
Loading…
Reference in New Issue
Block a user