fix: selection box paints above shapes on the unified canvas - #559
Open
bvnaik05 wants to merge 1 commit into
Open
fix: selection box paints above shapes on the unified canvas#559bvnaik05 wants to merge 1 commit into
bvnaik05 wants to merge 1 commit into
Conversation
SelectionLayer mounted inside the block-layer template, before WhiteboardLayer — so on the unified canvas an opaque whiteboard object (a sticky, an image, another shape) drawn later in the SVG covered the dashed selection outline and resize handles of a shape underneath it. TextEditor, HoverOutline, and FlowchartHoverHandles already carry this same fix for the same reason (frappe#441/frappe#258/frappe#261). Consolidate the two scattered SelectionLayer mounts (an unconditional one in the block layer, a legacy-whiteboard-only fallback after WhiteboardLayer) into one mount at the end of the z-stack, gated for both block mode and a legacy whiteboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When objects are selected, the selection box (dashed outline + resize/rotate handles) could render behind other objects instead of on top of them — specifically on the unified canvas, where an opaque whiteboard object (a sticky note, an image, another shape) drawn after the selected shape would visually cover its selection chrome wherever the two overlapped.
Root cause
SelectionLayerwas mounted inside the block-layer template, beforeWhiteboardLayer. SVG paints in document order, so any whiteboard object painted after it covered the selection outline and handles underneath it.Three other overlays in the same file (
TextEditor,HoverOutline,FlowchartHoverHandles) already carry an identical fix for the identical reason, referencing prior issues #441, #258, #261 —SelectionLayeritself was simply missed when that pattern was established.Fix
Consolidate the two scattered
SelectionLayermounts — an unconditional one inside the block-layer template, and a legacy-whiteboard-only fallback afterWhiteboardLayer— into a single mount at the very end of the viewport's z-stack, gated for both block mode and a legacy whiteboard (v-if="showBlockLayer || isWhiteboard").Testing
yarn vitest run— 149 files / 1731 tests pass.editorPaintOrder.test.js(the existing house pattern for pinning z-order via source inspection) with two new assertions:SelectionLayermounts only afterWhiteboardLayer, and exactly once.🤖 Generated with Claude Code