Generate web slides from Comark

feat: presenter mode (Phase 2, cross-tab sync) master

The toolbar button now opens a new tab at ?role=presenter&uuid=<...> instead of flipping role in place. Both tabs subscribe to a BroadcastChannel named morkdeck-bridge-<uuid> and relay navigation events to each other, so the presenter tab can run on the speaker's laptop while the audience tab is fullscreened on the projector. URL routing (packages/wc/components/presentation/wc.ts): - ?role=presenter | audience drives the initial role passed to presentation.start. - ?uuid=<id> overrides this.uuid so both tabs reach the same BroadcastChannel; without it, each tab's renderer-generated uuid wouldn't match. Bridge (same file): - Wraps presentation.send so user-driven events (toolbar, chrome, IO) broadcast before being processed locally. - bridge.onmessage feeds remote events through the unwrapped original send so they don't echo back. RELAYED_EVENTS is currently the navigate.* set; timer.* and role.set stay per-tab. Audience scroll on remote nav (packages/runtime/actor): - scrollToSlide added to navigate.next/previous action lists, gated on role==='audience'. When the presenter advances, the audience tab's xstate updates currentIndex AND the page scrolls to it. - scrollToSlide also handles slide 0 now (the previous "only if > 0" guard meant navigating back to slide 1 didn't scroll). Toolbar (packages/wc/components/toolbar.ts): - togglePresenterMode now opens the new tab with the audience uuid and the current hash preserved, so the presenter opens on the same slide. Exit (packages/wc/components/presentation/wc.ts): - window.close() if window.opener exists (the normal flow). Falls back to role.set for ad-hoc testing (?role=presenter typed directly into the URL bar). Verified channel mechanics via in-page eval: - Local navigate.next broadcasts to channel and processes locally. - Remote navigate.next arriving via channel processes locally and does NOT re-broadcast (no echo loop). - URL ?role=presenter&uuid= correctly drives initial render. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>


+98 -17
4 changed files