Wire the Present button to frame-driven presentation mode #87
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#87
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?
Problem
The Present button in the board page (
templates/web/board.html:23) is currently hardcoded toonclick="alert('Presentation mode coming soon')", even though the underlying presentation module —static/web/js/whiteboard/frames.js— is already implemented (startPresentation,nextFrame,prevFrame,focusFrame) and is loaded by the page (board.html:242). Users see a placeholder alert instead of the working feature.Frames are zoom-to-fit slides: with one or more
Frameobjects on the board, the user clicks Present, the canvas zooms to fit the first frame, and arrow keys advance through the rest. Today none of that is reachable from the UI.Expected behavior
WhiteboardFrames.startPresentation()).window.alert. The currentframes.js:17already callsalert('No frames found...');which has the same UX problem; replace it with a themed toast / overlay.→/Space/PageDownadvance to the next frame (WhiteboardFrames.nextFrame()).←/PageUpgo to the previous frame (WhiteboardFrames.prevFrame()).Escexits presentation mode (WhiteboardFrames.stopPresentation()).Affected files
crates/hero_whiteboard_ui/templates/web/board.html— replace the inlinealertwith atogglePresentation()call; add a small presentation overlay (controls + close).crates/hero_whiteboard_ui/static/web/js/whiteboard/frames.js— replacealert(...)with a call into a UI hook (e.g.window.showFramesEmptyNotice && window.showFramesEmptyNotice()); add atogglePresentationAPI; capture+restore the previous zoom/pan instartPresentation/stopPresentation; add keyboard handler.crates/hero_whiteboard_ui/static/web/js/whiteboard/shortcuts.js(optional) — keep or augment any existing key bindings that should be suppressed during presentation mode.No server / SDK / openrpc / DB changes.
Acceptance criteria
alert(...); it toggles presentation mode throughWhiteboardFrames.window.alert).cargo check / clippy / fmt --check / testclean.Notes
body.classList.add('wb-presenting')flag with a small CSS block that hides.wb-navbar,.wb-toolbar,.wb-minimap,.wb-prop-panel,.wb-zoom. Restore by removing the class on exit.stage.scaleX(),stage.x(),stage.y()at presentation-start so exit can restore them. The currentstartPresentationdoesn't snapshot these.Implementation Spec for Issue #87
Objective
Wire the existing
WhiteboardFramespresentation module to the Present button in the board page, with keyboard navigation (arrows / space / page-keys) and Escape to exit. Hide the chrome (navbar, toolbar, minimap, properties panel, zoom controls) while presenting; restore zoom/pan and chrome on exit. Replace thealert(...)for the no-frames case with an in-page themed notice.Requirements
window.alert).→/Space/PageDownadvance,←/PageUpgo back,Escexits.board.htmlandframes.js.cargo check / clippy / fmt --check / testclean.Files to Modify
crates/hero_whiteboard_ui/templates/web/board.html— change the Present button'sonclickto call a newtogglePresentation(); add a small CSS block (in{% block head %}) that hides chrome whenbody.wb-presentingis set; add a tiny in-pageframes-empty-toastnotice; add a global keydown listener that delegates toWhiteboardFrameswhen in presentation mode.crates/hero_whiteboard_ui/static/web/js/whiteboard/frames.js— capture/restore zoom + pan instartPresentation/stopPresentation; togglebody.wb-presenting; replace thealert(...)with a call to a globalshowNoFramesNotice()(defined in board.html); export atogglePresentation()convenience.No server / SDK / openrpc / DB changes.
Implementation Plan
Step 1:
frames.js— capture/restore zoom+pan, body class, toggle, replace alertFiles:
crates/hero_whiteboard_ui/static/web/js/whiteboard/frames.jspreviousView = nullto hold{ scale, x, y }snapshotted atstartPresentation. OnstopPresentation, restorestage.scaleX/scaleY/x/yfrom it viaWhiteboardCanvas.setZoom+stage.position(...), then callWhiteboardCanvas.drawGrid().startPresentation:frames.length === 0, callwindow.showNoFramesNotice && window.showNoFramesNotice()instead ofalert(...). Bail.presentationMode = true, setcurrentFrameIndex = 0, addwb-presentingtodocument.body.classList, callfocusFrame(frames[0]).stopPresentation:presentationMode, removewb-presentingfrom body, restore zoom/pan frompreviousView, clearpreviousView.togglePresentation()that callsstartPresentation()when inactive,stopPresentation()when active.nextFrame/prevFramekeep their current behavior; export them.Dependencies: none.
Step 2:
board.html— wire button, keyboard, notice, hide-chrome CSSFiles:
crates/hero_whiteboard_ui/templates/web/board.htmlonclick:{% block head %}, add CSS that hides the chrome whenwb-presentingis on<body>: Plus a small fixed-position notice that becomes the no-frames toast:{% block content %}(anywhere; it'sposition:fixed):{% block scripts %}, add the global helpers: Insert before the existing rename keydown handler so Escape on presentation takes priority.Dependencies: Step 1 (the
togglePresentation/isPresentationModeAPI).Acceptance Criteria
alert(...); clicking it toggles presentation mode.window.alert); the toast auto-dismisses after ~2.5 s.→/Space/PageDownadvance through frames;←/PageUpgo back;Escexits.cargo check / clippy / fmt --check / testall pass.Notes
stage.scaleX(),stage.x(),stage.y()at start. The existingframes.jsstartPresentationdoesn't snapshot these.bi-play-fillicon for both states; the title attributePresent (Esc to exit)handles the affordance for now.isPresentationMode()is true, so typing in modals isn't affected (presentation mode hides modals' parent panel anyway).Test Results
cargo test --workspace: all green.cargo clippy --workspace -- -D warnings: clean.cargo fmt --all -- --check: clean.cargo check --workspace: clean.node --check frames.js: parses cleanly.Manual verification recommended:
window.alert.Implementation Summary
2 files changed, +90 / -2.
frames.js{scale, x, y}atstartPresentationsostopPresentationcan restore the previous view.body.wb-presentingso the host template can hide its chrome via CSS.alert(...)with a call to a globalwindow.showNoFramesNotice()(host-defined toast).togglePresentation()convenience export that callsstart/stopbased on the current mode.board.htmlonclick="alert(...)"withonclick="WhiteboardFrames.togglePresentation()". Tooltip now readsPresent (Esc to exit).{% block head %}style block: hides.wb-navbar / .wb-toolbar / .wb-minimap / .wb-zoom / #properties-panelwhilebody.wb-presentingis set.#frames-empty-toastmarkup + awindow.showNoFramesNotice()helper that shows it for ~2.5 s.keydownlistener that delegates toWhiteboardFrameswhile presentation mode is active: Esc exits, Right/Space/PageDown advances, Left/PageUp goes back. Inserted before the existing rename keydown so Escape on presentation has priority.Verification
cargo test --workspace: all green.cargo clippy --workspace -- -D warnings: clean.cargo fmt --all -- --check: clean.cargo check --workspace: clean.node --check frames.js: parses cleanly.Notes / caveats