fix(canvas): 视频设置 - 按渠道能力隐藏尺寸并联动分辨率宽高

This commit is contained in:
ddCat committed 2026-08-29 11:05:59 +08:00
1 parent 6d77c250c1
commit 4b75504f75
15 files changed
+196 -50

No files matched your search

@@ -5,7 +5,7 @@ import { Button } from "antd";
import { VideoSettingsPanel, videoResolutionLabel, videoSecondsLabel, videoSizeLabel } from "@/components/video-settings-panel";
import { canvasThemes } from "@/lib/canvas-theme";
import { modelCapabilityConfigFor, resolveVideoResolutionValue } from "@/lib/model-capabilities";
import { modelCapabilityConfigFor, resolveVideoRatioValue, resolveVideoResolutionValue } from "@/lib/model-capabilities";
import { useThemeStore } from "@/stores/use-theme-store";
import type { AiConfig } from "@/stores/use-config-store";
@@ -24,10 +24,12 @@ export function CanvasVideoSettingsPopover({ config, onConfigChange, buttonClass
const [buttonRect, setButtonRect] = useState<DOMRect | null>(null);
const videoProfile = modelCapabilityConfigFor(config, config.model).video;
const resolutionSupported = Boolean(videoProfile?.resolutions.length);
const sizeSupported = Boolean(videoProfile?.ratios.length);
const resolution = videoProfile ? resolveVideoResolutionValue(videoProfile, config.vquality) : "";
const size = videoProfile ? resolveVideoRatioValue(videoProfile, config.size) : "";
const summary = [
...(resolutionSupported ? [videoResolutionLabel(resolution)] : []),
videoSizeLabel(config.size),
...(sizeSupported ? [videoSizeLabel(size)] : []),
videoSecondsLabel(config.videoSeconds),
].join(" · ");