From f628e7e3fc263522267f23d80f3d711aaaae5c93 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 19 Mar 2026 18:47:35 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20badge=20print=20controls=20=E2=80=94=20?= =?UTF-8?q?quick=20print=20btn,=20compacted=20spacing,=20collapsible=20sec?= =?UTF-8?q?tions,=20overflow=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Quick Print button (30%) alongside canonical Print Badge (70%): calls window.print() only — no count increment, no navigation back to search - Compact panel spacing: reduce space-y, pt/pb on card headers, standalone row py, font_ctrl py - Add collapsible Attendee/Staff section groups reusing ctrl-accordion CSS pattern; attendee starts open, staff starts collapsed — auto-collapses the other on expand - Add overflow-x-hidden to print page panel container to kill horizontal scrollbar Co-Authored-By: Claude Sonnet 4.6 --- .../ae_comp__badge_print_controls.svelte | 165 ++++++++++++------ .../badges/[badge_id]/print/+page.svelte | 2 +- 2 files changed, 117 insertions(+), 50 deletions(-) diff --git a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_print_controls.svelte b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_print_controls.svelte index 410dca67..acd17dcb 100644 --- a/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_print_controls.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/[badge_id]/ae_comp__badge_print_controls.svelte @@ -22,7 +22,7 @@ import { ae_api, ae_loc } from '$lib/stores/ae_stores'; import { events_func } from '$lib/ae_events_functions'; import { browser } from '$app/environment'; - import { Check, ChevronDown, Eye, EyeOff, Info, LoaderCircle, Pencil, Printer, RotateCcw, X } from '@lucide/svelte'; + import { Check, ChevronDown, ChevronRight, Eye, EyeOff, Info, LoaderCircle, Pencil, Printer, RotateCcw, X } from '@lucide/svelte'; interface Props { event_id: string; event_badge_id: string; @@ -98,6 +98,22 @@ // — used here to allow reprinting an already-printed badge when global edit mode is active. let is_global_edit_mode = $derived($ae_loc.edit_mode === true); + // --- Section collapse state --- + // Attendee fields start open (primary use); staff starts closed to save space. + // Toggling one collapses the other (auto-collapse, same pattern as launcher sections). + let attendee_open = $state(true); + let staff_open = $state(false); + + function toggle_section(which: 'attendee' | 'staff') { + if (which === 'attendee') { + attendee_open = !attendee_open; + if (attendee_open) staff_open = false; + } else { + staff_open = !staff_open; + if (staff_open) attendee_open = false; + } + } + // --- Print --- let print_count = $derived($lq__event_badge_obj?.print_count ?? 0); let is_printed = $derived(print_count >= 1); @@ -405,7 +421,7 @@ key === 'name' ? font_size_name : key === 'title' ? font_size_title : key === 'affiliations' ? font_size_affiliations : font_size_location} -
@@ -505,34 +521,52 @@ Main panel ============================================================ --> - + {#if can_print} -
- +
+
+ + + + + +
{#if is_printed && print_status === 'idle'}

Already printed {print_count}× @@ -541,15 +575,31 @@

{/if} -
+
-

Attendee info

+ + + +
+
-
+

Name

{#if get_display('full_name_override', 'full_name')} @@ -608,7 +658,7 @@
-
+

Title

{#if get_display('professional_title_override', 'professional_title')} @@ -661,7 +711,7 @@
-
+

Affiliations

{#if get_display('affiliations_override', 'affiliations')} @@ -714,7 +764,7 @@
-
+

Location

{#if get_display('location_override', 'location')} @@ -767,7 +817,7 @@
-
+

Lead Scanning

@@ -851,7 +901,7 @@

-
+

Pronouns

{#if get_display('pronouns_override', 'pronouns')} @@ -898,19 +948,33 @@
+
+
+ {#if is_trusted} - -
- - Staff adjustments - -
+ + + +
+
-
+