Skip to content

Keep non-growing text at intrinsic width in Apple rows - #397

Merged
tiensonqin merged 1 commit into
mainfrom
devin/1795100865-apple-row-intrinsic-text
Nov 19, 2026
Merged

tiensonqin merged 1 commit into
mainfrom
devin/1795100865-apple-row-intrinsic-text

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

In an Apple row, LUIRowLayoutPolicy.childLayoutPriority gave a grow sibling priority 0.5 and plain text priority 0. SwiftUI's HStackLayout then compressed short text to zero width. In logseq/mobile's Settings→Tabs, the ✓/○ glyph text next to a grow:1 button had a frame width of 0: invisible, though still present for accessibility.

childLayoutPriority now takes the child's kind:

  • Non-growing text/heading/paragraph get priority 1, so they keep their intrinsic width.
  • Growers stay at 0.5.
  • Flexible containers stay at 0, and single-line behavior is unchanged.

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. LUIAppleBackendTests adds policy assertions, and docs/api-migrations.md records the change. Swift compilation relies on CI (apple-tests). Core (289), Web (173) and tooling (37) tests pass.


Product Engineer opened this PR for Tienson
Implemented in session Implement LUI ADR 0007
Review with Devin · Open in Devin Desktop


@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

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)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@tiensonqin
tiensonqin merged commit 8b8c0f4 into main Nov 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant