microsoft / vscode-prompt-tsx

MIT License
44 stars 3 forks source link

Flex-grow doesn't work correctly when nested #85

Closed jrieken closed 2 months ago

jrieken commented 2 months ago

Multiple nested element using flex-grow will all get the same budget, meaning tokens consumers by a former element are still signalled as being available to later elements.

jrieken commented 2 months ago

https://github.com/microsoft/vscode-prompt-tsx/pull/84 adds a failing/skipped test that shows the problem

connor4312 commented 2 months ago

Thanks!

connor4312 commented 2 months ago

@joyceerhl I notice this commit made a change to only count literals when they're part of messages. This change prevents flex sizing from working inside a singular message.

https://github.com/microsoft/vscode-prompt-tsx/commit/3749d49ada686709b0779bd5464a03a8de707142#diff-ebf58e632d5520d055bd7f7c89079a5341c6ea55bc576134937361fa51578955L424-L438

Was this change intentional? Moving the for loop back outside the if fixes the test Joh submitted, and all other tests still pass