- Moved `EventCockpitDeck` below main header in `SessionsPage.tsx` - Refactored `WorkshopDrawer.tsx` to strictly use a 2-state display toggle (`#eventCreateState` and `#eventHandoffState`) - Added `aria-label`s to copy buttons for accessibility - Configured `#status-banner` with `role="status"` and `aria-live="polite"` - Fixed mobile title text wrapping on `#createdEventTitle` - Fixed script emoji injection logic to prevent double emojis - Added JS reset logic in `closeDelegateDrawer` to restore drawer states and clear form data Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
4.4 KiB
4.4 KiB
TASK METADATA
- Target Files:
ui/components/SessionsPage.tsx,ui/components/sessions/WorkshopDrawer.tsx,ui/components/sessions/SessionsScript.tsx,ui/ui_scripts.test.ts - Core Objective: Overhaul visual hierarchy of
/dashboard/sessionsand enforce strict 2-state mutually exclusive rendering inWorkshopDrawer.tsx. - Dependencies: None.
- Additional Important Notes: Must use pure vanilla JavaScript for DOM
manipulation (no React/framework state). Ensure copy pills trigger accessible
notifications (aria-live/toast) with explicit
aria-labeltags. Fix double emoji bug in JS. Ensure mobile title wrapping. All changes must passui/ui_scripts.test.ts.
2. Architectural Considerations & Risks
-
Risks:
- DOM Manipulation Regression: Because this UI operates strictly on
vanilla JavaScript, changing the layout and grouping DOM elements within new
containers (
#eventCreateStateand#eventHandoffState) risks breaking existing DOM ID bindings inSessionsScript.tsx. All existing DOM IDs must be preserved. - Test Compatibility: Client scripts are validated via hermetic execution
in
ui/ui_scripts.test.ts. Script modifications must remain structurally valid and strictly avoid any external framework dependencies. - Mobile Layout Breakage: When fixing long titles to wrap correctly, CSS
properties
overflow-wrap: break-wordandword-break: break-wordmust be paired with bounded max-widths to prevent horizontal container stretching.
- DOM Manipulation Regression: Because this UI operates strictly on
vanilla JavaScript, changing the layout and grouping DOM elements within new
containers (
-
Alternatives:
- The container-based 2-state machine approach for
WorkshopDrawer.tsxis native and robust. Using a class-based toggle was considered, but explicit element display manipulation is clearer for the specific 2-state requirement.
- The container-based 2-state machine approach for
3. Proposed Implementation
Phase 1: Page Hierarchy Update (ui/components/SessionsPage.tsx)
- Header Block Relocation: Move the main header block
(
<h1>Active Sessions & Passes</h1>, subtitle, and[ 🔑 Delegate Session ]button) to be the uppermost visible element below the#status-banner. - Section Hierarchy:
- Section 1:
EventCockpitDeck(Event Passescards). If 0 event passes exist, render a clean empty state or let the deck cleanly return null without an orphaned section heading. - Section 2:
SessionTable/SessionDeck(Active Sessions).
- Section 1:
Phase 2: WorkshopDrawer 2-State Machine (ui/components/sessions/WorkshopDrawer.tsx)
- State 1 (
#eventCreateState): Wrap the initial creation form (#eventForm), inputs, submit button, and cancel button in<div id="eventCreateState" style="display: block;">. - State 2 (
#eventHandoffState): Wrap the credential cards in<div id="eventHandoffState" style="display: none;">.- Render the 3 distinct cards (PIN + /join, Direct Link, CLI 1-Liner).
- Add explicit
aria-labelon copy buttons ("Copy Universal PIN","Copy Direct Link","Copy Terminal curl command"). - Render a single "Dismiss" button at the bottom of
#eventHandoffState.
- Drawer Title Transition: Add
id="eventDrawerHeaderTitle"to the top header so JavaScript can transition it from"New Event Pass"\rightarrow"Event Pass Active". - Mobile Title Wrapping: Ensure
createdEventTitlehasoverflow-wrap: break-word; word-break: break-word;with safe max-width.
Phase 3: JavaScript Logic Update (ui/components/sessions/SessionsScript.tsx)
- State Toggling: Update
handleCreateEventso that upon successful creation:- Sets
document.getElementById('eventCreateState').style.display = 'none'. - Sets
document.getElementById('eventHandoffState').style.display = 'block'. - Updates
document.getElementById('eventDrawerHeaderTitle').textContent = 'Event Pass Active'.
- Sets
- Drawer Reset: When the drawer is closed or dismissed, reset state back:
#eventCreateState.style.display = 'block'#eventHandoffState.style.display = 'none'- Reset form inputs and restore header to
'New Event Pass'.
- Emoji Fix: Remove the hardcoded
'🎟️ 'prefix from the event title injection line:document.getElementById('createdEventTitle').textContent = ev.name + ' Live!';
Phase 4: Quality Gates
- Run
deno fmtanddeno task lint. - Run Deno tests:
deno test --allow-all(specifically validatingui/ui_scripts.test.ts).