fix(events): ensure presenters and presentation-level files show correctly

- Harden 'ae_events__event_presenter.ts' to ensure both ID and ID_random fields are synced during refreshes.
- Update presenter list wrapper to use '_id_random' for reliable Dexie queries.
- Enable 'inc_all_file_li' and 'inc_file_li' in session loaders to pre-cache nested files.
- Introduce 'Launcher_presentation_view.svelte' to explicitly display files linked to presentations.
- Refactor presenter views to focus exclusively on speaker-specific files, avoiding UI duplication.
This commit is contained in:
Scott Idem
2026-02-03 19:19:11 -05:00
parent 0809ad3eac
commit 6abe4c897e
8 changed files with 103 additions and 15 deletions

View File

@@ -146,11 +146,11 @@
.then(function (result) {
console.log(result);
video_clip_file_kv[result.hosted_file_id_random] = {};
video_clip_file_kv[result.hosted_file_id_random] = result;
video_clip_file_kv[result.hosted_file_id] = {};
video_clip_file_kv[result.hosted_file_id] = result;
// $ae_loc.files.video_clip_file_kv[result.hosted_file_id_random] = {};
// $ae_loc.files.video_clip_file_kv[result.hosted_file_id_random] = result;
// $ae_loc.files.video_clip_file_kv[result.hosted_file_id] = {};
// $ae_loc.files.video_clip_file_kv[result.hosted_file_id] = result;
$ae_sess.files.processed_file_kv[hosted_file_id].submit_status = 'clipped';
$ae_sess.files.processed_file_kv[hosted_file_id].clip_complete = true;
@@ -203,7 +203,7 @@
);
}}
class="btn btn-sm preset-tonal-warning hover:preset-filled-warning-500"
title={`Remove this file from list of videos:\n${hosted_file_obj.filename}\n[API] SHA256: ${hosted_file_obj?.hash_sha256?.slice(0, 10)}... Hosted ID: ${hosted_file_obj.hosted_file_id_random}`}
title={`Remove this file from list of videos:\n${hosted_file_obj.filename}\n[API] SHA256: ${hosted_file_obj?.hash_sha256?.slice(0, 10)}... Hosted ID: ${hosted_file_obj.hosted_file_id}`}
>
<span class="fas fa-minus-circle m-1"></span>
<span class="">Remove</span>
@@ -229,7 +229,7 @@
>
<span>
<span class="text-sm font-bold"> File ID: </span>
{hosted_file_obj.hosted_file_id_random}</span
{hosted_file_obj.hosted_file_id}</span
>
<span>
<span class="text-sm font-bold"> Type: </span>
@@ -242,12 +242,12 @@
onsubmit={preventDefault(handle_clip_video)}
class="{class_li_default} {class_li}"
>
<!-- {$ae_sess?.files[hosted_file_obj?.hosted_file_id_random ?? 'obj'].submit_status ?? 'not set'} -->
<!-- {$ae_sess?.files[hosted_file_obj?.hosted_file_id ?? 'obj'].submit_status ?? 'not set'} -->
<input
type="hidden"
name="hosted_file_id"
value={hosted_file_obj.hosted_file_id_random}
value={hosted_file_obj.hosted_file_id}
/>
<div class="flex flex-row gap-1 justify-center items-center w-full">

View File

@@ -136,15 +136,35 @@ async function _refresh_presenter_li_background({ api_cfg, for_obj_type, for_obj
const processed = await process_ae_obj__event_presenter_props({ obj_li: result_li, log_lvl });
// String-Only ID Vision: Ensure linking ID is set for indexing
processed.forEach(p => {
if (for_obj_type === 'event_presentation') p.event_presentation_id = for_obj_id;
if (for_obj_type === 'event_session') p.event_session_id = for_obj_id;
if (for_obj_type === 'event') p.event_id = for_obj_id;
processed.forEach((p) => {
if (for_obj_type === 'event_presentation') {
p.event_presentation_id = for_obj_id;
p.event_presentation_id_random = for_obj_id;
}
if (for_obj_type === 'event_session') {
p.event_session_id = for_obj_id;
p.event_session_id_random = for_obj_id;
}
if (for_obj_type === 'event') {
p.event_id = for_obj_id;
p.event_id_random = for_obj_id;
}
});
if (try_cache) {
await db_save_ae_obj_li__ae_obj({ db_instance: db_events, table_name: 'presenter', obj_li: processed, properties_to_save, log_lvl });
}
// Background nested loads for refreshed items (FIRE AND FORGET)
if (inc_file_li) {
processed.forEach(p => {
load_ae_obj_li__event_file({
api_cfg, for_obj_type: 'event_presenter', for_obj_id: p.id,
enabled: 'all', limit: 25, try_cache: false, log_lvl: 0
});
});
}
return processed;
}
} catch (e) {}
@@ -297,4 +317,4 @@ export async function process_ae_obj__event_presenter_props({ obj_li, log_lvl =
if (obj.event_id_random) obj.event_id = obj.event_id_random;
return obj;
}});
}
}

View File

@@ -0,0 +1,61 @@
<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 } from '$lib/stores/ae_stores';
import { events_loc, events_sess } from '$lib/stores/ae_events_stores';
import Event_launcher_file_cont from './launcher_file_cont.svelte';
// 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}

View File

@@ -18,6 +18,7 @@
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
import Event_launcher_file_cont from './launcher_file_cont.svelte';
import Launcher_presentation_view from './launcher_presentation_view.svelte';
import Launcher_presenter_view from './launcher_presenter_view.svelte';
import Launcher_presenter_view_posters from './launcher_presenter_view_posters.svelte';
@@ -494,6 +495,9 @@
{/if}
</div>
<!-- Presentation-level files -->
<Launcher_presentation_view lq__event_presentation_obj={event_presentation_obj} />
<!-- The presenter list -->
{#if $lq__event_presenter_obj_li && $lq__event_presenter_obj_li.length}

View File

@@ -115,6 +115,7 @@
api_cfg: $ae_api,
event_session_id: event_session_id,
inc_file_li: true,
inc_all_file_li: true,
inc_presentation_li: true,
inc_presenter_li: true,
log_lvl: log_lvl

View File

@@ -33,7 +33,7 @@
// let ae_tmp: key_val = {};
// let ae_triggers: key_val = {};
let dq__where_type_id_val: string = `${link_to_type}_id`;
let dq__where_type_id_val: string = `${link_to_type}_id_random`;
let dq__where_eq_id_val: string = link_to_id;
// *** Functions and Logic
@@ -43,7 +43,7 @@
let results = await db_events.presenter
.where(dq__where_type_id_val)
.equals(dq__where_eq_id_val)
.sortBy('name');
.sortBy('full_name');
return results;
} else if (event_presenter_id_random_li.length > 0) {

View File

@@ -555,6 +555,7 @@
show_location_fields={true}
show_presentation_fields={true}
show_session_fields={true}
bind:show_direct_download={$events_loc.pres_mgmt.show__direct_download}
{hide_session_code}
></Comp_event_file_obj_tbl>
{/if}

View File

@@ -48,6 +48,7 @@ export async function load({ params, parent }) {
api_cfg: ae_acct.api,
for_obj_type: 'event_session',
for_obj_id: event_session_id,
inc_file_li: true,
inc_presenter_li: true,
enabled: 'all',
hidden: 'all',