Whiteboard: frame body is not interactive + slide-reorder buttons always look enabled #192
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#192
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?
Two related frame-UX bugs.
A. Frame body is not click/dblclick-targetable
The frame Konva group contains a Rect (dashed border,
name: "bg") and a Text label, both inside adraggable: truegroup (static/web/js/whiteboard/objects.js:1108-1224). The bg Rect has only a stroke — no fill — so the EMPTY interior of a frame isnt hit-testable. Two visible consequences:label.on("dblclick dbltap", …)(line 1211) is wired — sticky / text / shape allow dblclick anywhere on the objects body to enter text edit, so the affordance is inconsistent.Children inside the frame (those whose
parent_frame_idpoints at it) sit on the same Konva layer above the frame and grab their own hits, so adding hit-testing to the bg only triggers on TRULY empty interior space — no regression to child interaction.B. "Move slide up/down" always appears enabled
The selection toolbar adds two chevron buttons (
static/web/js/whiteboard/selection_toolbar.js:1215-1224) and the right-click menu adds two items (static/web/js/whiteboard/contextmenu.js:80-82) unconditionally for every frame, even when the frame is the first / last / only frame in the deck. Clicking them at the edge is a no-op (themoveFrameUp/moveFrameDownearly-exit inframes.js:50-64checksidx <= 0/idx >= length-1) but the UI gives no signal — buttons look enabled, menu items look clickable.Approach
A. Hit-test the frame body
fill: "rgba(0,0,0,0)"to the frames bg Rect at creation. Konva treats fully-transparent fills as hit-testable but invisible — the interior becomes clickable / draggable.dblclick dbltaphandler on the bg that calls the sameeditText(group, label, null)already used by the label.B. Edge-aware enable state
_renderFrame(selection_toolbar.js), compute the current frames position viaWhiteboardFrames.getFrames()and call_buildIconBtn(...).disabled = isFirst/isLast. If theres only one frame, both are disabled.contextmenu.js, omit the menu items when at the edge (or when theres only one frame). Right-click menus shouldnt carry disabled items — just dont insert them.Acceptance
Implementation Spec for Issue #192
Files to Modify
static/web/js/whiteboard/objects.jsstatic/web/js/whiteboard/selection_toolbar.jsstatic/web/js/whiteboard/contextmenu.jsPlan
A. Hit-test the frame body
File:
static/web/js/whiteboard/objects.js(~line 1108)Add a transparent fill on the bg Rect and a dblclick handler that opens the title editor.
Right after the label dblclick handler (~line 1211-1215), add:
B. Disable / hide slide-reorder controls at deck edge
Selection toolbar (
selection_toolbar.js:1215-1224)Compute the frame's index in the deck. Disable the chevron when at the edge.
The CSS already greys disabled buttons via Bootstrap's default
:disabledstyling (or whatever the existing rule does). Verify visually after rebuild.Right-click menu (
contextmenu.js:78-83)Skip the items at the edge:
Single-frame board:
frames.length === 1, idx === 0→ neither item appears, no divider.Acceptance Criteria
Notes
fill: 'rgba(0,0,0,0)'as hit-testable but invisible. (Compared tofill: nullwhich makes only the stroke hit-testable.) Verified by behavior on shapes elsewhere in the codebase.transformstartsnapshot path (tools.js) still uses the normalsnapshotBefore(node.id())for frames since they're regularWhiteboardObjects. No change needed there.:disabledstyling. If the visual isn't subtle enough, a small CSS rule inselection_toolbar.csscan be added later — out of scope here.Test Results + Final Summary
Changes
static/web/js/whiteboard/objects.js:fill: 'rgba(0,0,0,0)'— transparent fill, hit-testable. Empty frame body can be clicked / dragged / dblclicked.dblclick dbltaphandler on the bg Rect that opens the same title editor as the label.static/web/js/whiteboard/selection_toolbar.js:isFirst/isLastviaWhiteboardFrames.getFrames()and set.disabledaccordingly.static/web/js/whiteboard/contextmenu.js:Behaviour after fix
Gates
node -c objects.js / selection_toolbar.js / contextmenu.js— JS syntax OKcargo fmt --check— passcargo clippy --workspace --all-targets -- -D warnings— passManual verification still required
Rebuild + restart
hero_whiteboard_admin, hard-reload. Create 2–3 frames, then: