refactor(badges): remove redundant loading gate; fix BarChart2 deprecation

The +page.svelte {#if search_status=loading && ids.length===0} gate is now
redundant — ae_comp__badge_obj_li handles all states internally (Searching...,
Enter your name, No results). Removing it also fixes a UX regression where
trusted-user IDB fallback results would be hidden by the gate whenever a new
API search fired. Component is now always mounted and manages its own state.

Also replaces deprecated BarChart2 with ChartColumnBig (lucide rename).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-06-02 16:48:44 -04:00
parent d05cc63459
commit e735d0c213

View File

@@ -32,7 +32,7 @@ import Comp_badge_obj_li from './ae_comp__badge_obj_li.svelte';
import Comp_badge_create_form from './ae_comp__badge_create_form.svelte'; import Comp_badge_create_form from './ae_comp__badge_create_form.svelte';
import Comp_badge_upload_form from './ae_comp__badge_upload_form.svelte'; import Comp_badge_upload_form from './ae_comp__badge_upload_form.svelte';
import { LoaderCircle, UserPlus, Printer, Upload, FileText, BarChart2 } from '@lucide/svelte'; import { UserPlus, Printer, Upload, FileText, ChartColumnBig } from '@lucide/svelte';
// Load templates for this event so the create form can show the selector and // Load templates for this event so the create form can show the selector and
// derive badge_type_code_li from whichever template the user picks. // derive badge_type_code_li from whichever template the user picks.
@@ -524,7 +524,7 @@ async function handle_search_refresh(params: any) {
<a <a
href={`/events/${$events_slct?.event_id}/badges/stats`} href={`/events/${$events_slct?.event_id}/badges/stats`}
class="btn btn-tertiary"> class="btn btn-tertiary">
<BarChart2 size="1em" /> Badge Printing Stats <ChartColumnBig size="1em" /> Badge Printing Stats
</a> </a>
</div> </div>
{/if} {/if}
@@ -592,18 +592,10 @@ async function handle_search_refresh(params: any) {
{/if} {/if}
</dialog> </dialog>
{#if $events_sess?.badges?.search_status === 'loading' && event_badge_id_li.length === 0} <Comp_badge_obj_li
<div {lq__event_badge_obj_li}
class="flex w-full flex-col items-center justify-center p-16 text-center opacity-50"> search_status={$events_sess?.badges?.search_status ?? null}
<LoaderCircle size="3em" class="mx-auto mb-2 animate-spin" /> log_lvl={1} />
<p class="text-xl">Loading badges...</p>
</div>
{:else}
<Comp_badge_obj_li
{lq__event_badge_obj_li}
search_status={$events_sess?.badges?.search_status ?? null}
log_lvl={1} />
{/if}
<style> <style>
dialog { dialog {