Skip to content

Conversation

@xStrom
Copy link
Member

@xStrom xStrom commented Dec 16, 2025

Portal already had constrain_vertical and constrain_horizontal properties but these were only used to hide the scrollbar. They didn't actually affect the child layout in any way.

Indeed, the Portal layout implementation had a simple hardcoded let max_child_size = bc.max(), meaning that the child was always fully constrained.

This PR implements actual constrainment logic, configurable with the aforementioned properties. When not set to constrain, the child gets unbounded constraints. After all, that is the main point of Portal - to be able to scroll over giant children.

Also, when an axis is constrained, Portal now also ignores mouse wheel scrolling in that direction, in addition to hiding the visual scrollbar.

@xStrom xStrom added the masonry Issues relating to the Masonry widget layer label Dec 16, 2025
Copy link
Contributor

@PoignardAzur PoignardAzur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When not set to constrain, the child gets unbounded constraints. After all, that is the main point of Portal - to be able to scroll over giant children.

I deliberately removed that behavior, and I don't want it to be added back.

There are a lot of widgets that return bc.max() as their size; if you give them infinite constraints, the layout code will panic. (Which is an improvement over the previous status quo, "the widget will fail to render for unclear reasons"). Yes, we could add a special case to all these widgets along the lines of "if constraints are infinite, return X instead of bc.max(), but I'm also against such special casing.

I think we should discuss this on Zulip.

@PoignardAzur
Copy link
Contributor

Is this superseded by #1560?

@xStrom
Copy link
Member Author

xStrom commented Jan 16, 2026

Most of it yes, but not 100%. The mouse scroll stuff is not in #1560. Let this remain open for now as a temporary issue tracker. I'll extract out the non-superseded parts after #1560 lands.

@xStrom
Copy link
Member Author

xStrom commented Jan 16, 2026

Alright, this is now fully superseded by #1560 and #1583.

@xStrom xStrom closed this Jan 16, 2026
@xStrom xStrom deleted the portal-size branch January 16, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

masonry Issues relating to the Masonry widget layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants