Commit Graph

1861 Commits

Author SHA1 Message Date
Scott Idem
c867795f4d Badges: use position:fixed for print centering — bypasses all ancestor layout issues 2026-03-12 18:25:31 -04:00
Scott Idem
5410bb4a8c Badges: switch to transform-based print centering — fixes Firefox physical printer shift 2026-03-12 18:08:27 -04:00
Scott Idem
bc23e8a399 Badges: fix Firefox print centering (overflow:auto+display:contents); add print layout Playwright tests 2026-03-12 17:58:33 -04:00
Scott Idem
5ef66af98d Badges: fix print centering — override overflow:hidden on body/html in print 2026-03-12 17:46:50 -04:00
Scott Idem
1e70271002 Badges: add temp print debug outlines — diagnose centering issue 2026-03-12 17:32:31 -04:00
Scott Idem
05aa0288cb Badges: fix print centering — dissolve .main_content; hide footer/scroll buttons from print; document print layout architecture 2026-03-12 17:28:25 -04:00
Scott Idem
f26416de22 Badges: print centering via display:contents — collapse wrappers, body as flex center 2026-03-12 17:21:56 -04:00
Scott Idem
11a6d5d35c Badges: center badge vertically + horizontally in print preview; scaffold print_margin_cfg 2026-03-12 17:05:41 -04:00
Scott Idem
c3a4ff45c7 Badges: clean print output — suppress outlines, hide app chrome, reset layout container 2026-03-12 16:52:17 -04:00
Scott Idem
25359f12b8 Badges: soft feathered glow around badge wrapper in dark mode 2026-03-12 16:43:11 -04:00
Scott Idem
dd2deb1ab1 Badges: fix debug pre dark mode colors; white ring shadow around badge in dark mode 2026-03-12 16:31:26 -04:00
Scott Idem
745067b228 Badges: force light-mode rendering on badge print area — ignore dark theme 2026-03-12 16:26:21 -04:00
Scott Idem
6e8f44b009 Badges: center badge wrapper via mx-auto so Edit Mode debug div doesn't shift layout 2026-03-12 16:15:55 -04:00
Scott Idem
b4ab60ebba Badges: PVC wrapper hugs card tightly; hide 'Front of badge' label when single-sided 2026-03-12 16:05:08 -04:00
Scott Idem
7b340de139 Badges: fix button layout \u2014 Revert/Save/X always in fixed positions 2026-03-12 15:54:06 -04:00
Scott Idem
23422c8f27 Badges: hide Save until field is dirty; warning style when unsaved changes 2026-03-12 15:48:26 -04:00
Scott Idem
f74fc593b0 Badges: allow_tracking auto-expands when true; TC modal on info button 2026-03-12 15:41:32 -04:00
Scott Idem
9888374d86 Badges: auto-focus input when field accordion opens; add Revert button to field forms 2026-03-12 15:28:37 -04:00
Scott Idem
9e64815d62 Badges: panel widens to w-80 while editing, font scaling on active card 2026-03-12 15:21:13 -04:00
Scott Idem
5f6f1b408b Badges: live preview while typing, accordion entrance animation, register tailwindcss-animate 2026-03-12 14:54:26 -04:00
Scott Idem
961b05c5e4 Badges: controls panel UX polish — remove identity card, elevate print btn, style buttons 2026-03-12 14:46:08 -04:00
Scott Idem
b92c0bdcf1 Badges: retire v1 render, badge print page kiosk UX improvements
- ae_comp__badge_obj_view.svelte (v1) removed — replaced by v2 everywhere
- print/+page.svelte: always uses v2, removed v1/v2 toggle
  Header redesigned for kiosk: name + Ready/Printed×N status chip,
  event title subtitle. Re-print shortcut only in trusted+edit_mode.
  Duplicate 'Print Now' header button removed (canonical is in right panel).
- ae_comp__badge_print_controls.svelte:
  Identity card added at top (name, badge type, badge ID).
  Pronouns moved to attendee-level section (was staff-only).
  'Staff adjustments' divider added before badge type section.
  Attendee info section header label added.
- ae_comp__badge_obj_view_v2.svelte: debug JSON blocks gated behind edit_mode.
- print_list/+page.svelte: updated import to v2.
2026-03-12 14:19:58 -04:00
Scott Idem
c7063806b7 refactor: v2 badge render display-only + print button to controls panel
- ae_comp__badge_obj_view_v2.svelte: removed all inline edit-mode logic
  (floating Edit/Save/Cancel panel, placeholder list, input fields, save/cancel
  functions). V2 is now purely a display component — editing happens in the right
  panel (ae_comp__badge_print_controls.svelte) via liveQuery reactivity.
  display_* values are now $derived directly from lq__event_badge_obj.
  Fixes effective_badge_type_code CSS class (was always empty in previous v2).

- ae_comp__badge_print_controls.svelte: added "Print Badge" button at the top of
  the panel. Increments print_count, fires window.print(), then navigates to badge
  search. This is now the canonical print action for v2; the header "Print Now"
  button is a shortcut that calls window.print() only (no count tracking).
  Clarified $ae_loc.edit_mode comment — global AE Edit Mode is not a badge-specific
  edit toggle; used here only to gate reprints.

- print/+page.svelte: added clarifying comments on is_edit_mode (global vs local)
  and the header "Print Now" button (shortcut only, no count tracking).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 13:48:08 -04:00
Scott Idem
2198c55e27 feat: badge v2 auto-scaling text with Element_fit_text
Adds binary-search font auto-scaling for badge text fields, replacing
the character-count heuristic in v1. New files:

- action_fit_text.ts: Svelte action using binary search + MutationObserver
  + ResizeObserver. Pass null to disable (manual override mode).
- element_fit_text.svelte: Component wrapper with min/max/manual_size/
  height/width props. height prop required for overflow detection to work.
- ae_comp__badge_obj_view_v2.svelte: Badge render using Element_fit_text
  for name/title/affiliations/location in display mode. font_size_* props
  default to undefined (auto-scale) instead of numeric defaults.
  fit_heights derived object provides layout-aware section heights for
  badge_3.5x5.5_pvc, badge_4x5_fanfold, and badge_4x6_fanfold layouts.
  flex_justify() maps shorthand ('around','between','even') to CSS values.
  Edit mode uses plain divs — inputs are never auto-scaled.

print/+page.svelte: Added v1/v2 toggle button in header. V1 preserved
as fallback. font_size_* passed as null (not ?? undefined) to v2 so
auto-scaling is active by default; manual override from print controls
still disables it per-field.

Docs: PROJECT__AE_Events_Badges_Review_Print.md updated with kiosk
workflow design intent, email address rule (always event_badge.email),
permission model alignment gap (TASK 4.0), and v2 implementation status.
TODO__Agents.md: completed items removed, badge polish tasks updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 13:23:47 -04:00
Scott Idem
dfad2831d6 Updated documentation. 2026-03-11 19:06:37 -04:00
Scott Idem
0da5894529 fix: stable WS client ID + presentation name for poster modal title
- Generate and persist crypto.randomUUID() as controller_client_id on first
  launcher load (events_loc is persisted so it survives page reloads).
  Previously fell back to Date.now() on every reload.
- ae_open: handler now resolves presentation name via Dexie lookup chain:
  file.for_id -> presentation.name, falling back to file.filename.
  Remote modal now shows the presentation title instead of raw filename.
2026-03-11 19:01:21 -04:00
Scott Idem
3df09713d3 fix: poster WS remote control - push open and resolve file obj
- launcher_file_cont: poster 'Open Poster' click now sends ae_open:event_file
  command to remote display when controller=local_push and WS is connected
- +layout.svelte handle_ws_recv: ae_open: handler now looks up the file obj
  from Dexie after setting modal__open_event_file_id, so the remote modal
  has the hosted_file_id needed to render the poster image (was showing
  'No image selected' on remote device)
2026-03-11 18:54:40 -04:00
Scott Idem
5db66bc888 feat: upgrade launcher WebSocket to V3 protocol
- New element_websocket_v3.svelte:
  - URL path /v3/ws/group/{id}/client/{id}
  - Auth via ?api_key=...&jwt=... query params (browsers can't set WS headers)
  - Strict WS_Message_V3 schema: msg_type + target fields
  - 45s heartbeat to maintain Redis presence TTL
  - Self-echo detection via from_id (server-stamped)
  - Target 'group' (was 'all'), 'direct' (was 'dm')
- launcher/+layout.svelte:
  - Swap Element_websocket_v2 -> Element_websocket_v3
  - Add api_key and jwt props for V3 auth
  - Fix handle_ws_recv: type -> msg_type (V3 schema)
  - Remove unused 'type' prop passed to element
2026-03-11 17:50:08 -04:00
Scott Idem
3f5f554595 Now with websocket use instructions. :-) 2026-03-11 17:16:44 -04:00
Scott Idem
c73b5a09e4 feat: add element_access_denied.svelte; use in badge review page
- New reusable element_access_denied.svelte with title, message, action props
- Badge review page: swap inline 'Access Denied' card with the component
- Project doc: all 6 steps complete, status → Complete
2026-03-11 17:06:11 -04:00
Scott Idem
0c11cfb3e2 fix: replace alert() access guard in event settings with proper UX
- Remove blocking alert() + module-level browser guard
- Move access check to onMount with 500ms grace delay (matches /core pattern)
- Add {:else} block: Lock icon + 'Access Restricted' message + redirect link
- Remove now-unused 'browser' import; add Lock from lucide
2026-03-11 16:59:26 -04:00
Scott Idem
53c517ec30 feat: session-expired banner via ae_auth_error store
- Add ae_auth_error writable store to ae_stores.ts
- Wire api_get_object, api_post_object, api_patch_object to set
  ae_auth_error on 401/403 (browser-only guard, never fires SSR)
- Root layout watches ae_auth_error; only raises flag_expired when
  a JWT is present (prevents false trigger on unauthenticated loads)
- Dismissible amber banner added to root layout (non-blocking, above content)
- Tested via debug menu trigger; banner fires and clears correctly
2026-03-11 16:56:07 -04:00
Scott Idem
60ca3b2f6c fix: update docs/todos after v1 edit form retirement + v2 rename
- Update CLIENT__IDAA_and_customized_mods.md: remove v1 entry and v2 suffix
- Update tests/README.md: rename _v2 reference to canonical filename
- Update TODO__Agents.md: mark all state_referenced_locally warnings resolved;
  document remaining 23 CSS @apply warnings as harmless language-service noise
2026-03-11 15:42:58 -04:00
Scott Idem
9c291cf286 fix: move IDAA recovery meeting v2 lookup calls into onMount; remove unused CSS
state_referenced_locally warnings in ae_idaa_comp__event_obj_id_edit_v2.svelte:
- lu_country_list and lu_country_subdivision_list $state runes were read in
  top-level synchronous if/else blocks; moved into onMount
- Add onMount to Svelte imports
- Remove unused .field-richtext CSS selector

Remaining 32 warnings in 2 files are either:
- CSS @apply / @reference warnings from the CSS language service not understanding
  Tailwind v4 at-rules (harmless, build works fine)
- Warnings in the legacy v1 edit form (no code references it)
2026-03-11 15:34:41 -04:00
Scott Idem
5c09730991 fix: move IDAA recovery meeting page browser block into onMount
Two state_referenced_locally warnings on data prop in
recovery_meetings/[event_id]/+page.svelte: reading a $props()
rune synchronously in a top-level if (browser) block only captures
the initial value.

Move the postMessage block into onMount (browser-only by nature);
remove the now-redundant 'browser' import.
2026-03-11 15:23:59 -04:00
Scott Idem
a878e4a05b fix: clean up launcher tmp/bindable items; update TODO
- Update stale comment in menu_location_list.svelte: prop is already
  $bindable(null), comment incorrectly said it was not
- Confirm cleanup_tmp_files is wired in launcher_background_sync.svelte
- Mark both items done in TODO__Agents.md
2026-03-11 15:17:32 -04:00
Scott Idem
496afcb813 fix: suppress svelte chunk circular dep warnings via manualChunks
Rollup was splitting svelte/src/internal/client/runtime.js into a
different chunk from svelte/src/index-client.js, producing ~35 warnings
about untrack/tick re-exports leading to broken execution order.

Add manualChunks function to vite.config.ts to colocate all svelte
node_modules into a single 'svelte-vendor' chunk, keeping runtime.js
and index-client.js together.
2026-03-11 15:02:02 -04:00
Scott Idem
fde3801ea6 refactor: clean up try_cache defaults and add SWR to sponsorship loaders
- Remove vestigial try_cache param from generate_qr_code (never used in body)
- Remove vestigial try_cache from ae_core_functions: load_ae_obj_id__site_domain,
  update_ae_obj_id_crud, update_ae_obj_id_crud_v2 (none referenced it in body)
- Add proper SWR pattern to load_ae_obj_id__sponsorship_cfg and
  load_ae_obj_id__sponsorship; change defaults from false to true
- Change load_ae_obj_id__event_file default try_cache from false to true
  (consistent with load_ae_obj_li__event_file)
- Change load_ae_obj_id__hosted_file default try_cache from false to true
  (consistent with load_ae_obj_li__hosted_file)
- Remove stale try_cache arg from element_ae_crud.svelte caller
2026-03-11 14:57:23 -04:00
Scott Idem
50a20ebc44 chore: add cSpell words; fix deploy scripts to target ae_app service only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:36:17 -04:00
Scott Idem
bf94e0dee9 fix: extend poster session type context to all file list wrapper contexts
element_manage_event_file_li_all.svelte — also derives context_session_type_code
via Dexie chain (event_presentation → session, or event_presenter → presentation →
session) and passes it to element_manage_event_file_li. Fixes the button not showing
when viewing a presenter's files from the session view.

element_manage_event_file_li_direct.svelte — extends the Dexie chain to also handle
event_session (direct lookup) and event_presentation, not just event_presenter.

Both: correct API URL to /v3/hosted_file/ per backend agent's examples.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:35:24 -04:00
Scott Idem
f6a6534380 fix: restore /v3/action/hosted_file path now that endpoint exists in v3 router
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:26:29 -04:00
Scott Idem
8cba7899db fix: correct convert_file API path from /v3/action/hosted_file to /hosted_file
The endpoint is registered under the older hosted_file router at /hosted_file/{id}/convert_file,
not under the v3 actions router. Both list and table convert buttons were sending to the wrong path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:12:53 -04:00
Scott Idem
477fc16f16 fix: derive poster session type from Dexie chain for presenter-linked files
v_event_file joins event_session only via event_file.event_session_id.
Files with for_type='event_presenter' have event_session_id=NULL on the
file record itself, so event_session_type_code is structurally always NULL
from the API for these files — no amount of refreshing can fix it.

Instead of relying on the file's event_session_type_code, derive the session
type in element_manage_event_file_li_direct via the Dexie chain:
  presenter.event_presentation_id → presentation.event_session_id → session.type_code

Pass the result as context_session_type_code to element_manage_event_file_li,
which now checks EITHER the file's own event_session_type_code OR the context
prop against 'poster' to show the PDF→Image convert button.

Sessions are guaranteed in Dexie because the pres_mgmt layout loads
inc_session_li:true on every navigation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 14:06:33 -04:00
Scott Idem
4690548946 fix(events): switch onMount→\$effect for file list Dexie refresh
onMount fired before the parent presenter liveQuery resolved, so
link_to_id was undefined and the refresh was silently skipped.

Using \$effect makes the background refresh re-run once link_to_id
becomes available (after the presenter Dexie lookup completes),
ensuring event_session_type_code is written to Dexie and the
PDF→image convert button renders correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:43:33 -04:00
Scott Idem
de8b85bb05 fix(events): refresh file list on mount to populate event_session_type_code in Dexie
The presenter detail page loads files with try_cache:false, which fetches
fresh data from the API but does NOT write it to Dexie (by design in the
SWR implementation). The file list's liveQuery then reads stale Dexie
records that lack event_session_type_code, causing the PDF→image convert
button condition to silently fail for presenter files in poster sessions.

Fix: trigger a try_cache:true background refresh on mount in the direct
wrapper so fresh API data (with event_session_type_code='poster') is
persisted to Dexie and the liveQuery re-renders with the correct field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:33:31 -04:00
Scott Idem
b2fa1a59dc feat(events): add PDF→webp convert button to event file list view
Mirrors the convert button added to the table view (ae_comp__event_file_obj_tbl).
The list view (element_manage_event_file_li) is the primary Pres Mgmt UI
for managing event files per object (session, presenter, location, etc.).

Same conditions: edit_mode on, extension=pdf, event_session_type_code=poster.
Per-row status: idle → converting → done | error with retry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:24:41 -04:00
Scott Idem
2e08f5ff15 feat(events): restore PDF→webp convert button in event file table
Adds a per-row "Convert PDF → Image" button in ae_comp__event_file_obj_tbl.
Only shown when edit_mode is on, the file is a PDF, and the session
type_code is 'poster' — poster sessions need images in the Launcher modal
(which uses <img>, not a PDF viewer).

Calls GET /v3/action/hosted_file/{id}/convert_file (pdf2image, 3840px wide,
first page, saves as a new hosted_file linked to the same parent object).
Per-row status tracking: idle → converting → done | error with retry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 13:01:26 -04:00
Scott Idem
241e05bc79 feat: add store_versions.ts — localStorage schema versioning for ae_loc and ae_events_loc
Persistent stores grow and change over time. svelte-persisted-store deep-merges
old localStorage values with new defaults, so stale values (e.g. hash_prefix_length: 1)
silently survive schema changes and cause subtle bugs.

- src/lib/stores/store_versions.ts:
  Single source of truth for AE_LOC_VERSION / AE_EVENTS_LOC_VERSION.
  Side-effect on import: reads raw localStorage and wipes if __version mismatches.
  Must be imported first in ae_stores.ts and ae_events_stores.ts so the wipe
  happens before persisted() hydrates from localStorage.

- ae_stores.ts + ae_events_stores.ts:
  Import store_versions as first import; add __version to persisted store defaults.

- documentation/TODO__Agents.md:
  Added stores refactor task — both store files need a cleanup pass.

Bump AE_LOC_VERSION or AE_EVENTS_LOC_VERSION by 1 on breaking schema changes.
Non-breaking changes (new optional fields, default value tweaks) do not need a bump.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 12:43:05 -04:00
Scott Idem
ca91afbd9d chore: Optimized Dockerfile and .dockerignore for faster deployments. 2026-03-11 12:36:34 -04:00
Scott Idem
56fd1d1760 fix: Launcher dead-code cleanup — dead else-if branch and unused handle_get_device_info
- launcher/+layout.svelte: dead {:else if $events_slct.event_session_id} branch
  (condition identical to preceding {#if}) replaced with correct
  {:else if $events_slct.event_location_id} — shows "Select a session"
  prompt when a room is chosen but no session is yet selected.

- launcher/[event_location_id]/+page.svelte: removed unreachable
  handle_get_device_info() function (never called; pre-relay pattern
  superseded by launcher_background_sync.svelte's run_device_heartbeat()).
  Cleaned up now-unused imports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 12:30:41 -04:00