Skip to content

fix images steps' with sections - #202

Merged
dubadub merged 2 commits into
cooklang:mainfrom
pinage404:recipe_images
Nov 26, 2025
Merged

dubadub merged 2 commits into
cooklang:mainfrom
pinage404:recipe_images

Conversation

@pinage404

@pinage404 pinage404 commented Nov 25, 2025 •

Copy link
Copy Markdown
Contributor

Bugs introduced in #195

And found here #195 (comment)


I tried to replace 0 with sections.len(), sections.len() + 1 and total_steps, but it doesn't work

So, i displayed the content

dbg!(entry.step_images());

I tried with a personal recipe with sections and images, and i see

[src/server/ui.rs:356:45] entry.step_images() = StepImageCollection {
    images: {
        0: {
            2: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.3.jpg",
            3: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.4.jpg",
            20: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.21.jpg",
            13: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.14.jpg",
            29: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.30.jpg",
            5: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.6.jpg",
            11: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.12.jpg",
            14: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.15.jpg",
            16: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.17.jpg",
            26: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.27.jpg",
            30: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.31.jpg",
            15: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.16.jpg",
            19: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.20.jpg",
            0: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.1.jpg",
            10: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.11.jpg",
            4: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.5.jpg",
            21: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.22.jpg",
            22: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.23.jpg",
            6: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.7.jpg",
            1: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.2.jpg",
            9: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.10.jpg",
            17: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.18.jpg",
            8: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.9.jpg",
            7: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.8.jpg",
            12: "/home/pinage404/Project/mine/moku/Recettes/Plat principal/Potimarron à la marmite.13.jpg",
        },
    },
}

But i have 3 sections in my recipe

Could it be possible that the sections are not correctly represented in the RecipeEntry::step_images() ?


I don't know how to add a test on this one, there is currently no recipe in the seed folder that have sections

Should i add fake sections in one seed/*.cook file to be able to add a test ?

@dubadub

dubadub commented Nov 25, 2025

Copy link
Copy Markdown
Member

Hmmm, might be an issue with find library, need to check there

@dubadub

dubadub commented Nov 25, 2025

Copy link
Copy Markdown
Member

Should i add fake sections in one seed/*.cook file to be able to add a test ?

Feel free to add a new recipe with section, would be good to showcase syntax anyway

@pinage404

Copy link
Copy Markdown
Contributor Author

Feel free to add a new recipe with section, would be good to showcase syntax anyway

I added a recipe, i wasn't really inspired

@pinage404

Copy link
Copy Markdown
Contributor Author

might be an issue with find library, need to check there

Is it ok to merge this patch to fix the current CLI before fixing the find libary ?

@pinage404

pinage404 commented Nov 25, 2025 •

Copy link
Copy Markdown
Contributor Author

@dubadub
dubadub merged commit c0938db into cooklang:main Nov 26, 2025
@dubadub

dubadub commented Nov 26, 2025

Copy link
Copy Markdown
Member

Thank you so much!

@pinage404
pinage404 deleted the recipe_images branch September 13, 2026 18:09
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.

2 participants