mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 02:33:38 +00:00
Copy the sources of an answer along with it
This commit is contained in:
parent
efac4d57f1
commit
a5bdf8f532
@ -61,6 +61,11 @@ public partial class MudCopyClipboardButton : ComponentBase
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Copy this block's content to the clipboard.
|
/// Copy this block's content to the clipboard.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The user copies what the card shows, and the card shows the answer together with the sources
|
||||||
|
/// AI Studio collected for it. Pasting the answer into a mail without them would leave the
|
||||||
|
/// reader with claims nobody is able to check.
|
||||||
|
/// </remarks>
|
||||||
private async Task CopyToClipboard(IContent? contentToCopy)
|
private async Task CopyToClipboard(IContent? contentToCopy)
|
||||||
{
|
{
|
||||||
if (contentToCopy is null)
|
if (contentToCopy is null)
|
||||||
@ -68,9 +73,8 @@ public partial class MudCopyClipboardButton : ComponentBase
|
|||||||
|
|
||||||
switch (this.Type)
|
switch (this.Type)
|
||||||
{
|
{
|
||||||
case ContentType.TEXT:
|
case ContentType.TEXT when contentToCopy.TryGetExportMarkdown(out var markdown):
|
||||||
var textContent = (ContentText) contentToCopy;
|
await this.RustService.CopyText2Clipboard(markdown);
|
||||||
await this.RustService.CopyText2Clipboard(textContent.Text);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user