Commit Graph

1723 Commits

Author SHA1 Message Date
Scott Idem
32e9550ca2 feat(badges): layout CSS system — data-layout attribute, @page injection, style_href
Two compiled layout CSS files in src/lib/ae_events/badges/css/:
  - badge_layout_epson_4x5_fanfold.css — 4"×5" per side, Epson ColorWorks C3500
    fanfold duplex; preferred for general conference use (ISHLT, demos)
  - badge_layout_zebra_zc10l_pvc.css — 3.5"×5.5" PVC card, Zebra ZC10L,
    single-sided (pair with duplex=0 on template)

Rules scoped under [data-layout="..."] on the wrapper — beats Tailwind utility
class specificity without !important. Vite hot-reloads these in dev.

Badge component: add data-layout attribute from template.layout field; import
both layout CSS files (falls back to Tailwind 4"×6" defaults if layout unset).

Print page svelte:head: inject @page paper-size rule per layout code
(@page cannot use attribute selectors so it must be dynamic). Also wire
style_href as a <link> for per-event external client branding CSS.

db_events.ts Badge_template interface: add style_href and duplex fields.
MODULE doc: update layout codes table with badge_4x5_fanfold entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 16:53:32 -05:00
Scott Idem
51cfcbf2d6 feat(badges): wire duplex field — hide badge back for single-sided templates
- Add duplex + style_href to properties_to_save so they're cached in IDB
- Derive show_badge_back: true when duplex is null/unset (safe default for
  existing templates) or 1; false when duplex=0 (single-sided, e.g. Axonius
  NYC using Zebra ZC10L PVC cards)
- Wrap entire badge_back section in {#if show_badge_back} so the DOM node
  is fully removed rather than just hidden — cleaner than a CSS class approach

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 16:06:51 -05:00
Scott Idem
827c7ac62e fix(badges): wire badge_type_list from template instead of hardcoded ISHLT list
Replace static `badge_type_code_li` array (hardcoded ISHLT 2024 types) with
`$derived.by()` that parses `$lq__event_badge_template_obj.badge_type_list` JSON.
Each event's template defines its own badge type set — the component now reflects
that correctly. Falls back to `[]` on missing/invalid JSON (hides the type select).

Also add MODULE__AE_Events_Badge_Templates.md documenting template field reference,
external CSS approach, layout codes, duplex field plan, and standard template setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 15:43:49 -05:00
Scott Idem
9939d94970 feat(badges): badge review form + expand properties_to_save
ae_comp__badge_review_form.svelte:
- Full implementation of the badge review form (Task 1)
- Editable fields gated by access level (attendee / trusted / admin)
- Save/cancel with change detection, override revert buttons
- QR code display (hover zoom + click expand)
- Print status section, options/tickets, T&C block
- HTML rendering for name/title/affiliations/location fields
- Accessibility font-size toggle (text-2xl ↔ text-4xl)
- Help modal (Flowbite) with 6 sections
- Local edit mode — never writes to $ae_loc.edit_mode

ae_events__event_badge.ts:
- Add missing fields to properties_to_save so they are persisted to IDB:
  pronouns_override, phone, phone_override, registration_type(_code/_override),
  allow_tracking, agree_to_tc, other_1-8_code, ticket_1-8_code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 19:02:56 -05:00
Scott Idem
4b17ca9f59 docs(badges): mark Task 2 complete, document font controls and bug fix
- PROJECT doc: Task 2 status → complete (v1); added implementation
  details, default px values table, and note on future mm/inch iteration
- PROJECT doc: noted the review page field list bug fix (commit 011fc19a)
- MODULE doc: added "Recently Completed" section above Still Needed;
  cleared Badge Review Form and Print Font Controls from HIGH PRIORITY list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 18:58:59 -05:00
Scott Idem
3d7279da4c feat(badges): add print font size controls
- Add optional font_size_{name,title,affiliations,location} px props to
  ae_comp__badge_obj_view; when set, replaces auto inch-based sizing with
  an inline style so the caller controls the value
- Add screen-only (print:hidden) font size control panel to print page:
  four [−] [value] [+] [↺] rows, step 2px, null = auto (default)
  First + click activates at a sensible default that approximates the
  auto-sized inch values; ↺ button resets back to auto mode

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 18:49:58 -05:00
Scott Idem
011fc19a77 fix(badges): correct default field lists in review page
default_authenticated_fields was missing: pronouns_override, phone_override,
allow_tracking, agree_to_tc — so attendees couldn't edit those fields even though
the form rendered inputs for them.

default_trusted_fields had 'email' and 'badge_type_code' instead of 'email_override'
and 'badge_type_code_override', causing the can_edit() check in handle_save() to
silently drop those changes. Also added the full trusted field set: registration_type,
other_1-8_code, ticket_1-8_code, hide, priority, notes.

Also removed unused lucide imports (ShieldCheck, User, UserCheck) left over from
the removed access level indicator block.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 18:37:25 -05:00
Scott Idem
c4e85b1fe3 feat(badges): print/review pages, 4-button list, Lucide icons, permissions doc
Badge search results list (ae_comp__badge_obj_li):
- 4 action buttons per row: Print, Review (nav link), Copy Link (clipboard), Email Link
- Visibility rules: unprinted-only for non-edit mode; all non-hidden for trusted+edit
- Plain name display (User/EyeOff icon) — name is no longer a print link
- Obscured email for non-trusted users
- Debug row (ID, CR, UP, PC, FP, LP) in edit mode
- All icons converted to Lucide (Font Awesome removed)

Badge print page (/print):
- 3 header action buttons: Print Now, Review (nav), Email Link
- Removed old [badge_id]/+page.svelte placeholder (moved to trash)
- Added is_trusted, is_edit_mode, print state derived vars
- "Already printed Nx — last [timestamp]" warning inline with name
- Removed unused imports (browser, onMount, events_slct)

Badge review page (/review):
- 3 header action buttons: Print (nav), Copy Link (clipboard), Email Link
- Added events_loc for email placeholder + title event name
- Added is_edit_mode, print_count, is_printed, copy_status
- FA icons replaced with Lucide (ShieldCheck, UserCheck, User)
- Title now includes event name (was missing)

Infrastructure:
- print/+page.ts and review/+page.ts added (non-blocking badge loaders)
- ae_comp__badge_review_form.svelte stub created (fields pending)
- Fixed: components no longer write to $ae_loc.edit_mode (critical bug)

Docs:
- NEW: AE__Permissions_and_Security.md — full permissions hierarchy reference
- NEW: PROJECT__AE_Events_Badges_Review_Print.md — agent task brief for review form + print font controls
- UPDATED: MODULE__AE_Events_Badges.md rev 5 — field permissions spec, header buttons, still-needed list by priority

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 15:12:22 -05:00
Scott Idem
ee500a9ad5 Saving notes and things 2026-02-26 18:52:15 -05:00
Scott Idem
911a427757 docs: add IDAA client module doc, minor whitespace cleanup
- CLIENT__IDAA_and_customized_mods.md: New comprehensive doc covering IDAA
  architecture, all 4 submodules (Archives, BB, Recovery Meetings, Jitsi),
  Novi UUID auth system, permission levels, state stores, iframe integration,
  and testing requirements. Reverse-engineered from source 2026-02-26.
- MODULE__AE_Events_Badges.md: trailing whitespace only
- tests/README.md: blank line only
2026-02-26 18:50:20 -05:00
Scott Idem
8cb8195ecd docs(api-guide): document flat vs nested URL path rules (section 4)
Describes which object types are always-flat (never nested in URL) for
ALL operations, vs event sub-objects which use nested paths for mutations
but flat paths for all reads (GET, list, search, delete).

Always-flat objects:
- Core: account, activity_log, address, contact, hosted_file, organization,
  page, person, site, user
- Other: archive, event, journal, post

Event sub-objects (event_badge, event_session, etc.) use nested
create_nested_obj_v3 / update_nested_obj_v3 for POST/PATCH, but flat
paths for everything else.

Includes Playwright mock URL patterns for each operation type.
2026-02-26 18:47:50 -05:00
Scott Idem
7c6f264266 docs: clarify Electron scope, update badge test lessons, all badge tests passing
- AE__Architecture.md: Add section 7 -- Runtime Environment: Browser vs Electron.
  Electron is ONLY for Events Pres Mgmt Launcher. Badge printing (and everything
  else) works via standard browser window.print(), no Electron needed.
- MODULE__AE_Events_Badges.md rev 3: Update print section to browser-first approach,
  remove Electron from print workflow, add two new test lessons (flat API URLs,
  CSS attribute vs DOM property), mark all tests passing.
- TODO__Agents.md: Add completed data integrity test fixes item, add window.print()
  wiring to upcoming tasks, expand input field audit note.
2026-02-26 18:10:08 -05:00
Scott Idem
f5e98b8c0d fix(tests): fix all 4 failing badge data integrity tests
- Badge search mock: was checking nested URL /v3/crud/event/{id}/event_badge/search
  but search_ae_obj_v3 uses flat path /v3/crud/event_badge/search
- Template list mock: was checking nested path, fixed to flat /v3/crud/event_badge_template/
  with for_obj_id query param (matches get_ae_obj_li_v3 behavior)
- Badge objects: add _random ID fields (event_badge_id_random, id_random, event_id_random)
  required for Dexie IDB processing
- Template edit assertion: input[value*=...] CSS checks HTML attribute not DOM property;
  Svelte bind:value sets DOM property only — fix to use getByLabel('Template Name')
- Relax null body check: the debug panel footer can contain 'null' legitimately
2026-02-26 18:08:25 -05:00
Scott Idem
5a16772639 feat(badges): auto-navigate to badge search after print 2026-02-26 17:36:45 -05:00
Scott Idem
d1ded2d45e test(badges): pass attendee workflow test (edit → print → return)
- Add data-testid to badge edit/save/cancel/print buttons and professional title input
- Fix API mock routes (badge GET uses /v3/crud/event_badge/{id}, not nested)
- Add badge_template mock so badge view renders
- Add event_badge_id_random and id_random fields to all mock responses
- Split workflow test into its own test() instead of being inline in beforeEach
- Use data-testid selectors throughout for stability
2026-02-26 17:28:08 -05:00
Scott Idem
657a7122b8 docs(test): update workflow test comments for multi-word search
Test continues to use 'scott idem' (full name) now that backend
supports multi-word search with AND logic. Updated status notes.
2026-02-26 17:08:58 -05:00
Scott Idem
dc0f3066b3 fix(badges): support multi-word fulltext search
- Split search query by spaces
- Apply AND logic: all words must match
- Single word: LIKE '%word%'
- Multi-word: LIKE '%word1%' AND LIKE '%word2%'

Example: 'scott idem' now searches for both 'scott' AND 'idem'
Previously searched for literal 'scott idem' phrase which failed.

Fixes search bug discovered during Playwright test development.
2026-02-26 17:08:27 -05:00
Scott Idem
ba10b8f996 test: add attendee badge workflow test (WIP)
- Simulates complete check-in: navigate → search → view → edit → print → return
- Mocks V3 API for event, badge search, and PATCH operations
- Tests override field editing (professional_title_override)
- Documents future attendee review feature (email link workflow)

**STATUS: WIP** - Search results not displaying in test environment
- API mocks configured correctly
- IDB cleared properly, schema managed by app
- Store initialization includes qry__remote_first flag
- Issue: Badge list not rendering after search (timing or store issue)
-  Screenshot saved to test-results/ for debugging
2026-02-26 17:01:10 -05:00
Scott Idem
5514d579d0 test: centralize demo IDs and site_domain mock in env.ts
- Added testing_site_id, testing_site_domain_id, testing_fqdn, testing_person_id
- Created mock_site_domain object matching +layout.ts expectations
- Updated minimal_v3_mocks.ts to use mock_site_domain
- Fixes 'Domain Not Registered' overlay in Playwright tests
- All test IDs now documented with comments from tests/README.md
2026-02-26 16:43:36 -05:00
Scott Idem
908b4dbef9 docs(badges): clarify badge types vary by Event/Template 2026-02-26 16:26:44 -05:00
Scott Idem
ed7542b5dc docs(badges): comprehensive module documentation
COMPLETE DOCUMENTATION:
- Override fields pattern (*_override) and sync behavior
- External system integration (iMIS, Zoom, Novi, Impexium, Confex, Cvent)
- Cron sync safety rules (override fields NEVER overwritten)
- Access level permissions (Authenticated → Super)
- Search/filter capabilities (fulltext, badge type, print status, affiliations)
- Quick edit implementation details
- Database schema and API functions
- Component architecture
- Testing status and known issues
- Development guidelines

KEY CONCEPTS DOCUMENTED:
1. Override fields protect staff/attendee edits from automated syncs
2. Data flow is pull-only (read from external systems, never push back)
3. Display priority: override field → regular field → fallback
4. Access-based editing (currently placeholder, future JSON config)
5. All 7 override fields explained with examples

SYNC BEHAVIOR CLARIFIED:
- Cron jobs CAN update regular fields
- Cron jobs CANNOT touch override fields
- Manual staff edits CAN update any field
- Attendee self-service limited to specific overrides per event config
2026-02-26 16:17:39 -05:00
Scott Idem
b28595dad8 fix(badges): return processed data from all badge API functions
CRITICAL FIX (same pattern as event_file fix):
- search__event_badge(): Now returns processed_obj_li instead of unprocessed result_li
- load_ae_obj_id__event_badge(): Returns processed object after IDB save
- load_ae_obj_li__event_badge(): Returns processed list after IDB save
- create_ae_obj__event_badge(): Returns processed object after IDB save
- update_ae_obj__event_badge(): Returns processed object after IDB save

Pattern: All functions now return what was actually saved to IDB (processed data)
This ensures consistency between API return values and IDB cached data.

TEST IMPROVEMENTS:
- Add full_name field to badge mock data (not just full_name_override)
- Ensures mock data matches real API structure
2026-02-26 15:59:25 -05:00
Scott Idem
96cfb8c1b0 Quick save of test page 2026-02-26 15:49:05 -05:00
Scott Idem
a91c648c61 test: standardize naming conventions to snake_case
- Rename demo_event_id → testing_event_id (more explicit)
- Rename demo_account_id → testing_account_id (matches convention)
- Rename demo_badge_id → event_badge_id (descriptive)
- Rename demo_template_id → event_badge_template_id (explicit)
- Update all test files for consistency (15 files)
- Enhance README with organized test data sections
- Update person IDs to match README test data
- No regression: 15 tests passing, 7 pre-existing failures unchanged
2026-02-26 15:43:31 -05:00
Scott Idem
2c289e39de test(badges): Add badge cold-start and data integrity tests
- Add coldstart_event_badges_list.test.ts: badge list on empty IDB
- Add event_badge_data_integrity.test.ts: field mapping, templates, Electron compatibility
- 6 of 12 badge tests passing (3 original + 3 new)
- Tests cover: CRUD, interactions, cold-start, Electron bridge graceful degradation
- Ready for client demo
2026-02-26 14:57:08 -05:00
Scott Idem
9547da6da6 fix(events): Fix pres mgmt reports data loading and field mapping
- Fix session detail page params not being passed to component (causing undefined session_id)
- Fix wrapper components discarding API enriched data by re-fetching from IDB
- Fix event_file, event_session, event_presenter wrappers to preserve API data
- Add optional chaining for hash_sha256 field to prevent undefined crashes
- Fix search__event_file to always process API results before returning
- Ensures hosted_file_size -> file_size field mapping for reports
- All pres mgmt reports (files, sessions, presenters) now work on cold-start
2026-02-26 14:36:46 -05:00
Scott Idem
61025ea0d5 Docs: Add CLAUDE.md project context file for AI agent coordination
Project-specific context file for Claude Code containing:
- Critical privacy/business rules (IDAA, Journals)
- Mandatory workflows and tech stack
- API patterns and key documentation references
- Active issues tracking

Complements global ~/.claude/CLAUDE.md with SvelteKit-specific guidance.
2026-02-26 13:48:01 -05:00
Scott Idem
e34dd83436 Docs: Update README to mention DexieJS 4.x in tech stack 2026-02-26 13:47:43 -05:00
Scott Idem
fd5c36f836 Test: Add Playwright test for session cold-start bug fix
New test validates that presentations AND presenters render on first
navigation when IndexedDB is empty (cold-start scenario).

Test Configuration:
- Demo Session: DOW3h7v6H42 (703) 'How To Do Things'
- Demo Presentation: 7U2eXSjR6H4 (1670) 'Build a House'
- Demo Presenter: gT-hxnifb-0 (2202) 'Bob The Builder'

Tests:
1. UI visibility: Session name, presentation, and presenter all visible
2. IDB integrity: Verifies all nested data written to IndexedDB

Both tests passing - confirms fix works correctly.
2026-02-26 13:47:07 -05:00
Scott Idem
3c8a6feda0 Docs: Document session cold-start bug fix and mark project resolved
- Updated Dexie/liveQuery guide with detailed explanation of the
  try_cache + microtask yield bug pattern
- Marked session view refactor project as RESOLVED (2026-02-26)
- Added inline code comments to all three fixed loader functions
  explaining the critical fixes

Documents the 'refresh twice' bug resolution for future reference.
2026-02-26 13:43:34 -05:00
Scott Idem
32f8a75373 Refactor: Add microtask yields to journals module for consistency
Added await Promise.resolve() yields after IndexedDB writes to ensure
Dexie observers fire before function returns. Aligns with pattern
established in event loaders fix.

Journals module was already working correctly (preserved try_cache),
but adding yields ensures consistent timing behavior across all
nested data loading patterns.
2026-02-26 13:42:27 -05:00
Scott Idem
3849118fec Fix: Event session cold-start bug - presentations/presenters now load on first render
CRITICAL BUG FIX: Session view required 1-2 manual refreshes to display
presentations and presenters when IndexedDB was empty.

Root Cause:
- Nested loaders passed try_cache: false, preventing IDB writes
- Missing microtask yields caused race conditions between IDB writes
  and liveQuery subscriptions

Changes:
- ae_events__event_session.ts: Preserve try_cache in nested loads
- ae_events__event_presentation.ts: Block on presenter loads with await
  Promise.all() + preserve try_cache
- ae_events__event_presenter.ts: Add microtask yield after IDB write

Result: Presentations AND presenters now render correctly on first
navigation without requiring manual page refresh.
2026-02-26 13:40:36 -05:00
Scott Idem
9da3e5326b docs: reorganize and rename documentation files for consistency
- Apply consistent prefix naming: AE__, GUIDE__, PROJECT__, MODULE__, TODO__
- Move superseded/session docs to documentation/history/
- Migrate old/ directory contents to history/ with updated naming
- README.md: replace stale Modules section with accurate current routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 10:49:23 -05:00
Scott Idem
b1162b9f08 I am done. Just saving things for the night. Not a good day. 2026-02-25 20:17:03 -05:00
Scott Idem
95a56d25bf test: stabilize cold-start Playwright tests; fix editor bind:new_content fallback 2026-02-25 20:15:09 -05:00
Scott Idem
7b5c7528b6 All of the changes from today (Wednesday February 25, 2026) need to be reviewed. We spent over 6 hours trying to fix the page loading when viewing a fresh Session ID and Presentation ID. OpenAI and Gemini failed hard!!! I am at a lost and frustrated. I will probably need to deal with this myself. :-/ 2026-02-25 18:34:21 -05:00
Scott Idem
17620b6fbc refactor(events): enforce hierarchy consistency and id standardization 2026-02-25 17:53:20 -05:00
Scott Idem
197adff33b tests: add Playwright event badge CRUD + interaction tests; add minimal V3 mocks and env helper; update presenter/badge smoke tests to use helpers; convert test locals to snake_case 2026-02-24 17:49:43 -05:00
Scott Idem
39614c9cc2 test: remove stale tests/disabled/example.test.ts 2026-02-24 16:45:45 -05:00
Scott Idem
a7f6101cce test: move and rename private-network check to tests/private_network.test.ts; make diagnostic 2026-02-24 16:42:10 -05:00
Scott Idem
f2c426b595 test: combine and modernize private-network checks; remove legacy disabled variants 2026-02-24 16:38:36 -05:00
Scott Idem
7f9f93765d test: modernize v3 API security tests (mock /v3/, deterministic headers); add runnable modern copy 2026-02-24 16:36:27 -05:00
Scott Idem
c70e7a3bf9 test: add badge interaction test + README; ignore disabled tests in Playwright config 2026-02-24 16:32:50 -05:00
Scott Idem
e57bbca33e Work on CORS testing and fixes. Chrome and pfSense with the DNS resolution found a problem. Should be fixed now. 2026-02-23 18:18:58 -05:00
Scott Idem
30e44a0af1 Testing tests with Playwright 2026-02-21 10:05:21 -05:00
Scott Idem
7724cac492 Saving notes 2026-02-20 19:45:54 -05:00
Scott Idem
399455b67a feat(testing): Add foundational Playwright security test
Adds the first successful, stable Playwright integration test for the SvelteKit frontend. This test serves as a template for future UI/UX and integration tests.

Key outcomes and learnings captured in this test:
- Establishes a pattern for running tests against the high-speed 'npm run dev' server.
- Verifies critical API security header logic, including the unauthenticated bypass for lookups and account ID scavenging from localStorage.
- Solves application boot crashes in a test environment by injecting a complete, default 'ae_loc' state object into localStorage before the app hydrates.
- Demonstrates the correct, race-condition-free pattern for waiting on network requests that are handled by API mocks.

This commit also removes the old, unreliable Node.js-based scripts ('verify_jwt_logic.js', 'verify_jwt_sync.js') that these new tests replace.
2026-02-20 19:43:01 -05:00
Scott Idem
06dbccaaa4 Reorganized System Lookups page and added Time Zone priority filtering.
- Sequenced sections as Country, Subdivisions, then Time Zones.
- Implemented a reactive toggle for 'only_priority' in the Time Zone section to support high-priority filtering.
- Switched to a full-width card layout for improved readability of large datasets.
2026-02-20 18:03:42 -05:00
Scott Idem
2dfc8a5034 Implemented 'only_priority' filtering for V3 Lookups.
- Updated V3 lookup API and core timezone loader to support the 'only_priority' flag.
- Enabled high-priority timezone filtering in IDAA Recovery Meeting and Archive editors to streamline selection lists.
2026-02-20 17:17:09 -05:00
Scott Idem
52c9e765a0 Implemented Aether API V3 Lookup integration for standardized tables.
- Created 'src/lib/ae_api/api_get__lookup_v3.ts' to handle the new '/v3/lookup/{lu_type}/list' endpoint.
- Refactored 'get_ae_obj_li_for_lu' in 'api.ts' to prioritize the V3 system for countries, subdivisions, and time zones, with V2 fallback for legacy types.
- Ensured lookups use the 'x-no-account-id' bypass for unauthenticated site bootstrapping.
- Updated core country, subdivision, and time zone loaders to use the refined API interface.
2026-02-20 16:12:06 -05:00