Summary
VoltraAndroid.Text does not honor line limits (maxLines prop and style numberOfLines) when rendered through the non-bitmap Android text path.
Repro
- Render an Android widget text node with either:
maxLines={1} on VoltraAndroid.Text, or
style={{ numberOfLines: 1 }}
- Provide long text that should truncate.
- Observe text is not line-limited in normal text renderer.
Expected
Android text should respect line limits consistently, same as button/input components and bitmap text renderer.
Actual
Line limits are ignored in RenderText normal path.
Root cause
RenderText in packages/voltra/android/src/main/java/voltra/glance/renderers/TextAndImageRenderers.kt called:
Text(text = text, modifier = finalModifier, style = glanceTextStyle)
without passing maxLines, and did not reconcile maxLines with style lineLimit.
Proposed fix
- Compute effective line limit with priority:
maxLines prop
- style
numberOfLines (mapped to lineLimit)
- default
Int.MAX_VALUE
- Pass
maxLines to Glance Text(...)
- Apply same line limit in bitmap rendering path for consistency.
Notes
A patch implementing this is on branch fix/android-text-line-limits.
Summary
VoltraAndroid.Textdoes not honor line limits (maxLinesprop and stylenumberOfLines) when rendered through the non-bitmap Android text path.Repro
maxLines={1}onVoltraAndroid.Text, orstyle={{ numberOfLines: 1 }}Expected
Android text should respect line limits consistently, same as button/input components and bitmap text renderer.
Actual
Line limits are ignored in
RenderTextnormal path.Root cause
RenderTextinpackages/voltra/android/src/main/java/voltra/glance/renderers/TextAndImageRenderers.ktcalled:Text(text = text, modifier = finalModifier, style = glanceTextStyle)without passing
maxLines, and did not reconcilemaxLineswith stylelineLimit.Proposed fix
maxLinespropnumberOfLines(mapped tolineLimit)Int.MAX_VALUEmaxLinesto GlanceText(...)Notes
A patch implementing this is on branch
fix/android-text-line-limits.