Conversation
Taffy 0.4 has been released 2 months ago. We've been using an older commit from their 0.4 development branch since November.
Member
|
Looks reasonable! 👍 |
osiewicz
added a commit
to RemcoSmitsDev/zed
that referenced
this pull request
May 18, 2024
We reverted bump to taffy 0.4.3 following an issue spotted by @maxdeviant where chat text input was not being rendered correctly:  This was an issue with the previous attempt to upgrade to taffy 0.4.0 as well. We bail early in `compute_auto_height_layout` due to a missing width: https://github.com/zed-industries/zed/blob/df190ea84621837c44fa50c62837bdbea04b9e22/crates/editor/src/element.rs#L5266 The same issue is visible in story for auto-height editor (or rather, the breakage is visible - the editor simply does not render at all there). I tracked down the breakage to DioxusLabs/taffy#573 ; it looks like it specifically affects editors with auto-height. In taffy <0.4 which we were using previously, we'd eventually get a proper width for auto-height EditorElement after having initially computed the size. With taffy 0.4 however (and specifically that PR mentioned earlier), we're getting `Size::NONE` in layout phase [^1]. I've noticed though that even with taffy <0.3, the `known_dimensions.width` was always equal to `available_space.width` in layout phase. Hence, I went with falling back to `available_space.width` when it is a definite value and we don't have a `known_dimensions.width`. Done this way, both chat input and auto-height story render correctly. /cc @as-cii Related: zed-industries#11606 zed-industries#11622 zed-industries#7868 zed-industries#7896 [^1]: This could possibly be related to change in what gets passed in https://github.com/DioxusLabs/taffy/pull/573/files#diff-60c916e9b0c507925f032cecdde6ae163e41b84b8e4bc0a6c04f7d846b0aad9eR133 , though I'm not sure if editor is a leaf node in this case Release Notes: - N/A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We reverted bump to taffy 0.4.3 following an issue spotted by @maxdeviant where chat text input was not being rendered correctly:

This was an issue with the previous attempt to upgrade to taffy 0.4.0 as well. We bail early in
compute_auto_height_layoutdue to a missing width:zed/crates/editor/src/element.rs
Line 5266 in df190ea
The same issue is visible in story for auto-height editor (or rather, the breakage is visible - the editor simply does not render at all there).
I tracked down the breakage to DioxusLabs/taffy#573 ; it looks like it specifically affects editors with auto-height. In taffy <0.4 which we were using previously, we'd eventually get a proper width for auto-height EditorElement after having initially computed the size. With taffy 0.4 however (and specifically that PR mentioned earlier), we're getting
Size::NONEin layout phase 1.I've noticed though that even with taffy <0.3, the
known_dimensions.widthwas always equal toavailable_space.widthin layout phase. Hence, I went with falling back toavailable_space.widthwhen it is a definite value and we don't have aknown_dimensions.width.Done this way, both chat input and auto-height story render correctly.
/cc @as-cii
Related:
#11606
#11622
#7868
#7896
Release Notes:
Footnotes
This could possibly be related to change in what gets passed in https://github.com/DioxusLabs/taffy/pull/573/files#diff-60c916e9b0c507925f032cecdde6ae163e41b84b8e4bc0a6c04f7d846b0aad9eR133 , though I'm not sure if editor is a leaf node in this case ↩