Normalize containers' handling of children/content
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 827
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 40
Description
### What is the problem or limitation you are having?
`Box` works like a div or other box in CSS, which is a node which can contain children that continue the hierarchy downward.
By contrast, `ScrollContainer`, `SplitContainer`, and `OptionContainer` each count as an opaque leaf node, and their `content` starts over again as a new root node.
### Describe the solution you'd like
I don't yet have much of an idea how feasible it would be, or how it would be accomplished under the hood, but things would be much more consistent if these containers could truly be containers in the node/style context.
From a CSS standpoint, at least once we eventually arrive at some version of Colosseum, one would expect to be able to set `overflow: scroll` on a Box to *turn it into* what would currently have to be a ScrollContainer with a box in it. (I haven't really looked at the backend implementations yet, but I imagine this would be difficult to translate, at least on OSes where a box/section and a scrolling pane are separate widgets. Making *every* box two native widgets is probably highly inefficient, but hot-swapping a native widget for two native widgets also seems fraught.)
### Describe alternatives you've considered
Leave things as they are, potentially special-casing `content` to receive similar treatment to `children` in places that need to walk the tree downward.
### Additional context
The current arrangement complicates things for:
- #2938, since there are multiple root nodes, and the order in which their layouts are computed / recomputed matters
- #3161 and any other current/future properties that need to cascade down through all children
Contributor guide
Research direction
No files, tests, or entry points are named. Start by tracing how Box, ScrollContainer, SplitContainer, and OptionContainer represent node/style context and handle children versus content, then review the interactions with #2938 and #3161. Done means the containers participate consistently in hierarchy, layout ordering, and descendant property cascading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100