fix(video-studio): map t2v selection to i2v sibling by family on image upload

Uploading an image while in t2v mode reset the model to allI2V[0]; with
the i2v list being a concatenation of regular models + effects, that index
shifts as entries are reordered, so users saw seemingly random switches
(e.g. Veo 3.1 → AI Video Effects or seedance lite). Look up the matching
i2v variant by family (veo3.1, kling-v3.0, etc.) and only fall back to
allI2V[0] when no sibling exists.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Anil Matcha 2026-05-05 22:07:21 +05:30
commit b2d331e7d8

View file

@ -130,8 +130,13 @@ export function VideoStudio() {
}
if (!imageMode) {
imageMode = true;
selectedModel = allI2V[0].id;
selectedModelName = allI2V[0].name;
const currentT2V = allT2V.find(m => m.id === selectedModel);
const sibling = currentT2V?.family
? allI2V.find(m => m.family === currentT2V.family)
: null;
const target = sibling || allI2V[0];
selectedModel = target.id;
selectedModelName = target.name;
document.getElementById('v-model-btn-label').textContent = selectedModelName;
updateControlsForModel(selectedModel);
}