enh: copy formatted option

Co-Authored-By: Sebastian Whincop <123417897+macjedi42@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2025-04-14 01:56:15 -07:00
parent 95fca7b700
commit aa8db40376
3 changed files with 150 additions and 32 deletions

View File

@@ -43,6 +43,7 @@
let chatBubble = true;
let chatDirection: 'LTR' | 'RTL' | 'auto' = 'auto';
let ctrlEnterToSend = false;
let copyFormatted = false;
let collapseCodeBlocks = false;
let expandDetails = false;
@@ -220,6 +221,11 @@
}
};
const toggleCopyFormatted = async () => {
copyFormatted = !copyFormatted;
saveSettings({ copyFormatted });
};
const toggleChangeChatDirection = async () => {
if (chatDirection === 'auto') {
chatDirection = 'LTR';
@@ -275,6 +281,7 @@
richTextInput = $settings.richTextInput ?? true;
promptAutocomplete = $settings.promptAutocomplete ?? false;
largeTextAsFile = $settings.largeTextAsFile ?? false;
copyFormatted = $settings.copyFormatted ?? false;
collapseCodeBlocks = $settings.collapseCodeBlocks ?? false;
expandDetails = $settings.expandDetails ?? false;
@@ -670,6 +677,28 @@
</div>
</div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs">
{$i18n.t('Copy Formatted Text')}
</div>
<button
class="p-1 px-3 text-xs flex rounded-sm transition"
on:click={() => {
toggleCopyFormatted();
}}
type="button"
>
{#if copyFormatted === true}
<span class="ml-2 self-center">{$i18n.t('On')}</span>
{:else}
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
{/if}
</button>
</div>
</div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs">{$i18n.t('Always Collapse Code Blocks')}</div>