-
Notifications
You must be signed in to change notification settings - Fork 129
TreeNode: set max-width #3370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
TreeNode: set max-width #3370
Conversation
|
Sure! You can address the other case in this PR unless it ends up being a bigger change. It would be great to get a puppeteer snapshot test covering this at different screen widths. Setting puppeteer's window width can be tricky sometimes, but give it a try. |
I added some tests, and they showing that my approach has problems with thought annotations. Putting the |
|
Okay, sounds good. At the end we'll need to reduce this down to the fewest tests that are needed cover the behavior, since snapshot tests are expensive and we don't want to slow down the test suite unnecessarily. |

Fixes #3353
I added a
max-widthtoTreeNodein order to stop it from overrunning the viewport width when thetransformapplied to indented thoughts exceeds the right padding. In order to do this, I needed to updated bulletWidth in LayoutTree in order to calculate the width of the bullet in the same way that it is calculated in Bullet. This might have unforeseen consequences, and I could duplicate that calculation insideTreeNodeinstead.