Finally work on the Journals to fix some bugs. Now with much better append and prepend to Journal Entry.

This commit is contained in:
Scott Idem
2025-08-19 18:50:23 -04:00
parent ebaba77fe3
commit edfe9dee7a
6 changed files with 214 additions and 73 deletions

View File

@@ -430,7 +430,7 @@ async function handle_update_journal() {
<Modal
title="Edit Journal"
bind:open={$journals_sess.show__modal_edit__journal_obj}
autoclose={false}
autoclose={true}
placement="top-center"
size="xl"
class="top-center bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded-lg border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md relative flex flex-col mx-auto w-full divide-y"
@@ -570,6 +570,7 @@ async function handle_update_journal() {
<span class="text-sm text-gray-500 hidden sm:inline">
Journal Entry List Max Height:
</span>
{#if tmp_journal_obj?.cfg_json}
<select
bind:value={tmp_journal_obj.cfg_json.entry_li_max_height}
onchange={(event) => {
@@ -588,6 +589,7 @@ async function handle_update_journal() {
<option value="max-h-full">Full (no limit)</option>
</select>
{/if}
</div>
<!-- Select hover max height options (Tailwind CSS) -->
@@ -700,24 +702,24 @@ async function handle_update_journal() {
tmp_journal_obj.cfg_json.entry_add_text = 'append';
}
}}
class="btn btn-sm preset-tonal-secondary border border-secondary-500 hover:preset-filled-secondary-500 transition *:hover:inline"
title="Toggle visibility of Markdown copy button(s) on Journal Entry view page"
class="btn btn-sm preset-tonal-secondary border border-secondary-500 hover:preset-filled-secondary-500 transition group"
title="Toggle append or prepend text to Journal Entry content"
>
{#if tmp_journal_obj.cfg_json.entry_add_text == 'append'}
<!-- <EyeOff strokeWidth="1" color="red" /> -->
<ToggleLeft strokeWidth="1" color="red" class="mx-1" />
<ToggleRight strokeWidth="1" color="red" class="mx-1" />
<!-- <Plus strokeWidth="2.5" color="green" /> -->
<BetweenVerticalEnd strokeWidth="2.5" color="green" />
<span class="hidden">
<span class="hidden group-hover:inline">
Append
</span>
{:else}
<!-- <Eye strokeWidth="2.5" color="green" /> -->
<ToggleRight strokeWidth="2.5" color="green" class="mx-1" />
<ToggleLeft strokeWidth="2.5" color="green" class="mx-1" />
<!-- <Minus strokeWidth="2.5" color="green" /> -->
<BetweenVerticalStart strokeWidth="2.5" color="green" />
<span class="hidden">
<span class="hidden group-hover:inline">
Prepend
</span>
{/if}
@@ -1468,7 +1470,7 @@ async function handle_update_journal() {
</button>
<button
type="button"
onclick={$journals_sess.show__modal_edit__journal_obj ?? false}
onclick={() => (journals_sess.show__modal_edit__journal_obj = false)}
class="btn preset-tonal-surface border border-surface-500 hover:preset-filled-surface-500 transition"
>
<X />