From 283053e4a4a6a26b32d4118937a879493eee7401 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 14 Jan 2026 14:35:55 -0500 Subject: [PATCH] feat(journals): stabilize V3 API integration and restore cryptographic toggles --- .../ae_comp__journal_entry_obj_id_view.svelte | 718 +++++------------- .../ae_comp__journal_obj_id_view.svelte | 23 +- 2 files changed, 217 insertions(+), 524 deletions(-) diff --git a/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte b/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte index ea5a94c2..dc222965 100644 --- a/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte +++ b/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte @@ -1,37 +1,32 @@ -
+
{#if $lq__journal_entry_obj} {}} onChangeJournal={change_journal_id} - onAppend={handle_append_start} - onPrepend={handle_prepend_start} + onAppend={() => { modal_mode = 'append'; show_append_modal = true; }} + onPrepend={() => { modal_mode = 'prepend'; show_append_modal = true; }} {onShowExport} {save_status} {log_lvl} /> + {#if decryption_error} +
+
+ + {decryption_error} +
+ +
+ {/if} -
- +
+
{ - $journals_loc.llm__api_base_url = $ae_loc.site_cfg_json?.llm__api_base_url ?? 'https://ai.dgrzone.com/api'; - $journals_loc.llm__api_model = $ae_loc.site_cfg_json?.llm__api_model ?? 'dgrzone-deepseek-8b-quick'; - $journals_loc.llm__api_token = $ae_loc.site_cfg_json?.llm__api_token ?? ''; - $journals_loc.entry.llm__system_prompt = $ae_loc.site_cfg_json?.llm__system_prompt ?? ''; - }} {log_lvl} />
- - - - - - - {#if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'history'} -
- {#if $journals_sess?.show__content__journal_entry_history == 'view'} - - {:else if $journals_sess?.show__content__journal_entry_history == 'edit'} - - {/if} -
- {/if}
@@ -643,17 +329,13 @@ journal_config={$lq__journal_obj?.cfg_json} mode={modal_mode} onClose={() => (show_append_modal = false)} - onUpdate={() => { - show_append_modal = false; - updated_obj = true; // Force refresh of the view - }} + onUpdate={() => { show_append_modal = false; updated_obj = true; }} {log_lvl} /> {:else} -
- - The Journal Entry was not found or is not available to show. - -
+
+ + Loading Journal Entry... +
{/if} -
+
\ No newline at end of file diff --git a/src/routes/journals/ae_comp__journal_obj_id_view.svelte b/src/routes/journals/ae_comp__journal_obj_id_view.svelte index 2926c995..88264e43 100644 --- a/src/routes/journals/ae_comp__journal_obj_id_view.svelte +++ b/src/routes/journals/ae_comp__journal_obj_id_view.svelte @@ -68,7 +68,15 @@ } return; } - console.log('Setting passcode timer'); + + // Use journal.passcode_timeout (assuming it's in minutes, default to 5) + const timeout_minutes = $lq__journal_obj?.passcode_timeout ?? 5; + const timeout_ms = 1000 * 60 * timeout_minutes; + + if (log_lvl) { + console.log(`Setting passcode timer for ${timeout_minutes} minutes (${timeout_ms}ms)`); + } + passcode_timer = setTimeout( () => { if (log_lvl) { @@ -78,12 +86,15 @@ if (!$journals_sess?.journal_kv[$lq__journal_obj?.id]) { $journals_sess.journal_kv[$lq__journal_obj?.id] = {}; } - $journals_sess.journal_kv[$lq__journal_obj?.id].journal_passcode_verified = - false; + + // Reset verification and decryption flags + $journals_sess.journal_kv[$lq__journal_obj?.id].journal_passcode_verified = false; + $journals_sess.journal_kv[$lq__journal_obj?.id].journal_passcode_decrypted = false; + + passcode_timer = null; }, - 1000 * 60 * 1 - ); // 1 minutes - // }, 1000 * $lq__journal_obj?.passcode_timeout); // 5 minutes + timeout_ms + ); } });