Requested behavior
Please provide framework-owned desktop/window boundary handling that preserves a user's chosen window size and position.
A desktop changing size should not reapply the window's initial percentage dimensions. The window should only be adjusted if the new usable desktop bounds would leave it out of bounds.
Scope and attribution
This is a request for a documented framework policy for desktop app windows or boundary-constrained dialogs. Reapplying initial dimensions from a consumer's resize handler is application behavior; this report does not claim that Neo's dialog class itself resets windows to a fixed percentage.
The goal is to avoid requiring each consumer to implement geometry ownership, boundary observation, and clamping independently.
Desired interaction
- Open a resizable window inside a desktop workspace and manually resize or move it.
- Enlarge the desktop: preserve the window's size and position.
- Shrink the desktop while the window still fits: preserve the window's size and position.
- Shrink the desktop so the window extends outside it: move the window back inside using the smallest necessary adjustment.
- Only reduce the window's dimensions if it is too large to fit within the available workspace at any position. Adjust only the dimensions that need it.
Observe the actual configured desktop/workspace size rather than resetting window geometry for every browser resize or repeated ResizeObserver notification.
Proposed acceptance criteria
- User-selected geometry remains authoritative after a resize gesture finishes.
- Unchanged desktop dimensions and repeated identical resize notifications produce no geometry writes.
- A desktop size change produces no geometry writes for windows that remain fully in bounds.
- Moving a window back into bounds is preferred to shrinking it.
- If the window is larger than the available workspace, shrink it only as necessary and keep its controls reachable; document behavior when configured minimum dimensions exceed the available area.
- Expanding the desktop does not automatically expand or recenter normal windows.
- Observe the configured boundary container, including a desktop workspace that excludes a toolbar/taskbar, rather than always using document.body.
- Delayed measurements must not overwrite a newer user drag/resize or apply to a closed/destroyed window.
- Maximized windows may follow the available desktop area as a separate, explicit state; restoring should use the normal window geometry according to a documented policy.
Framework resize integration
The same geometry contract should keep dimension configs and the rendered dialog/drag-preview dimensions synchronized. In the public resize implementation, Resizable writes wrapperStyle while DragZone initializes proxy dimensions in style; component.Base.updateStyle gives style precedence for a single-root component. Consumers should not need a custom adapter to make ordinary resizable dialogs retain their new size.
Related
- #21199: desktop window manager ownership.
- #21201: desktop container and app-window classes.
- #21090: fixed boundary lookup during a resize gesture; this request covers preserving/constraining windows when the desktop itself changes size.
Contract Ledger
Added by the claimer at intake on 21 Nov. The sections above are the reporter's. This section records the placement from the 17 Nov triage comment [QUARANTINED_URL: github.com] as a contract.
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback / Edge Case |
Docs |
Evidence |
Neo.dialog.Base#keepInBoundary_ (new, default false) and #constrainToBoundary() (new) |
Desired interaction 1–5 and the ACs above |
When the boundaryContainerId node changes size, a dialog that would leave it moves back inside by the smallest distance, and shrinks only on an axis it cannot fit on. A dialog that stays inside gets no write, and a repeated size gets no measurement. The same check runs when the dialog mounts, when a show or maximize animation ends, and after a restore from maximized. A move lands inside too: the drag's own clamp leaves a drop at the edge up to 2px past it. |
Nothing is written while the dialog is hidden, maximized, animating, or held in a move or resize; its next show, restore or size change checks again. A measurement that a newer check or a user gesture overtook writes nothing, and neither does one for a destroyed dialog. The dialog's minWidth and minHeight in px are never undercut: a minimum that exceeds the boundary keeps the top-left corner inside. |
JSDoc; learn/guides/uibuildingblocks/WebDesktops.md |
unit/dialog/KeepInBoundary.spec.mjs; e2e/desktop/Basic.spec.mjs with a shrinking viewport |
Neo.dialog.Base#boundaryContainerId (existing; becomes reactive) |
Same |
A change moves the observation to the new container. |
null observes nothing. |
JSDoc |
unit/dialog/KeepInBoundary.spec.mjs |
Neo.util.Rectangle#fitTo(bounds) (new, public) |
The private fit that alignTo() uses (#21115) |
Returns a copy moved inside bounds by the smallest distance, shrunk only on an axis that cannot fit, never below its minWidth/minHeight. |
A minimum larger than the bounds keeps the leading edge inside. |
JSDoc |
unit/util/Rectangle.spec.mjs |
Neo.main.addon.ResizeObserver (existing) |
Neo.manager.DomEvent#addResizeObserver, delegate: '#id' |
A target registered as document.body dispatches under that id, so its listeners fire. Today the dispatch keys on the node's own id, which is empty on a body without one. |
— |
JSDoc |
unit/main/addon/ResizeObserver.spec.mjs |
Neo.desktop.Container#getWindowConfig() (existing) |
Epic #21198 |
Every app window gets keepInBoundary: true next to its workspace boundaryContainerId. |
An appWindowConfigs entry can set it to false. |
JSDoc |
unit/desktop/Container.spec.mjs |
The maximized state adds no surface. Its CSS already fills the workspace (resources/css/src/desktop/AppWindow.css), and a restore returns the normal geometry, which the first row then keeps inside.
Requested behavior
Please provide framework-owned desktop/window boundary handling that preserves a user's chosen window size and position.
A desktop changing size should not reapply the window's initial percentage dimensions. The window should only be adjusted if the new usable desktop bounds would leave it out of bounds.
Scope and attribution
This is a request for a documented framework policy for desktop app windows or boundary-constrained dialogs. Reapplying initial dimensions from a consumer's resize handler is application behavior; this report does not claim that Neo's dialog class itself resets windows to a fixed percentage.
The goal is to avoid requiring each consumer to implement geometry ownership, boundary observation, and clamping independently.
Desired interaction
Observe the actual configured desktop/workspace size rather than resetting window geometry for every browser resize or repeated ResizeObserver notification.
Proposed acceptance criteria
Framework resize integration
The same geometry contract should keep dimension configs and the rendered dialog/drag-preview dimensions synchronized. In the public resize implementation, Resizable writes wrapperStyle while DragZone initializes proxy dimensions in style; component.Base.updateStyle gives style precedence for a single-root component. Consumers should not need a custom adapter to make ordinary resizable dialogs retain their new size.
Related
Contract Ledger
Added by the claimer at intake on 21 Nov. The sections above are the reporter's. This section records the placement from the 17 Nov triage comment [QUARANTINED_URL: github.com] as a contract.
Neo.dialog.Base#keepInBoundary_(new, defaultfalse) and#constrainToBoundary()(new)boundaryContainerIdnode changes size, a dialog that would leave it moves back inside by the smallest distance, and shrinks only on an axis it cannot fit on. A dialog that stays inside gets no write, and a repeated size gets no measurement. The same check runs when the dialog mounts, when a show or maximize animation ends, and after a restore from maximized. A move lands inside too: the drag's own clamp leaves a drop at the edge up to 2px past it.minWidthandminHeightin px are never undercut: a minimum that exceeds the boundary keeps the top-left corner inside.learn/guides/uibuildingblocks/WebDesktops.mdunit/dialog/KeepInBoundary.spec.mjs;e2e/desktop/Basic.spec.mjswith a shrinking viewportNeo.dialog.Base#boundaryContainerId(existing; becomes reactive)nullobserves nothing.unit/dialog/KeepInBoundary.spec.mjsNeo.util.Rectangle#fitTo(bounds)(new, public)alignTo()uses (#21115)boundsby the smallest distance, shrunk only on an axis that cannot fit, never below itsminWidth/minHeight.unit/util/Rectangle.spec.mjsNeo.main.addon.ResizeObserver(existing)Neo.manager.DomEvent#addResizeObserver,delegate: '#id'document.bodydispatches under that id, so its listeners fire. Today the dispatch keys on the node's ownid, which is empty on a body without one.unit/main/addon/ResizeObserver.spec.mjsNeo.desktop.Container#getWindowConfig()(existing)keepInBoundary: truenext to its workspaceboundaryContainerId.appWindowConfigsentry can set it tofalse.unit/desktop/Container.spec.mjsThe maximized state adds no surface. Its CSS already fills the workspace (
resources/css/src/desktop/AppWindow.css), and a restore returns the normal geometry, which the first row then keeps inside.