Presentation share link on a frameless board silently opens a read-only session instead of a 'nothing presented' notice #197
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#197
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
Opening a presentation share link (
/board/{id}/view?present=1) on a board that has no frames drops the visitor into a normal read-only session with no explanation, instead of telling them there is nothing being presented.Confirmed root cause
crates/hero_whiteboard_admin/static/web/js/whiteboard/frames.jsstartPresentation()(~lines 130-139) handles the empty case:window.showNoFramesNoticeis defined only in the editor templatecrates/hero_whiteboard_admin/templates/web/board.html(~line 546). The presentation share link points at the read-only viewer route/board/{id}/view, which renderscrates/hero_whiteboard_admin/templates/web/board_view.html(and the shared-token viewer template). That template does not definewindow.showNoFramesNotice, so thetypeof ... === 'function'check is false,startPresentation()silently returns, and the visitor sees an ordinary read-only board with no indication that a presentation was expected but there is nothing to present.app.js(~304-308) triggers this on load when?present=1is present.Expected
When a visitor opens a presentation link for a board with no frames, they should see a clear, themed in-page notice (e.g. "Nothing is being presented — this board has no slides") instead of silently landing in a plain read-only session.
Requirements
board_view.htmland the shared-token viewer template), not only in the editor.Notes
?present=1:board_view.html, the shared-token viewer template used by the/s/{token}presentation flow, andboard.html. They must all expose the same notice.touch crates/hero_whiteboard_admin/src/assets.rsbeforecargo build --release -p hero_whiteboard_admin, and verify the served asset changed before testing.Implementation Spec for Issue #197
Objective
A visitor opening a presentation share link (
/board/{id}/view?present=1, or/s/{token}?present=1resolving to the viewer) for a board with no frames must see a clear, themed, dismissible in-page notice instead of silently landing in a plain read-only session. Single shared notice implementation across editor, read-only viewer, and shared-token viewer. No server/schema change.Requirements
--wb-surface/--wb-border/--wb-text).wb-presentingis never applied in the no-frames path).?present=1auto-start and a late remote-presentation join with zero frames.Files to Modify/Create
crates/hero_whiteboard_admin/static/web/js/whiteboard/frames.js-WhiteboardFramesowns a self-contained themedshowNoFramesNotice()(builds/injects its own DOM + inline themed styles); called from the no-frames branch instead of depending on a template-definedwindow.showNoFramesNotice.crates/hero_whiteboard_admin/templates/web/board.html- remove the now-redundantwindow.showNoFramesNotice, the#frames-empty-toastDOM node, and its CSS block.crates/hero_whiteboard_admin/src/assets.rs- no code change;touchonly to force rust-embed re-embed.No changes to
board_view.html,base_web.html,sync.js, orapp.js— frames.js is loaded by every presentation-capable template (board.html:152, board_view.html:152) andstartPresentation()is the only entry point.Implementation Plan
Step 1: Add a self-contained themed notice to WhiteboardFrames
Files:
crates/hero_whiteboard_admin/static/web/js/whiteboard/frames.jsshowNoFramesNotice()in the IIFE (near module-state ~220-222, beforestartPresentation): lazily create/reuse a singledocument.bodynode (idwb-no-frames-notice, idempotent like the existing_framesEmptyTimerreuse), apply themed inline styles equivalent to the existing#frames-empty-toastCSS (board.html:127-141;position:fixed;top:24px;left:50%;transform:translateX(-50%);background:var(--wb-surface);border:1px solid var(--wb-border);color:var(--wb-text);border-radius:8px;padding:10px 16px;font-size:13px;z-index:10000;box-shadow:0 4px 16px rgba(0,0,0,0.15);), message e.g. "Nothing is being presented — this board has no slides yet.", auto-dismiss via a module timer (clear prior; ~4000ms so an audience can read it), optional click-to-dismiss. Hiding sets display:none and never toucheswb-presenting.showNoFramesNoticeon the return block (~332-347).if (typeof window.showNoFramesNotice === 'function') {...}with a directshowNoFramesNotice();call; keep the earlyreturn;.Dependencies: none
Step 2: Remove the duplicated editor-only notice from board.html
Files:
crates/hero_whiteboard_admin/templates/web/board.html#frames-empty-toastCSS block (~125-141), the<div id="frames-empty-toast">node + its comment (~364-365), and thewindow.showNoFramesNoticedefinition +_framesEmptyTimervar (~543-552). Editor now uses the same singleWhiteboardFrames.showNoFramesNotice().Dependencies: Step 1 (JS replacement must exist first). Both land in one change set; can be edited in parallel since different files.
Step 3: Force asset re-embed and rebuild
Files:
crates/hero_whiteboard_admin/src/assets.rstouchit (no content change) so rust-embed (#[folder="static/web/"]) picks up the edited frames.js;cargo build --release -p hero_whiteboard_admin; verify the servedjs/whiteboard/frames.jscontains the new function before testing.Dependencies: Steps 1, 2
Acceptance Criteria
/board/{id}/view?present=1with zero frames shows the themed notice (not a silent read-only session)./s/{token}?present=1, viewer role → BoardViewTemplate) shows the same notice./board/{id}, or/s/{token}editor role → BoardTemplate) still shows a no-frames notice on Present — no regression.startPresentation()→ no-frames branch fires the notice; a latepresentation.slideonly sets_pendingRemoteSlideand never presents withoutstartPresentation()succeeding).wb-presentingnever applied in this path).Notes
startPresentation()is the only presentation entry point and lives in frames.js, which every presentation-capable template loads (board.html:152, board_view.html:152). Duplicating into board_view.html (Option b) is rejected — it reintroduces exactly the editor/viewer drift that caused this bug.?present=1reaches:/board/{id}/view→ BoardViewTemplate → board_view.html;/s/{token}→ BoardTemplate (editor role) or BoardViewTemplate (viewer);/board/{id}→ BoardTemplate. All load frames.js + app.js; all extend base_web.html which has no presentation JS/CSS — so JS-owned is the only guaranteed-shared location.window.showNoFramesNoticeis removed (not shimmed): the only definition is board.html:546 and the only reference is frames.js:135-136 — no other caller, no shim needed.window.showBoardDeletedNoticeis unrelated and untouched.#presentation-controlsin both templates) — DOM+CSS+JS in one file = true single source.touch crates/hero_whiteboard_admin/src/assets.rsbeforecargo build --release -p hero_whiteboard_admin, verify served frames.js changed before testing.Test Results
cargo test --workspace --lib: ok - all workspace lib suites passed (0 tests present; suite is the regression gate)
node --check frames.js: ok
Note: #197 is a JS/template-only change (single-source no-frames presentation notice). No JS unit harness exists in this repo; the Rust suite is the regression gate and the notice on the viewer/shared-token presentation route is verified manually in-browser.
Implementation Summary
JS/template-only, single-source. The no-frames presentation notice now lives in frames.js (WhiteboardFrames.showNoFramesNotice) instead of being defined only in the editor template, so the editor, the read-only viewer, and the shared-token presentation route all use the same implementation. No server/route/schema change.
Changes
frames.js
board.html
A repo-wide grep confirms the only remaining references to the notice are the three new frames.js sites (definition, call, export); board.html is fully cleaned.
Behavior after change
Tests