perf(launcher): implement staggered data loading for sessions and presentations

- Optimized session list load to be shell-only, preventing initial request storms.\n- Moved deep data fetching (presenters/files) into the Presentation component level using Svelte effects.\n- Deferred child collection lookups until components are rendered in the DOM.\n- Fixed ae_api import in launcher_presentation_view.\n- Hardened background refresh logic to respect requested views.
This commit is contained in:
Scott Idem
2026-02-10 17:30:30 -05:00
parent 8a05e48514
commit be53e12d63
4 changed files with 51 additions and 6 deletions

View File

@@ -53,10 +53,10 @@ export async function load({ params, parent, url }) {
api_cfg: ae_acct.api,
for_obj_type: 'event_location',
for_obj_id: event_location_id,
inc_file_li: true,
inc_all_file_li: true,
inc_presentation_li: true,
inc_presenter_li: true,
inc_file_li: false, // Optimized: Shell load for lists
inc_all_file_li: false,
inc_presentation_li: false, // Optimized: Shell load for lists
inc_presenter_li: false,
enabled: 'enabled',
hidden: 'all',
view: 'alt', // Standardized View for file counts and extended metadata
@@ -69,6 +69,22 @@ export async function load({ params, parent, url }) {
);
}
const session_id = url.searchParams.get('session_id');
if (browser && session_id) {
if (log_lvl) console.log(`Triggering deep load for session_id: ${session_id}`);
events_func.load_ae_obj_id__event_session({
api_cfg: ae_acct.api,
event_session_id: session_id,
inc_file_li: true,
inc_all_file_li: true,
inc_presentation_li: true,
inc_presenter_li: true,
view: 'alt',
try_cache: true,
log_lvl: 0
});
}
// WARNING: Precaution against shared data between sites and sessions.
data[account_id] = ae_acct;

View File

@@ -7,10 +7,26 @@
import { liveQuery } from 'dexie';
import { db_events } from '$lib/ae_events/db_events';
import { ae_loc } from '$lib/stores/ae_stores';
import { ae_loc, ae_api } from '$lib/stores/ae_stores';
import { events_loc, events_sess } from '$lib/stores/ae_events_stores';
import { events_func } from '$lib/ae_events_functions';
import Event_launcher_file_cont from './launcher_file_cont.svelte';
// Staggered Load: Trigger deep fetch only when component is active
$effect(() => {
const id = lq__event_presentation_obj?.event_presentation_id;
if (id) {
events_func.load_ae_obj_id__event_presentation({
api_cfg: $ae_api,
event_presentation_id: id,
inc_file_li: true,
inc_presenter_li: true,
try_cache: true,
log_lvl: 0
});
}
});
// Event File (Directly linked to presentation)
let lq__event_file_obj_li = $derived(
liveQuery(async () => {