Launcher: Resolved session selection hang and improved reactivity pattern.

This commit is contained in:
Scott Idem
2026-02-11 17:18:55 -05:00
parent cda7a5421c
commit 7549749d14
4 changed files with 95 additions and 189 deletions

View File

@@ -78,18 +78,30 @@
};
}
// Unified Selection Sync (Refactored 2026-02-11)
// WHY: We track URL params directly to ensure the UI reacts instantly to navigation.
// We use untrack for store writes to prevent circular dependency loops.
$effect(() => {
if (log_lvl) {
console.log(`event_id: ${data.params.event_id}`);
console.log(`event_location_id: ${data.params.event_location_id}`);
console.log(
`event_session_id: ${data.url.searchParams.get('session_id')}`
);
const url_session_id = data.url.searchParams.get('session_id');
const path_location_id = data.params.event_location_id;
const path_event_id = data.params.event_id;
if (log_lvl > 1) {
console.log(`[Launcher Sync] URL Change: event=${path_event_id}, loc=${path_location_id}, sess=${url_session_id}`);
}
untrack(() => {
$events_slct.event_id = data.params.event_id;
$events_slct.event_location_id = data.params.event_location_id;
$events_slct.event_session_id = data.url.searchParams.get('session_id');
if ($events_slct.event_id !== path_event_id) {
$events_slct.event_id = path_event_id;
}
if ($events_slct.event_location_id !== path_location_id) {
$events_slct.event_location_id = path_location_id;
}
// CRITICAL: Ensure session_id is synced to store so LiveQueries react
if ($events_slct.event_session_id !== url_session_id) {
if (log_lvl) console.log(`[Launcher Sync] Updating store session_id: ${url_session_id}`);
$events_slct.event_session_id = url_session_id;
}
});
});
@@ -570,11 +582,9 @@
</div>
{/if}
{#if $events_slct.event_session_id && $lq__event_session_obj}
{#if $events_slct.event_session_id}
<Launcher_session_view
bind:slct__event_session_id={$events_slct.event_session_id}
{lq__event_session_obj}
bind:type_code={$lq__event_session_obj.type_code}
></Launcher_session_view>
{:else if $events_slct.event_session_id}
<div