Skip to content

Cooking mode: step text shifted right (centered) when step has no photo and no ingredients #47

Description

@dubadub

Summary

In cooking mode, the step text is horizontally centered (appears "shifted to the right") when the step has no photo and no ingredients. As soon as the step has either a step photo or at least one ingredient, the text becomes left-aligned as expected.

Reported by Christophe (via email), who kindly provided a reproducible example with three variants of the same recipe:

Bonjour, sur la recette Pâte sablée, si il n'y a pas d'image le texte est décalé vers la droite. Le problème disparaît également s'il y a un ingrédient.
Cela fait pareil sur d'autres recettes.

Steps to reproduce

  1. Create a recipe Pâte sablée.cook where one step (e.g. step 2) contains only plain text — no @ingredient, no #cookware photo for that step (i.e. no Pâte sablée.2.jpg next to the file).
  2. Open the recipe and start cooking mode.
  3. Navigate to that step.

Minimal step content that reproduces it:

Étape 2:

Sabler la pâte jusqu'à obtention d'un crumble.

Former un puit au centre du crumble.

Observed vs expected

Variant Step photo (….2.jpg) Ingredient in step Result
V1 text left-aligned (OK)
V2 ✅ (@test{1%test}) text left-aligned (OK)
V3 text block centered / shifted right

Expected: step text should be left-aligned regardless of whether the step has a photo or ingredients.

Likely cause

In CookingModeScreen.kt the pager page Column uses horizontalAlignment = Alignment.CenterHorizontally, and the step content is wrapped in Column(modifier = Modifier.widthIn(max = 360.dp)) without fillMaxWidth(). The inner column therefore wraps to its content width: a step photo or an ingredient row stretches it to the full 360 dp (text looks left-aligned), but a text-only step wraps to the widest text line and the whole block gets centered by the parent. Constraining it with fillMaxWidth().widthIn(max = 360.dp) (or equivalent) should keep text-only steps left-aligned.

Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidAndroid app relatedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions