microsoft / vscode-prompt-tsx

MIT License
34 stars 1 forks source link

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

Closed jrieken closed 1 month ago

jrieken commented 1 month 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 1 month ago

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

connor4312 commented 1 month ago

Thanks!

connor4312 commented 1 month 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