feat/enh: insert prompt as rich text

This commit is contained in:
Timothy Jaeryang Baek
2025-07-07 21:43:28 +04:00
parent ade4b0d691
commit 5722da8e3b
3 changed files with 107 additions and 38 deletions
@@ -38,6 +38,7 @@
let detectArtifacts = true;
let richTextInput = true;
let insertPromptAsRichText = false;
let promptAutocomplete = false;
let largeTextAsFile = false;
@@ -218,6 +219,11 @@
saveSettings({ richTextInput });
};
const toggleInsertPromptAsRichText = async () => {
insertPromptAsRichText = !insertPromptAsRichText;
saveSettings({ insertPromptAsRichText });
};
const toggleLargeTextAsFile = async () => {
largeTextAsFile = !largeTextAsFile;
saveSettings({ largeTextAsFile });
@@ -308,7 +314,9 @@
voiceInterruption = $settings?.voiceInterruption ?? false;
richTextInput = $settings?.richTextInput ?? true;
insertPromptAsRichText = $settings?.insertPromptAsRichText ?? false;
promptAutocomplete = $settings?.promptAutocomplete ?? false;
largeTextAsFile = $settings?.largeTextAsFile ?? false;
copyFormatted = $settings?.copyFormatted ?? false;
@@ -761,22 +769,22 @@
</div>
</div>
{#if $config?.features?.enable_autocomplete_generation && richTextInput}
{#if richTextInput}
<div>
<div class=" py-0.5 flex w-full justify-between">
<div id="prompt-autocompletion-label" class=" self-center text-xs">
{$i18n.t('Prompt Autocompletion')}
<div id="rich-input-label" class=" self-center text-xs">
{$i18n.t('Insert Prompt as Rich Text')}
</div>
<button
aria-labelledby="prompt-autocompletion-label"
aria-labelledby="rich-input-label"
class="p-1 px-3 text-xs flex rounded-sm transition"
on:click={() => {
togglePromptAutocomplete();
toggleInsertPromptAsRichText();
}}
type="button"
>
{#if promptAutocomplete === true}
{#if insertPromptAsRichText === true}
<span class="ml-2 self-center">{$i18n.t('On')}</span>
{:else}
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
@@ -784,6 +792,31 @@
</button>
</div>
</div>
{#if $config?.features?.enable_autocomplete_generation}
<div>
<div class=" py-0.5 flex w-full justify-between">
<div id="prompt-autocompletion-label" class=" self-center text-xs">
{$i18n.t('Prompt Autocompletion')}
</div>
<button
aria-labelledby="prompt-autocompletion-label"
class="p-1 px-3 text-xs flex rounded-sm transition"
on:click={() => {
togglePromptAutocomplete();
}}
type="button"
>
{#if promptAutocomplete === 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>
{/if}
{/if}
<div>