Compare commits

...
Author SHA1 Message Date
Laurent Cozic 2b31e73070 Desktop: Fixes #15934: Restore vertical panel divider inside a column
When two panels stacked vertically in a column both lacked an explicit
height (e.g. the sidebar moved below the notebook list via View → Change
application layout), the divider between them stopped moving on drag:
onResize skipped the write on both sides because each was treated as an
absorber of remaining space.

Fix: when both the dragged panel and its next sibling are absorbers on
the drag axis, write the delta to the dragged panel so the divider
actually moves. The next sibling then absorbs the rest via the existing
flexible-space distribution.
2026-07-16 18:02:17 +01:00
@@ -130,18 +130,20 @@ function ResizableLayout(props: Props) {
};
const onResize: ResizeCallback = (_event, direction, _refToElement, delta) => {
// The absorber (width/height-less side) is skipped so the layout
// system keeps it flexible.
// A sized panel is skipped only if the other side is fixed; when
// both panels are absorbers, we write to the dragged one so the
// divider actually moves (the next sibling then absorbs the rest).
const isHorizontal = direction !== 'bottom';
const minSize = isHorizontal ? itemMinWidth : itemMinHeight;
const rawDelta = isHorizontal ? delta.width : delta.height;
const itemIsAbsorber = isHorizontal ? resizedItem.itemAbsorbsAlongAxis.width : resizedItem.itemAbsorbsAlongAxis.height;
const nextIsAbsorber = isHorizontal ? resizedItem.nextAbsorbsAlongAxis.width : resizedItem.nextAbsorbsAlongAxis.height;
const bothAbsorb = itemIsAbsorber && nextIsAbsorber;
let newLayout = props.layout;
if (!itemIsAbsorber) {
if (!itemIsAbsorber || bothAbsorb) {
const initial = isHorizontal ? resizedItem.initialWidth : resizedItem.initialHeight;
const newSize = Math.max(minSize, initial + rawDelta);
newLayout = setLayoutItemProps(newLayout, resizedItem.key, isHorizontal ? { width: newSize } : { height: newSize });