Investigate Defering Pane initialization until after layout is completed #5619

Closed
opened 2026-01-31 00:17:36 +00:00 by claunia · 5 comments
Owner

Originally created by @zadjii-msft on GitHub (Dec 17, 2019).

Found during the course of investigating #607. Right now we attempt to create the UI of the Pane immediately on construction. While investigating commandline args, I'd try to create a bunch of Panes. This didn't work, because the Pane would have 0 height/width, and would fail to create the UI, or attache the child, until a resize came through.

This is overall bad. We should probably wait until we complete the first layout to calculate how much size we have. Part of the reason this was so bad is that we're manually setting the width/height of our rows/columns to the number of pixels equal to some % of what's available. When that's being calculated, there's only 0px available.

Originally created by @zadjii-msft on GitHub (Dec 17, 2019). Found during the course of investigating #607. Right now we attempt to create the UI of the Pane _immediately_ on construction. While investigating commandline args, I'd try to create a bunch of `Pane`s. This didn't work, because the Pane would have 0 height/width, and would fail to create the UI, or attache the child, until a resize came through. This is overall bad. We should probably wait until we complete the first layout to calculate how much size we have. Part of the reason this was so bad is that we're manually setting the width/height of our rows/columns to the number of pixels equal to some % of what's available. When that's being calculated, there's only 0px available.
claunia added the Issue-TaskNeeds-Tag-FixProduct-TerminalArea-UserInterface labels 2026-01-31 00:17:36 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 17, 2019):

I just had a crazy thought. Have we been missing something Xaml gives us for free for a long time?

<ColumnDefinition Width="49*" />
<ColumnDefinition Width="51*" />

Star sizes are proportional-weighted; perhaps we can parlay that into percentages?

@DHowett-MSFT commented on GitHub (Dec 17, 2019): I just had a crazy thought. Have we been missing something Xaml gives us for free for a long time? ``` <ColumnDefinition Width="49*" /> <ColumnDefinition Width="51*" /> ``` `Star` sizes are proportional-weighted; perhaps we can parlay that into percentages?
Author
Owner

@zadjii-msft commented on GitHub (Dec 17, 2019):

@DHowett-MSFT huh. Never considered that. Though, I don't think that'll really work, since I think those have to be integer values. When we add the pane snapping in #3181, the percentages won't be even integers anymore, we'll start getting crazy fractions.

@zadjii-msft commented on GitHub (Dec 17, 2019): @DHowett-MSFT huh. Never considered that. Though, I don't think that'll really work, since I think those have to be integer values. When we add the pane snapping in #3181, the percentages won't be even integers anymore, we'll start getting crazy fractions.
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 17, 2019):

Nah, docs say they can be weird things like 0.5* and stuff.

@DHowett-MSFT commented on GitHub (Dec 17, 2019): Nah, docs say they can be weird things like `0.5*` and stuff.
Author
Owner

@zadjii-msft commented on GitHub (Dec 17, 2019):

no way. Then yea we could probably use that. Thanks for the tip!

@zadjii-msft commented on GitHub (Dec 17, 2019): no way. Then yea we could probably use that. Thanks for the tip!
Author
Owner

@zadjii-msft commented on GitHub (Apr 14, 2023):

Uh, it kinda looks like we already do this. Neat. Either that, or I firmly don't remember what I was talking about here. Either way:

@zadjii-msft commented on GitHub (Apr 14, 2023): Uh, it kinda looks like we already do this. Neat. Either that, or I firmly don't remember what I was talking about here. Either way:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5619