Show AI tools only in edit mode; open existing summary without regenerating
- Hide AI tools panel when entry is not in edit mode - Clicking AI button when a summary already exists opens it directly instead of triggering a new API call; Re-run still available in modal Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -157,9 +157,17 @@ function handle_save() {
|
||||
<!-- Trigger Button -->
|
||||
<button
|
||||
type="button"
|
||||
onclick={generate_ai_result}
|
||||
onclick={() => {
|
||||
if (summary) {
|
||||
tmp_summary = summary;
|
||||
active_tab = 'result';
|
||||
show_modal = true;
|
||||
} else {
|
||||
generate_ai_result();
|
||||
}
|
||||
}}
|
||||
class={buttonClass}
|
||||
title="Generate AI summary/analysis">
|
||||
title={summary ? 'View existing AI summary' : 'Generate AI summary/analysis'}>
|
||||
{#await ae_promises}
|
||||
<Loader class="mr-1 inline-block animate-spin" size="1.2em" />
|
||||
<span class="text-sm">Processing...</span>
|
||||
|
||||
Reference in New Issue
Block a user