Skip to content

Conversation

@NitnerocL
Copy link

I intend to extend Dialogs to display floating panels (see #3). For this, I need the panel / dialog to be resizable in only one direction (away from the sticky side).

Since the option to disable resize was already present, and the default allowed resize sides was somewhat arbitrary, I changed the bool disableResize for a flag enum allowing to specify which sides are allowed (or none).

⚠️ Public API breaking changes ⚠️

  • floatDialog(container: PanelContainer, x: number, y: number, grayoutParent?: PanelContainer, disableResize?: boolean) ➡️ floatDialog(container: PanelContainer, x: number, y: number, grayoutParent?: PanelContainer, resizeDirection?: ResizeDirection)
  • openInDialog(container: PanelContainer, event, dragOffset: Point, disableResize?: boolean) ➡️ openInDialog(container: PanelContainer, event, dragOffset: Point, resizeDirection?: ResizeDirection)

To disable resize, instead of passing true you know have to pass ResizeDirection.None or 0.

🚨 NB: If using JS with no type check, forgetting to migrate can silently cause bugs: since false == 0 and (true & 1) == true, passing false explicitly (to enable resizing) will now disable it, while passing true (to disable resizing) will now enable it only for the North side.

@NitnerocL
Copy link
Author

Should I document the breaking changes somewhere else than in this PR?

@NitnerocL NitnerocL marked this pull request as draft December 7, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant