mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-10 20:11:49 +00:00
PopoverMenu's toggle mode renders the trigger label from whichever item has `selected: true` — and AspectRatioPicker only marks an item selected when `useAspectRatio === ratio` for some ratio in `model.aspectRatios`. When the user picks an aspect ratio supported by model A and then switches to model B that doesn't include it, no item matches, the trigger has no label, and the aspect-ratio text silently disappears. Add an effect that, on every `selectedImageModel` change, resets `commonAspectRatio` to the new model's default if the current pick isn't in the new model's `aspectRatios`. Routes through `handleCommonAspectRatioSelect` so the editor letterbox follows the reset (the user's pick was unrenderable on this model anyway, so the fallback is correct here — distinct from the cold-load case).