Audience joined via presentation link can exit and see whole board #107
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_whiteboard#107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When someone joins via a presentation share link (
/s/<token>?present=1), they currently can press Esc or click the Exit button in the control bar to drop out of presentation mode and see the entire board. That defeats the purpose of the presentation link — the recipient was meant to watch slides, not roam the board.Steps to reproduce
Expected
Audience joining via
?present=1cannot exit presentation mode. The Exit button is hidden and Esc has no effect for them. The presenter (who did not arrive via?present=1) can still exit normally.Actual
The audience drops out of presentation and can pan / zoom around the entire board.
Notes
?present=1.?present=1, since that's another exit path.?present=1) is out of scope — we only need to remove the casual Exit / Esc / back-link affordances.Implementation Spec for Issue #107
Objective
When someone joins via a presentation share link (
?present=1), they should be locked into presentation mode. The Exit button is hidden, the Esc keydown handler is suppressed, and the navbar back-link in the viewer template doesn't show. The original presenter (no?present=1) keeps the full Exit/Esc affordances.Requirements
?present=1cannot stop presentation through any in-page UI (Exit button, Esc, viewer navbar back-link).board.html(editor share with?present=1) andboard_view.html(viewer share with?present=1).frames.jsorsync.js— purely a template/UI gate.Files to Modify
crates/hero_whiteboard_ui/templates/web/board_view.html— gate Exit button, Esc handler, and navbar back-link on?present=1.crates/hero_whiteboard_ui/templates/web/board.html— same gating for Exit button + Esc handler. (No navbar back-link change here — the editor template's navbar is already hidden viabody.wb-presenting .wb-navbar { display:none }, so the back-link is unreachable while presenting. For the viewer template, the navbar is hidden via the same rule, so we may not even need the navbar tweak — verify during implementation.)Implementation Plan
Step 1: Detect
?present=1once and gate audience UIFiles:
crates/hero_whiteboard_ui/templates/web/board_view.html,crates/hero_whiteboard_ui/templates/web/board.htmlIn each template's existing
bindPresentationIIFE (or near the top of the inline<script>block):Then:
Hide the Exit button — if
_isAudience, setexitBtn.style.display = 'none'and skip theaddEventListener('click', ...)wiring. Cheaper than removing the node from the DOM, and survives any code that re-queries the button by ID.Suppress the Esc handler — in the existing
document.addEventListener('keydown', ...)block, addif (_isAudience) return;beforeif (e.key === 'Escape').(Viewer only) — the navbar (
<div class="wb-navbar">) is already hidden bybody.wb-presenting .wb-navbar { display:none !important; }, so there's no extra step needed unless smoke-testing reveals an edge case where the audience leaves presentation (which they shouldn't be able to). Skip this unless reproducible.Dependencies: none.
Acceptance Criteria
/s/<token>?present=1— no Exit button visible in the control bar./board/<id>) — Exit button visible; Esc still exits.?present=1— same audience lockdown as viewer share with?present=1.cargo fmt,clippy --all-targets -D warnings,cargo test --workspace --libclean (no Rust changes; templates only re-compile via Askama).Notes
?present=1flag is purely a UX hint — anyone can edit the URL bar. We're closing the casual exit affordances, not the URL-hacking path. That tradeoff was explicitly accepted in the issue.style.display = 'none'keeps the DOM stable so any other code that grabs the node by ID (e.g. shortcut bindings, future features) doesn't crash.Test Results
cargo fmt --all -- --check— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo check -p hero_whiteboard_ui— cleancargo test --workspace --lib— 0 failed (no unit tests in any crate; no regressions)Templates re-compiled by Askama. JS-only logic gated on
URLSearchParams.get('present').Implementation Summary
Lock the audience into presentation when they arrive via
?present=1. The presenter is unaffected.Detection
At the top of each template's inline
<script>block:Gating
crates/hero_whiteboard_ui/templates/web/board.htmlstopPresentationwhen_isAudienceis true (Prev/Next still work for the audience).style.display = 'none'for audience; click handler not wired.crates/hero_whiteboard_ui/templates/web/board_view.html_isAudienceis true.The viewer-template navbar is already hidden by
body.wb-presenting .wb-navbar { display:none !important; }, so the back-link is unreachable while presenting — no extra work needed.Files Changed
crates/hero_whiteboard_ui/templates/web/board.html—+8/-2crates/hero_whiteboard_ui/templates/web/board_view.html—+12/-2Test Results
cargo fmt --all -- --check— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo check -p hero_whiteboard_ui— cleancargo test --workspace --lib— 0 failuresManual smoke
/board/<id>→ Exit visible, Esc still exits./s/<token>?present=1→ no Exit button, Esc does nothing, Prev/Next/reactions still work.?present=1→ same audience lockdown.Notes
?present=1) is out of scope, as documented in the issue.