Repository navigation
Keep non-growing text at intrinsic width in Apple rows - #397
Merged
Merged
Conversation
Comment on lines
+1716
to
+1725
| let growingButton = LUIRowLayoutPolicy.childLayoutPriority( | ||
| kind: .button, grow: 1, styleClass: nil) | ||
| for kind in [LUINodeKind.text, .heading, .paragraph] { | ||
| #expect(LUIRowLayoutPolicy.childLayoutPriority( | ||
| kind: kind, grow: nil, styleClass: nil) > growingButton) | ||
| #expect(LUIRowLayoutPolicy.childLayoutPriority( | ||
| kind: kind, grow: 0, styleClass: "secondary") > growingButton) | ||
| #expect(LUIRowLayoutPolicy.childLayoutPriority( | ||
| kind: kind, grow: 1, styleClass: nil) == growingButton) | ||
| } |
Contributor
There was a problem hiding this comment.
🔍 Rendered glyph width remains untested
growingRowChildrenPreserveTrailingControls checks priority numbers without rendering a row. These assertions pass even if nonWrappingRowContent stops forwarding the child's kind. A hosted, constrained-width row test can verify that the trailing glyph retains nonzero width.
Was this helpful? React with 👍 or 👎 to provide feedback.
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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.
Summary
In an Apple
row,LUIRowLayoutPolicy.childLayoutPrioritygave agrowsibling priority 0.5 and plain text priority 0. SwiftUI'sHStackLayoutthen compressed short text to zero width. In logseq/mobile's Settings→Tabs, the ✓/○ glyphtextnext to agrow:1button had a frame width of 0: invisible, though still present for accessibility.childLayoutPrioritynow takes the child'skind:text/heading/paragraphget priority 1, so they keep their intrinsic width.Verified on the iOS simulator with logseq/mobile#194: the glyphs now render at 14–16pt, and Settings, the sidebar, journals and the editor toolbar show no visual regressions. Dynamic type and long-text truncation were not covered.
LUIAppleBackendTestsadds policy assertions, anddocs/api-migrations.mdrecords the change. Swift compilation relies on CI (apple-tests). Core (289), Web (173) and tooling (37) tests pass.Implemented in session Implement LUI ADR 0007
Review with Devin · Open in Devin Desktop