refac
This commit is contained in:
1 parent
cf887b68ea
commit
73421c5b42
8 files changed
+103
-21
No files matched your search
@@ -39,6 +39,7 @@
|
||||
export let mergeResponses;
|
||||
|
||||
export let addMessages;
|
||||
export let forkHandler: Function | null = null;
|
||||
export let triggerScroll;
|
||||
export let readOnly = false;
|
||||
export let editCodeBlock = true;
|
||||
@@ -97,6 +98,7 @@
|
||||
{continueResponse}
|
||||
{regenerateResponse}
|
||||
{addMessages}
|
||||
{forkHandler}
|
||||
{readOnly}
|
||||
{editCodeBlock}
|
||||
{topPadding}
|
||||
@@ -122,6 +124,7 @@
|
||||
{mergeResponses}
|
||||
{triggerScroll}
|
||||
{addMessages}
|
||||
{forkHandler}
|
||||
{readOnly}
|
||||
{editCodeBlock}
|
||||
{topPadding}
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
export let mergeResponses: Function;
|
||||
|
||||
export let addMessages: Function;
|
||||
export let forkHandler: Function | null = null;
|
||||
|
||||
export let triggerScroll: Function;
|
||||
|
||||
@@ -319,6 +320,7 @@
|
||||
groupedMessageIds[selectedModelIdx].messageIds.length - 1;
|
||||
}}
|
||||
{addMessages}
|
||||
{forkHandler}
|
||||
{readOnly}
|
||||
{topPadding}
|
||||
{onInsertToNote}
|
||||
@@ -376,6 +378,7 @@
|
||||
groupedMessageIds[modelIdx].messageIds.length - 1;
|
||||
}}
|
||||
{addMessages}
|
||||
{forkHandler}
|
||||
{readOnly}
|
||||
{editCodeBlock}
|
||||
{topPadding}
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
export let submitMessage: Function;
|
||||
export let continueResponse: Function;
|
||||
export let regenerateResponse: Function;
|
||||
export let forkHandler: Function | null = null;
|
||||
|
||||
export let addMessages: Function;
|
||||
|
||||
@@ -1054,6 +1055,37 @@
|
||||
</button>
|
||||
</Tooltip>
|
||||
|
||||
{#if message.done && !readOnly && forkHandler}
|
||||
<Tooltip content="Fork chat" placement="bottom">
|
||||
<button
|
||||
aria-label="Fork chat"
|
||||
class="{isLastMessage || ($settings?.highContrastMode ?? false)
|
||||
? 'visible'
|
||||
: 'invisible group-hover:visible'} p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg dark:hover:text-white hover:text-black transition"
|
||||
on:click={() => {
|
||||
forkHandler?.(message.id);
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
class="w-4 h-4"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.8"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path d="M4 12H9" />
|
||||
<path d="M9 12C12.5 12 12.5 7 16 7H20" />
|
||||
<path d="M17 4L20 7L17 10" />
|
||||
<path d="M9 12C12.5 12 12.5 17 16 17H20" />
|
||||
<path d="M17 14L20 17L17 20" />
|
||||
</svg>
|
||||
</button>
|
||||
</Tooltip>
|
||||
{/if}
|
||||
|
||||
{#if onInsertToNote && visibleResponseContent}
|
||||
<Tooltip content={$i18n.t('Insert into note')} placement="bottom">
|
||||
<button
|
||||
|
||||
Reference in new issue
Block a user