fix(journals): resolve AI tools ReferenceError and finalize modularization

- Corrected template usage to 'JournalEntry_AITools'.
- Finalized Chunk 3: Modularized AI tools wrapper.
This commit is contained in:
Scott Idem
2026-01-14 16:52:00 -05:00
parent bb3e4f4095
commit cd0702b8cc
2 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
<script lang="ts">
/**
* JournalEntry_AITools.svelte
* Journal-specific wrapper for the generic AE_AITools.
* Handles layout/positioning and specific save behavior for journal entries.
*/
import AE_AITools from '$lib/ae_elements/AE_AITools.svelte';
interface Props {
content: string;
summary: string; // Bindable
onSave: () => void;
log_lvl?: number;
}
let {
content,
summary = $bindable(),
onSave,
log_lvl = 0
}: Props = $props();
</script>
<div class="journal-entry-ai-tools absolute top-2 right-2 z-10">
<AE_AITools
{content}
bind:summary={summary}
onSave={(newSummary) => {
summary = newSummary;
onSave();
}}
{log_lvl}
/>
</div>

View File

@@ -363,7 +363,7 @@
class:bg-yellow-50={$journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'current'}>
<div class="absolute top-2 right-2 z-10">
<AE_AITools
<JournalEntry_AITools
content={tmp_entry_obj.content}
bind:summary={tmp_entry_obj.summary}
onSave={update_journal_entry}