角色动画面板新增可选参数入口开关:AGC 固定档位不再渲染假控件
- 新增可选 prop showParameters(默认 true):为 false 时不渲染「比例 / 时长 / 清晰度」 入口按钮与对应浮层菜单,默认值等于网页端美术画布今天的渲染,行为逐字不变。 - 关闭理由写进注释:宿主若不能把这三个值送进请求,渲染出来就是点了不生效的假控件。 - 单独成一个提交,便于共享面板被其它改动覆盖时单独摘取或回退。
This commit is contained in:
@@ -42,6 +42,13 @@ type ImageCanvasCharacterAnimationPanelViewProps = {
|
||||
>;
|
||||
onUpdateDuration: (frameCountValue: string) => void;
|
||||
onSubmit: () => void;
|
||||
/**
|
||||
* 比例 / 时长 / 清晰度入口是否渲染,默认 `true`,与美术画布一致。
|
||||
*
|
||||
* 传 `false` 的宿主必须自己说清这三个值由谁决定:它们不在该宿主的提交载荷里时,
|
||||
* 渲染出来就是点了不生效的假控件(改了 1080p 实际仍按固定档出图)。
|
||||
*/
|
||||
showParameters?: boolean;
|
||||
};
|
||||
|
||||
function resetFailedPanelStatus<
|
||||
@@ -126,6 +133,7 @@ export function ImageCanvasCharacterAnimationPanelView({
|
||||
setCharacterAnimationPanel,
|
||||
onUpdateDuration,
|
||||
onSubmit,
|
||||
showParameters = true,
|
||||
}: ImageCanvasCharacterAnimationPanelViewProps) {
|
||||
const [isParameterMenuOpen, setIsParameterMenuOpen] = useState(false);
|
||||
const parameterButtonRef = useRef<HTMLButtonElement | null>(null);
|
||||
@@ -220,19 +228,21 @@ export function ImageCanvasCharacterAnimationPanelView({
|
||||
))}
|
||||
</div>
|
||||
<div className="image-canvas-editor__character-animation-footer">
|
||||
<div className="image-canvas-editor__option-popover-anchor image-canvas-editor__option-popover-anchor--dimensions">
|
||||
<PlatformInlineOptionButton
|
||||
ref={parameterButtonRef}
|
||||
className="image-canvas-editor__option-cluster image-canvas-editor__option-cluster--dimensions"
|
||||
aria-label={`动画参数 ${ratioLabel} · ${panel.durationSeconds}秒 · ${panel.resolution}`}
|
||||
aria-expanded={isParameterMenuOpen}
|
||||
disabled={isGenerating}
|
||||
trailingIcon={<ChevronDown className="h-3 w-3" />}
|
||||
onClick={() => setIsParameterMenuOpen((open) => !open)}
|
||||
>
|
||||
{ratioLabel} · {panel.durationSeconds}秒 · {panel.resolution}
|
||||
</PlatformInlineOptionButton>
|
||||
</div>
|
||||
{showParameters ? (
|
||||
<div className="image-canvas-editor__option-popover-anchor image-canvas-editor__option-popover-anchor--dimensions">
|
||||
<PlatformInlineOptionButton
|
||||
ref={parameterButtonRef}
|
||||
className="image-canvas-editor__option-cluster image-canvas-editor__option-cluster--dimensions"
|
||||
aria-label={`动画参数 ${ratioLabel} · ${panel.durationSeconds}秒 · ${panel.resolution}`}
|
||||
aria-expanded={isParameterMenuOpen}
|
||||
disabled={isGenerating}
|
||||
trailingIcon={<ChevronDown className="h-3 w-3" />}
|
||||
onClick={() => setIsParameterMenuOpen((open) => !open)}
|
||||
>
|
||||
{ratioLabel} · {panel.durationSeconds}秒 · {panel.resolution}
|
||||
</PlatformInlineOptionButton>
|
||||
</div>
|
||||
) : null}
|
||||
<PlatformActionButton
|
||||
type="button"
|
||||
tone="secondary"
|
||||
@@ -277,7 +287,7 @@ export function ImageCanvasCharacterAnimationPanelView({
|
||||
</PlatformStatusMessage>
|
||||
) : null}
|
||||
</div>
|
||||
{isParameterMenuOpen
|
||||
{showParameters && isParameterMenuOpen
|
||||
? renderPanelPortal(
|
||||
<PlatformFloatingMenu
|
||||
className="image-canvas-editor__option-popover image-canvas-editor__portal-menu"
|
||||
|
||||
Reference in New Issue
Block a user