feat(layout): add overlap support for dock components#983
Open
quanho wants to merge 9 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an overlap option to the dock layout system so multiple components can share the same dock edge without stacking (i.e., without each consuming additional center space), while still ensuring the center boundary accounts for the largest overlap component per direction.
Changes:
- Introduces
layout.overlapin dock config + component factory plumbing. - Updates dock layout reduction + positioning logic to support overlap anchoring at the center boundary.
- Adds overlap-focused layout tests and updates public chart settings documentation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/picasso.js/src/core/layout/dock/docker.js | Skips size-reduction for overlap components, adjusts center boundary by max overlap size, and anchors overlap components to the center boundary during positioning. |
| packages/picasso.js/src/core/layout/dock/config.js | Adds overlap() getter/setter to dock config with default false. |
| packages/picasso.js/src/core/layout/dock/tests/dock-layout.spec.js | Adds test cases validating overlap positioning, center boundary behavior, and @key reference compatibility. |
| packages/picasso.js/src/core/component/component-factory.js | Wires overlap into dock definition extraction/migration into settings.layout. |
| packages/picasso.js/src/core/chart/index.js | Documents layout.overlap in ComponentSettings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ents in dock layout
Caele
reviewed
May 18, 2026
Caele
left a comment
There was a problem hiding this comment.
looks good as far as I can tell, but i'm no picasso.
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
Previously, multiple components docked to the same edge (e.g.
top) would always stack — each one consuming space and pushing the center area further inward. There was no way for two components to share the same edge position independently with their own sizes.Solution
Adds an
overlapoption to the dock configuration. Whenoverlap: true, a component is positioned at the inner edge of the center area for its dock direction (anchored from the center outward), without affecting how other components are laid out.Behavior
The center boundary per direction is determined by:
This means:
All overlap components share the same anchor point (the center boundary), so their inner edges are aligned. Normal components also align outward from this same boundary.
Examples
Basic overlap —
Anormal 30px,Boverlap 20px,Coverlap 15px:Center stays at
y=30—max(30, 20) = 30.Overlap exceeds normals —
A30px,B20px normals,C70px overlap:Center moves to
y=70—max(50, 70) = 70.Combining with
@references — components can dock at overlap components using the existing@keysyntax, inheriting their rect.Usage
Checklist