From d23f9073c4c90474e8aaa359194fb7f94b5a1922 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 16 Jun 2026 18:14:14 -0400 Subject: [PATCH] feat(pres_mgmt): automate Session POC loading and enhance field editor UX - Updated Element_ae_obj_field_editor_new.svelte with on_open callback support. - Improved Select field UX in the editor with an inline loading spinner when options are empty. - Streamlined session_view.svelte by using on_open to trigger person record loading automatically. - Removed redundant manual 'Select Person' button in favor of automated lazy-loading. --- .../element_ae_obj_field_editor_new.svelte | 36 +++++---- .../session/[session_id]/session_view.svelte | 77 +++++++++---------- 2 files changed, 61 insertions(+), 52 deletions(-) diff --git a/src/lib/elements/element_ae_obj_field_editor_new.svelte b/src/lib/elements/element_ae_obj_field_editor_new.svelte index 33b18fa2..e9282797 100644 --- a/src/lib/elements/element_ae_obj_field_editor_new.svelte +++ b/src/lib/elements/element_ae_obj_field_editor_new.svelte @@ -155,7 +155,6 @@ function coerce_select_value(raw: string, reference: T): any { } // Internal State -// is_editing is a $bindable prop (declared above) — not a local $state. let patch_status = $state<'idle' | 'processing' | 'success' | 'error'>('idle'); let error_message = $state(''); let draft_value = $state(to_input_value(current_value, field_type)); @@ -244,6 +243,7 @@ function toggle_edit() { has_optimistic = false; draft_value = to_input_value(current_value, field_type); is_editing = true; + if (on_open) on_open(); } } @@ -329,19 +329,29 @@ function handle_keydown(e: KeyboardEvent) { class="textarea" {placeholder}> {:else if field_type === 'select'} - draft_value = coerce_select_value(e.currentTarget.value, current_value)} + class="select pr-10"> + {#if allow_null} + + {/if} + {#if Object.keys(select_options).length === 0} + + {/if} + {#each Object.entries(select_options) as [val, label] (val)} + + {/each} + + {#if Object.keys(select_options).length === 0} +
+ +
{/if} - {#each Object.entries(select_options) as [val, label] (val)} - - {/each} - + {:else if field_type === 'checkbox'}