fix(P0-2): 画中画模式下addType自动切换为pip类型
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Failing after 22h47m21s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 22h47m21s

- 添加useEffect监听currentMode变化
- 当addType不在availableTypes中时自动设为第一个可用类型
- 修复画中画模式下添加片段仍是口播类型的bug
This commit is contained in:
灵应
2026-07-08 14:06:59 +08:00
parent 5a8158f181
commit 08a55f8711
@@ -66,6 +66,13 @@ const TimelinePanel: React.FC<TimelinePanelProps> = ({
? ["pip"]
: ["voice", "pip"]; // voice_pip 或默认
/* ── 模式切换时自动更新默认添加类型 ── */
useEffect(() => {
if (!availableTypes.includes(addType)) {
setAddType(availableTypes[0]);
}
}, [currentMode]);
/* ── 面板尺寸(宽度固定,高度由 useLayoutEffect 实测) ── */
const PICKER_W = 240; // 面板宽度(与 CSS 一致)
const GAP = 6; // 面板与"+"卡片的间距