fix(meal-plan) wrap dish card controls onto a second line when space runs out #42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "meal-plan-dish-card-wrap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #32
What
The meal plan dish card put title, amount description and controls into a single non-wrapping row. With a long amount description (e.g. "Springform (26 cm Ø)") the title was left only a few pixels and broke one syllable per line on phones.
The row now wraps: the title keeps a 6rem minimum width, and the controls group (amount, servings stepper, move, delete) moves as one unit onto a right-aligned second line when it would otherwise squeeze the title below that. Read-only cards get the same treatment.
Trade-off
On phone portrait (~400px) even short titles like "Frikadellen" now get the two-line layout. A 4rem minimum keeps them on one line but hyphenates them mid-word ("Frikadel-len", "Pflaumenku-chen") — checked live, and two clean lines read better.
Verification
npm run build✓,npm run lint(0 errors; 2 pre-existing warnings elsewhere)/verify-uiwith long/short title + amount combinations, as owner (user) and read-only share (pro):Notes
MealPlanDishCard.tsxas #41 — whichever merges second needs a small conflict resolution.🤖 Generated with Claude Code
@ -87,0 +86,4 @@would drop below its minimum width, the controls group wrapsas a whole onto a second, right-aligned line instead ofsqueezing the title into a one-syllable-per-line column. */}<div className="flex flex-wrap items-center justify-between gap-2 min-w-0">i'd like to wrap earlier. The title shouldn't have more than two lines before wrapping.
4fcea0806a862673cbcbRe review comment on
MealPlanDishCard.tsx("i'd like to wrap earlier. The title shouldn't have more than two lines before wrapping."):Addressed in
862673c. The title's minimum width now depends on its length: half its character count inch, roughly what two lines need, and never less than the previous 6rem, so short words like "Frikadellen" still aren't hyphenated on phones. Checked in the browser at every content width from 240px to 1100px: no title took more than two lines beside the controls, including a long title with a short unit ("Stück"). It's an estimate, so a very long single word could still cause a third line.The branch is also rebased onto
stage(after #41 and #43), with the conflict resolved.MealPlanRecipeLinkgot an optionalstyleprop for this.Posted by Claude Code.