Repository navigation
Give the product name its own line in the shelf list (#31) - #34
Merged
Merged
Conversation
The name shared one Row with the quantity stepper and the move button, so it was only ever allotted the width those controls left behind — 103dp of a 452dp card on a Pixel 7 Pro. In Dutch it was worse still: "Verplaatsen" is seven characters longer than "Move", squashing names down to two or three characters. maxLines=2 + ellipsis had hidden the one-char-per-line squash without giving the name any width back. Stack the card instead: name on its own full-width line, stepper and move button beneath it. The name's width no longer depends on how long the current locale's move label happens to be. The action row is a FlowRow so the move button wraps rather than clipping at large font scales. Also retarget FlowTestBase.clickNameArea at the card's top: the name moved from the left column to the top line, so a 50%-height tap now lands on the stepper — the disabled-"−"-swallows-the-click trap that helper exists for.
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.
Fixes #31
Root cause
The product name and every control lived in one
Row. The two stepper buttons (Material's 58dp min-width each) and the moveTextButtonare measured at their intrinsic width first, soModifier.weight(1f)on the name only ever got the leftover. Measured on a Pixel 7 Pro, in English: the name got 103dp of a 452dp card — 23%. In Dutch it's worse, because "Verplaatsen" is seven characters longer than "Move", which is why the reporter saw names cut toCh at…/Ge h….The existing
maxLines = 2+ ellipsis had hidden the one-char-per-line squash from an earlier report, but it never gave the name any width back — it just changed how the squash looked.Fix
Stack the card: the name gets its own full-width line, with the stepper and move button beneath it. The name's width no longer depends on how long the current locale's move label is — the coupling is gone structurally, not tuned around.
The action row is a
FlowRowso the move button wraps to its own line instead of being clipped off the card at large accessibility font scales.FlowTestBase.clickNameAreais retargeted at the top of the card: the name moved from the left column to the top line, so a 50%-height tap now lands on the stepper — the disabled-−-swallows-the-click trap that helper was written for.Tests
ProductNameLayoutFlowTestcovers both halves, and both assertions fail onmain:Chateaubriand) lays out on one unellipsized line, which is what the reporter asked forVerification
Drove the real app on a Pixel 7 Pro against a mocked backend, with the reporter's own product names:
Chateaubriand,RunderrookvleesVerplaatsenfully visibleFull suite green: 39/39 instrumented, 124/124 unit, ktlint + detekt clean.