some glitchyness with iframes, check the iframe header #16
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_whiteboard#16
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?
Implementation Spec for Issue #16
Objective
Eliminate the visual desync between the Konva-rendered webframe header/body and the HTML iframe overlay during drag, stage pan, and wheel-zoom by hiding the overlay during these interactions and restoring it when they end.
Requirements
wrappermust be hidden (display:none) so only the Konva-rendered group (bg, header, label, placeholder) is visible while moving.display:block) in one atomic step.setAllInteractive(pointer-events)behavior invoked by transformer and layer drag handlers intools.jsmust remain in place (needed for transformer over iframes)..placeholderText and.labelText must be kept in sync with the currentbgwidth/height after a resize, so the visible placeholder during drag/pan/zoom matches the real frame dimensions.bg's current dimensions (already handled byupdateOverlayPositionreading from.bg).Files to Modify
crates/hero_whiteboard_ui/static/web/js/whiteboard/webframe.js- addhideOverlay(id)/showOverlay(id)helpers; hook them into group dragstart/dragend, stage dragstart/dragend, stage wheel (with debounce), and exposehideAllOverlays()/showAllOverlays()for the transformer path in tools.js.crates/hero_whiteboard_ui/static/web/js/whiteboard/tools.js- on transformstart hide all webframe overlays (in addition to disabling pointer events); on transformend show them again afterapplyTransformhas updated dimensions.crates/hero_whiteboard_ui/static/web/js/whiteboard/objects.js- in thewebframebranch ofapplyTransform, also update the.labeland.placeholderText nodes'widthso they match the new bg dimensions.Implementation Plan
Step 1: Add overlay hide/show helpers in webframe.js
Files:
crates/hero_whiteboard_ui/static/web/js/whiteboard/webframe.jshideOverlay(id)that setswrapper.style.display = 'none'and marksoverlays[id]._hiddenForInteraction = true.showOverlay(id, group)that clears the_hiddenForInteractionflag and callsupdateOverlayPosition(id, group).updateOverlayPositionso that ifoverlay._hiddenForInteractionis true it updates left/top/width/height silently but does NOT setdisplay = 'block'.hideAllOverlays()andshowAllOverlays()and export them.Dependencies: none
Step 2: Hide/show on group drag in webframe.js
Files:
crates/hero_whiteboard_ui/static/web/js/whiteboard/webframe.jsdragstarthandler to callhideOverlay(id).updateOverlayPositionfrom thedragmovehandler.showOverlay(id, group)ondragend.Dependencies: Step 1
Step 3: Hide/show on stage pan in webframe.js
Files:
crates/hero_whiteboard_ui/static/web/js/whiteboard/webframe.jsstage.on('dragmove.wf_<id>')listener withstage.on('dragstart.wf_<id>')(hide) andstage.on('dragend.wf_<id>')(show).remapOverlayanddestroyOverlayto detach the new namespaced listeners.Dependencies: Step 1
Step 4: Hide/show on wheel zoom in webframe.js
Files:
crates/hero_whiteboard_ui/static/web/js/whiteboard/webframe.jswheel.wf_<id>setTimeout-based handler with a debounced hide-then-show handler (~150 ms debounce).overlays[id]._wheelTimeoutand cancel it on destroy/remap.Dependencies: Step 1
Step 5: Hide overlays during transform in tools.js
Files:
crates/hero_whiteboard_ui/static/web/js/whiteboard/tools.jstransformer.on('transformstart'), aftersetAllInteractive(false), also callWhiteboardWebframe.hideAllOverlays().transformer.on('transformend'), afterapplyTransform(node)runs for each node andsetAllInteractive(true), callWhiteboardWebframe.showAllOverlays().Dependencies: Steps 1, 2
Step 6: Keep placeholder and label width in sync after resize in objects.js
Files:
crates/hero_whiteboard_ui/static/web/js/whiteboard/objects.jswebframebranch ofapplyTransform, after updating bg/header widths, update.placeholderwidth/height and.labelwidth to match the new bg dimensions.Dependencies: none
Acceptance Criteria
Notes
Test Results
cargo check --workspace: passcargo clippy -- -D warnings: passcargo fmt --check: passcargo test --workspace --lib: 0 passed / 0 failed (0)Note: changes are in vanilla JS (frontend) and have no corresponding Rust tests. UI behavior must be verified manually in the browser.
Implementation Summary
All six steps from the approved spec are implemented.
Changes
crates/hero_whiteboard_ui/static/web/js/whiteboard/webframe.jshideOverlay(id)/showOverlay(id, group)helpers plus module-levelhideAllOverlays()/showAllOverlays()._hiddenForInteractiongate inupdateOverlayPosition: while the flag is set, position/size are still updated but the wrapper'sdisplaystaysnone.group.on('dragmove', updateOverlayPosition)withdragstart→hideOverlayanddragend→showOverlay.stage.on('dragmove.wf_<id>', …)pan listener withdragstart.wf_<id>/dragend.wf_<id>.setTimeout(…, 10)wheel handler with a 150 ms debounced hide-then-show using_wheelTimeout.destroyOverlayandremapOverlaynow clear pending_wheelTimeoutand detach the newdragstart.wf_<id>/dragend.wf_<id>namespaced listeners.crates/hero_whiteboard_ui/static/web/js/whiteboard/tools.jstransformer.on('transformstart', …)now also callsWhiteboardWebframe.hideAllOverlays()aftersetAllInteractive(false).transformer.on('transformend', …)callsWhiteboardWebframe.showAllOverlays()afterapplyTransformhas written final bg dimensions (overlay picks up new size correctly).crates/hero_whiteboard_ui/static/web/js/whiteboard/objects.jsapplyTransformwebframe branch now also updates the.placeholderText (width + height) and.labelText (width) to match the new bg dimensions, so the Konva stand-in shown during drag/pan/zoom always matches the real frame.Test Results
cargo check --workspace: passcargo clippy --workspace -- -D warnings: passcargo fmt --check: passcargo test --workspace --lib: 0 passed / 0 failed (0 total)The workspace does not currently have Rust unit tests that exercise this code path. The changes are entirely in vanilla JS (frontend); UI behavior needs to be verified manually in the browser.
Manual verification checklist
setAllInteractive(false)path is preserved).Pull request opened: #23
This PR implements the changes discussed in this issue.