Files
OSIT-AE-App-Svelte/src/routes/events/[event_id]/(launcher)/launcher_presentation_view.svelte
Scott Idem be53e12d63 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.
2026-02-10 17:30:30 -05:00

86 lines
3.3 KiB
Svelte

<script lang="ts">
interface Props {
lq__event_presentation_obj: any;
}
let { lq__event_presentation_obj }: Props = $props();
import { liveQuery } from 'dexie';
import { db_events } from '$lib/ae_events/db_events';
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 () => {
if (!lq__event_presentation_obj?.event_presentation_id) return [];
let results = await db_events.file
.where('for_id')
.equals(lq__event_presentation_obj.event_presentation_id)
.reverse()
.sortBy('created_on');
return results;
})
);
</script>
{#if $lq__event_file_obj_li && $lq__event_file_obj_li.length}
<section class="event_presentation_file_list my-1">
<div
class="text-[10px] text-surface-600-400 uppercase font-bold tracking-wider opacity-70"
>
Presentation Files:
</div>
<ul class="space-y-1">
{#each $lq__event_file_obj_li as event_file_obj}
<li
class="flex flex-col md:flex-row flex-wrap gap-1 items-center justify-start"
class:hidden={!$events_loc.launcher
.show_content__hidden_files && event_file_obj.hide}
>
<Event_launcher_file_cont
event_file_id={event_file_obj.event_file_id}
{event_file_obj}
hide_created_on={false}
bind:hide_draft={
$events_loc.launcher.hide_content__draft_files
}
show_bak_download={$ae_loc.trusted_access}
session_type={event_file_obj?.event_session_type_code ??
'oral'}
open_method={event_file_obj?.event_session_type_code ==
'poster'
? 'modal'
: null}
modal_title={lq__event_presentation_obj?.name}
bind:modal__title={$events_sess.launcher.modal__title}
bind:modal__open_event_file_id={
$events_sess.launcher.modal__open_event_file_id
}
bind:modal__event_file_obj={
$events_sess.launcher.modal__event_file_obj
}
/>
</li>
{/each}
</ul>
</section>
{/if}