diff --git a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_create_form.svelte b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_create_form.svelte
index 5261c6a5..8c17586b 100644
--- a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_create_form.svelte
+++ b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_create_form.svelte
@@ -40,7 +40,7 @@
];
async function handle_submit(event: Event) {
- event.prevent_default();
+ event.preventDefault();
submit_status = 'loading';
const data_to_create: key_val = {
full_name_override,
diff --git a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_upload_form.svelte b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_upload_form.svelte
index ac9e7868..b05aabbc 100644
--- a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_upload_form.svelte
+++ b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_upload_form.svelte
@@ -48,7 +48,7 @@
}
async function handle_upload(event: Event) {
- event.prevent_default();
+ event.preventDefault();
if (!selected_file) {
upload_message = 'Please select a file first.';
upload_status = 'error';
diff --git a/src/routes/events/[event_id]/+page.svelte b/src/routes/events/[event_id]/+page.svelte
index ca44d7ee..27eedc78 100644
--- a/src/routes/events/[event_id]/+page.svelte
+++ b/src/routes/events/[event_id]/+page.svelte
@@ -45,15 +45,24 @@
// *** Initialization & Store Guard ***
if ($events_loc.pres_mgmt) {
- if (typeof $events_loc.pres_mgmt.search_version === 'undefined') $events_loc.pres_mgmt.search_version = 0;
- if (typeof $events_loc.pres_mgmt.qry__remote_first === 'undefined') $events_loc.pres_mgmt.qry__remote_first = false;
- if (typeof $events_loc.pres_mgmt.fulltext_search_qry_str === 'undefined') $events_loc.pres_mgmt.fulltext_search_qry_str = '';
- if (typeof $events_loc.pres_mgmt.location_name_qry_str === 'undefined') $events_loc.pres_mgmt.location_name_qry_str = '';
+ if (typeof $events_loc.pres_mgmt.search_version === 'undefined')
+ $events_loc.pres_mgmt.search_version = 0;
+ if (typeof $events_loc.pres_mgmt.qry__remote_first === 'undefined')
+ $events_loc.pres_mgmt.qry__remote_first = false;
+ if (
+ typeof $events_loc.pres_mgmt.fulltext_search_qry_str === 'undefined'
+ )
+ $events_loc.pres_mgmt.fulltext_search_qry_str = '';
+ if (typeof $events_loc.pres_mgmt.location_name_qry_str === 'undefined')
+ $events_loc.pres_mgmt.location_name_qry_str = '';
}
let lq__event_obj = $derived(
liveQuery(async () => {
- if (log_lvl) console.log(`*** LiveQuery: lq__event_obj *** event_id=${$events_slct.event_id}`);
+ if (log_lvl)
+ console.log(
+ `*** LiveQuery: lq__event_obj *** event_id=${$events_slct.event_id}`
+ );
return await db_events.event.get($events_slct?.event_id ?? '');
})
);
@@ -78,18 +87,26 @@
let lq__event_session_obj_li = $derived.by(() => {
const ids = event_session_id_li;
const event_id = $events_slct?.event_id;
-
+
return liveQuery(async () => {
// SCENARIO 1: Specific IDs provided (Search Results)
if (Array.isArray(ids) && ids.length > 0) {
- if (log_lvl) console.log(`Session Page LQ: bulkGet ${ids.length} IDs`);
+ if (log_lvl)
+ console.log(`Session Page LQ: bulkGet ${ids.length} IDs`);
const results = await db_events.session.bulkGet(ids);
- return results.filter(item => item !== undefined);
+ return results.filter((item) => item !== undefined);
}
-
+
// SCENARIO 2: Fallback broad search (Only if no active filters)
- if (event_id && !$events_loc.pres_mgmt.fulltext_search_qry_str && !$events_loc.pres_mgmt.location_name_qry_str) {
- if (log_lvl) console.log(`Session Page LQ: Fallback search for event: ${event_id}`);
+ if (
+ event_id &&
+ !$events_loc.pres_mgmt.fulltext_search_qry_str &&
+ !$events_loc.pres_mgmt.location_name_qry_str
+ ) {
+ if (log_lvl)
+ console.log(
+ `Session Page LQ: Fallback search for event: ${event_id}`
+ );
return await db_events.session
.where('event_id')
.equals(event_id)
@@ -114,7 +131,9 @@
// Standardized Reactive Search Pattern (Aether UI V3)
let search_params = $derived({
v: $events_loc.pres_mgmt.search_version,
- str: ($events_loc.pres_mgmt.fulltext_search_qry_str ?? '').toLowerCase().trim(),
+ str: ($events_loc.pres_mgmt.fulltext_search_qry_str ?? '')
+ .toLowerCase()
+ .trim(),
location: $events_loc.pres_mgmt.location_name_qry_str,
event_id: $events_slct?.event_id,
remote_first: $events_loc.pres_mgmt.qry__remote_first
@@ -140,9 +159,12 @@
const current_search_id = ++last_search_id;
const event_id = params.event_id;
const remote_first = params.remote_first;
-
- if (log_lvl) console.log(`[Session Search #${current_search_id}] Refreshing (remote=${remote_first}, event=${event_id}, str=${params.str})...`);
-
+
+ if (log_lvl)
+ console.log(
+ `[Session Search #${current_search_id}] Refreshing (remote=${remote_first}, event=${event_id}, str=${params.str})...`
+ );
+
untrack(() => {
$events_sess.pres_mgmt.status_qry__search = 'loading';
});
@@ -157,34 +179,52 @@
let local_results = await db_events.session
.where('event_id')
.equals(event_id)
- .filter(session => {
- if (location_name && session.event_location_name !== location_name) return false;
-
+ .filter((session) => {
+ if (
+ location_name &&
+ session.event_location_name !== location_name
+ )
+ return false;
+
if (qry_str) {
const name = (session.name ?? '').toLowerCase();
const code = (session.code ?? '').toLowerCase();
- const description = (session.description ?? '').toLowerCase();
- const qry_string = (session.default_qry_str ?? '').toLowerCase();
-
- const match = name.includes(qry_str) ||
- code.includes(qry_str) ||
- description.includes(qry_str) ||
- qry_string.includes(qry_str);
-
+ const description = (
+ session.description ?? ''
+ ).toLowerCase();
+ const qry_string = (
+ session.default_qry_str ?? ''
+ ).toLowerCase();
+
+ const match =
+ name.includes(qry_str) ||
+ code.includes(qry_str) ||
+ description.includes(qry_str) ||
+ qry_string.includes(qry_str);
+
if (!match) return false;
}
return true;
})
.toArray();
- local_results.sort((a, b) => (a.name ?? '').localeCompare(b.name ?? ''));
- const local_ids = local_results.map(s => s.id || s.event_session_id).filter(Boolean);
+ local_results.sort((a, b) =>
+ (a.name ?? '').localeCompare(b.name ?? '')
+ );
+ const local_ids = local_results
+ .map((s) => s.id || s.event_session_id)
+ .filter(Boolean);
if (current_search_id === last_search_id) {
- if (log_lvl) console.log(`[Session Search #${current_search_id}] Fast Path found ${local_ids.length} items locally.`);
+ if (log_lvl)
+ console.log(
+ `[Session Search #${current_search_id}] Fast Path found ${local_ids.length} items locally.`
+ );
untrack(() => {
event_session_id_li = local_ids;
- if (local_ids.length > 0) $events_sess.pres_mgmt.status_qry__search = 'done';
+ if (local_ids.length > 0)
+ $events_sess.pres_mgmt.status_qry__search =
+ 'done';
});
}
}
@@ -214,32 +254,46 @@
if (current_search_id === last_search_id) {
let api_results = results || [];
-
+
// Client-side Filter Guard: Ensure API results match local criteria (Backup filter)
- api_results = api_results.filter(session => {
- if (location_name && session.event_location_name !== location_name) return false;
+ api_results = api_results.filter((session) => {
+ if (
+ location_name &&
+ session.event_location_name !== location_name
+ )
+ return false;
if (qry_str) {
const name = (session.name ?? '').toLowerCase();
const code = (session.code ?? '').toLowerCase();
- const description = (session.description ?? '').toLowerCase();
- const qry_string = (session.default_qry_str ?? '').toLowerCase();
- const match = name.includes(qry_str) ||
- code.includes(qry_str) ||
- description.includes(qry_str) ||
- qry_string.includes(qry_str);
+ const description = (
+ session.description ?? ''
+ ).toLowerCase();
+ const qry_string = (
+ session.default_qry_str ?? ''
+ ).toLowerCase();
+ const match =
+ name.includes(qry_str) ||
+ code.includes(qry_str) ||
+ description.includes(qry_str) ||
+ qry_string.includes(qry_str);
if (!match) return false;
}
return true;
});
- const api_ids = api_results.map((s: any) => s.id || s.event_session_id).filter(Boolean);
-
+ const api_ids = api_results
+ .map((s: any) => s.id || s.event_session_id)
+ .filter(Boolean);
+
untrack(() => {
$events_slct.event_session_obj_li = api_results;
event_session_id_li = api_ids;
$events_sess.pres_mgmt.status_qry__search = 'done';
});
- if (log_lvl) console.log(`[Session Search #${current_search_id}] Revalidation Complete. Found ${api_ids.length} items.`);
+ if (log_lvl)
+ console.log(
+ `[Session Search #${current_search_id}] Revalidation Complete. Found ${api_ids.length} items.`
+ );
}
} catch (error) {
if (current_search_id === last_search_id) {
@@ -251,7 +305,10 @@
}
}
- if ($events_loc.pres_mgmt?.save_search_text && $events_loc.pres_mgmt?.saved_search__session) {
+ if (
+ $events_loc.pres_mgmt?.save_search_text &&
+ $events_loc.pres_mgmt?.saved_search__session
+ ) {
$events_loc.pres_mgmt.fulltext_search_qry_str =
$events_loc.pres_mgmt.saved_search__session;
}
@@ -278,7 +335,10 @@
Æ:
- {ae_util.shorten_string({ string: $lq__event_obj?.name, max_length: 12 })}
+ {ae_util.shorten_string({
+ string: $lq__event_obj?.name,
+ max_length: 12
+ })}
- Pres Mgmt - {$events_loc?.title}
@@ -294,17 +354,24 @@