From b644aae413a420189ac1db4a0d448637bd9c4b47 Mon Sep 17 00:00:00 2001 From: Verssache Date: Wed, 28 Oct 2026 19:13:50 +0700 Subject: [PATCH 1/2] fix(test-page): match hyphenated model catalog ids The tester sidebar filtered /v1/models with legacy underscore prefixes (veo_3_1_t2v, veo_3_1_i2v, veo_3_1_r2v) while the catalog exposes hyphenated ids (veo-3.1-*, omni-1.1-flash-*). No video id matched, so every video section disappeared from the sidebar, Omni included. Classify models once through classifyModel(), normalizing underscores to hyphens so legacy ids still work, and reuse it for the sidebar filter, the type tag and getModelMeta(). Omni reference video needs the image uploader, which the old i2v/r2v substring checks missed entirely. Add the Omni and Extend sections plus their locale keys, and seed Omni entries in the fallback catalog. --- static/locales/test.json | 6 ++-- static/test.html | 59 +++++++++++++++++++++++++++------------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/static/locales/test.json b/static/locales/test.json index e1497547..c8039c19 100644 --- a/static/locales/test.json +++ b/static/locales/test.json @@ -21,7 +21,8 @@ "Veo 3.1 文生视频 (T2V)": "Veo 3.1 文生视频 (T2V)", "Veo 3.1 图生视频 (I2V)": "Veo 3.1 图生视频 (I2V)", "Veo 3.1 多图视频 (R2V)": "Veo 3.1 多图视频 (R2V)", - "视频放大 (Upsample)": "视频放大 (Upsample)", + "Omni 1.1 Flash 视频": "Omni 1.1 Flash 视频", + "视频续写 (Extend)": "视频续写 (Extend)", "使用内置候选模型列表:": "使用内置候选模型列表:", "加载模型失败:": "加载模型失败:", "未获取到可用模型,请检查 API Key 或稍后重试": "未获取到可用模型,请检查 API Key 或稍后重试", @@ -106,7 +107,8 @@ "Veo 3.1 文生视频 (T2V)": "Veo 3.1 Text-to-Video (T2V)", "Veo 3.1 图生视频 (I2V)": "Veo 3.1 Image-to-Video (I2V)", "Veo 3.1 多图视频 (R2V)": "Veo 3.1 Multi-reference video (R2V)", - "视频放大 (Upsample)": "Video upscaling (Upsample)", + "Omni 1.1 Flash 视频": "Omni 1.1 Flash Videos", + "视频续写 (Extend)": "Video extension (Extend)", "使用内置候选模型列表:": "Using built-in model suggestions:", "加载模型失败:": "Failed to load models:", "未获取到可用模型,请检查 API Key 或稍后重试": "No available models were returned. Check the API key or try again later.", diff --git a/static/test.html b/static/test.html index 7e86e7cb..377ffb4e 100644 --- a/static/test.html +++ b/static/test.html @@ -175,15 +175,34 @@

m.startsWith("gemini-3.1-flash-image") }, - "Nano Banana 2 Lite 图片": { filter: m => m.startsWith("gemini-3.1-flash-lite-image") }, - "Gemini 3.0 Pro 图片": { filter: m => m.startsWith("gemini-3.0-pro-image") }, - "Veo 3.1 文生视频 (T2V)": { filter: m => m.startsWith("veo_3_1_t2v") && !m.includes("4k") && !m.includes("1080p") }, - "Veo 3.1 图生视频 (I2V)": { filter: m => m.startsWith("veo_3_1_i2v") && !m.includes("4k") && !m.includes("1080p") }, - "Veo 3.1 多图视频 (R2V)": { filter: m => m.startsWith("veo_3_1_r2v") && !m.includes("4k") && !m.includes("1080p") }, - "视频放大 (Upsample)": { filter: m => !m.includes("image") && (m.includes("4k") || m.includes("1080p")) }, + "Gemini 3.1 Flash 图片": { filter: m => normalizeModelId(m).startsWith("gemini-3.1-flash-image") }, + "Nano Banana 2 Lite 图片": { filter: m => normalizeModelId(m).startsWith("gemini-3.1-flash-lite-image") }, + "Gemini 3.0 Pro 图片": { filter: m => normalizeModelId(m).startsWith("gemini-3.0-pro-image") }, + "Veo 3.1 文生视频 (T2V)": { filter: m => classifyModel(m) === "t2v" }, + "Veo 3.1 图生视频 (I2V)": { filter: m => classifyModel(m) === "i2v" }, + "Veo 3.1 多图视频 (R2V)": { filter: m => classifyModel(m) === "r2v" }, + "Omni 1.1 Flash 视频": { filter: m => classifyModel(m) === "omni" }, + "视频续写 (Extend)": { filter: m => classifyModel(m) === "extend" }, + "视频放大 (Upsample)": { filter: m => classifyModel(m) === "upsample" }, }; const FALLBACK_MODELS = { @@ -270,7 +289,11 @@

Date: Thu, 29 Oct 2026 16:44:09 +0800 Subject: [PATCH 2/2] fix(test-page): preserve reference inputs and support video extension Keep I2V/R2V reference uploads for upsample aliases and restore the legacy R2V 1080P fallback model. Add a localized source media ID input for Extend models and serialize it using the existing extend:// message contract. Restore Upsample translations and add browser regression coverage for model and language switching. Validation: 37 i18n/browser tests, Ruff, inline JavaScript syntax, locale key parity, and git diff --check. --- static/locales/test.json | 8 ++ static/test.html | 44 ++++++++-- tests/test_i18n_browser.py | 163 +++++++++++++++++++++++++++++++++++++ 3 files changed, 207 insertions(+), 8 deletions(-) diff --git a/static/locales/test.json b/static/locales/test.json index c8039c19..f21dbacf 100644 --- a/static/locales/test.json +++ b/static/locales/test.json @@ -10,6 +10,9 @@ "从左侧列表选择一个模型开始测试": "从左侧列表选择一个模型开始测试", "提示词 (Prompt)": "提示词 (Prompt)", "描述你想生成的内容...": "描述你想生成的内容...", + "源视频媒体 ID": "源视频媒体 ID", + "输入源视频的 mediaGenerationId": "输入源视频的 mediaGenerationId", + "请输入源视频的 mediaGenerationId": "请输入源视频的 mediaGenerationId", "上传图片": "上传图片", "点击或拖拽上传图片": "点击或拖拽上传图片", "选择模型后开始生成": "选择模型后开始生成", @@ -23,6 +26,7 @@ "Veo 3.1 多图视频 (R2V)": "Veo 3.1 多图视频 (R2V)", "Omni 1.1 Flash 视频": "Omni 1.1 Flash 视频", "视频续写 (Extend)": "视频续写 (Extend)", + "视频放大 (Upsample)": "视频放大 (Upsample)", "使用内置候选模型列表:": "使用内置候选模型列表:", "加载模型失败:": "加载模型失败:", "未获取到可用模型,请检查 API Key 或稍后重试": "未获取到可用模型,请检查 API Key 或稍后重试", @@ -96,6 +100,9 @@ "从左侧列表选择一个模型开始测试": "Choose a model from the list on the left to begin testing", "提示词 (Prompt)": "Prompt", "描述你想生成的内容...": "Describe what you want to generate...", + "源视频媒体 ID": "Source video media ID", + "输入源视频的 mediaGenerationId": "Enter the source video's mediaGenerationId", + "请输入源视频的 mediaGenerationId": "Enter the source video's mediaGenerationId", "上传图片": "Upload images", "点击或拖拽上传图片": "Click or drag images here to upload", "选择模型后开始生成": "Select a model to start generating", @@ -109,6 +116,7 @@ "Veo 3.1 多图视频 (R2V)": "Veo 3.1 Multi-reference video (R2V)", "Omni 1.1 Flash 视频": "Omni 1.1 Flash Videos", "视频续写 (Extend)": "Video extension (Extend)", + "视频放大 (Upsample)": "Video upscaling (Upsample)", "使用内置候选模型列表:": "Using built-in model suggestions:", "加载模型失败:": "Failed to load models:", "未获取到可用模型,请检查 API Key 或稍后重试": "No available models were returned. Check the API key or try again later.", diff --git a/static/test.html b/static/test.html index 377ffb4e..3ebe7975 100644 --- a/static/test.html +++ b/static/test.html @@ -59,12 +59,13 @@ .form-group { margin-bottom: 14px; } .form-group label { display: block; font-size: 13px; color: #888; margin-bottom: 6px; } -.form-group textarea { +.form-group textarea, .form-group input[type="text"] { width: 100%; background: #0f1117; border: 1px solid #2a2b3a; color: #e1e1e6; - padding: 10px 12px; border-radius: 8px; font-size: 14px; resize: vertical; min-height: 80px; + padding: 10px 12px; border-radius: 8px; font-size: 14px; font-family: inherit; } -.form-group textarea:focus { outline: none; border-color: #7c8aff; } +.form-group textarea { resize: vertical; min-height: 80px; } +.form-group textarea:focus, .form-group input[type="text"]:focus { outline: none; border-color: #7c8aff; } .image-upload-area { border: 2px dashed #2a2b3a; border-radius: 8px; padding: 20px; text-align: center; @@ -148,6 +149,11 @@

请选择模型一只可爱的橘猫趴在窗台上晒太阳,窗外是樱花盛开的春天 + +