From cfaf687717770879820be823ceced3a3ae0b46ec Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Wed, 27 May 2026 21:41:32 -0400 Subject: [PATCH] fix(events): event location file load on mount + launcher pruning scope fix + remove legacy launcher btn - Location page now calls load_ae_obj_li__event_file on mount so files appear immediately without requiring a manual Refresh press. - _load_event_location_sub_data (Launcher 60s sync) now uses hidden='all' with default limit (100) instead of hidden='not_hidden'/limit=25, which was pruning valid Dexie records when Pres Mgmt and Launcher were both open on the same location simultaneously. - Removed the legacy launcher button (Send icon, /event/ path) from the Locations list; removed unused Send icon import. Co-Authored-By: Claude Sonnet 4.6 --- src/lib/ae_events/ae_events__event_location.ts | 2 +- .../location/[event_location_id]/+page.svelte | 16 ++++++++++++++++ .../ae_comp__event_location_obj_li.svelte | 11 +---------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/lib/ae_events/ae_events__event_location.ts b/src/lib/ae_events/ae_events__event_location.ts index 61e884de..e4b04199 100644 --- a/src/lib/ae_events/ae_events__event_location.ts +++ b/src/lib/ae_events/ae_events__event_location.ts @@ -357,7 +357,7 @@ async function _handle_nested_loads( for_obj_type: 'event_location', for_obj_id: current_location_id, enabled: 'all', - limit: 25, + hidden: 'all', log_lvl }).then((res) => (location_obj.event_file_li = res)) ); diff --git a/src/routes/events/[event_id]/(pres_mgmt)/location/[event_location_id]/+page.svelte b/src/routes/events/[event_id]/(pres_mgmt)/location/[event_location_id]/+page.svelte index 0975fa5c..1f4da455 100644 --- a/src/routes/events/[event_id]/(pres_mgmt)/location/[event_location_id]/+page.svelte +++ b/src/routes/events/[event_id]/(pres_mgmt)/location/[event_location_id]/+page.svelte @@ -29,6 +29,7 @@ import { events_trigger, events_trig_kv } from '$lib/stores/ae_events_stores'; +import { events_func } from '$lib/ae_events/ae_events_functions'; import Comp_event_files_upload from '../../../../ae_comp__event_files_upload.svelte'; import Comp_event_session_obj_li from '../../../../ae_comp__event_session_obj_li.svelte'; @@ -64,6 +65,21 @@ $effect(() => { }); }); +// WHY: Dexie starts empty on first load — liveQuery returns nothing until files are fetched. +// The upload component and refresh button are targeted, but nothing triggers the initial load. +$effect(() => { + const location_id = ae_acct?.slct?.event_location_id; + if (!location_id || !$ae_api) return; + events_func.load_ae_obj_li__event_file({ + api_cfg: $ae_api, + for_obj_type: 'event_location', + for_obj_id: location_id, + enabled: 'all', + hidden: 'all', + try_cache: true + }); +}); + let lq__event_obj = $derived( liveQuery(async () => { if (!ae_acct?.slct.event_id) return null; diff --git a/src/routes/events/[event_id]/(pres_mgmt)/locations/ae_comp__event_location_obj_li.svelte b/src/routes/events/[event_id]/(pres_mgmt)/locations/ae_comp__event_location_obj_li.svelte index fa1c0416..efb3e482 100644 --- a/src/routes/events/[event_id]/(pres_mgmt)/locations/ae_comp__event_location_obj_li.svelte +++ b/src/routes/events/[event_id]/(pres_mgmt)/locations/ae_comp__event_location_obj_li.svelte @@ -49,7 +49,6 @@ import { MapPinned, Plane, Plus, - Send, TriangleAlert } from '@lucide/svelte'; // if (log_lvl) { @@ -187,15 +186,7 @@ if (!pres_mgmt_loc.current.location_kv) { - - - - - -