Textualize / trogon

Easily turn your Click CLI into a powerful terminal application
MIT License
2.4k stars 54 forks source link

Fix for layout issue with Textual 0.54 #78

Closed davep closed 3 months ago

davep commented 3 months ago

By the looks of things, with #77, the issue is that there is a Vertical that is width auto, which contains a Tree that is width auto, and a Label that is width 100%. The intention seems to be that the sidebar should be as wide as the tree is, and the tree should be as wide as its content needs; meanwhile the label should be the full width of its container.

At some point recently it seems the balance in this setup has changed and the 100% label is making its auto-width container extra greedy.

Given that there's no simple way of saying "be 100% of my parent but don't put pressure on its width calculation if it's width auto"[^1] this PR changes things so that the label itself is also width auto, and tries to ensure that the background looks like it did before.

The fundamental fix for this probably needs to be in Textual's layout code, but this will fix Trogon itself in the meanwhile.

Fixes #77.

[^1]: This smells like a similar class of problem to that which we ran into with Dialog.