The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.
TypeScript agent-skillsagentic-aiai-agentsai-videobyokclaude-codecodexdeepseek-harnessdsh-plugingenerative-ailocal-firstmcpmotionmotion-graphicsmultimodalopenmotionreverse-engineeringvideo-editingvideo-generationworkbuddy
fix(studio): restore version history in the MVP editor
luogao910b8edd36f2
diff --git a/docs/editor-fork.md b/docs/editor-fork.mdindex f86af06d..3be86e7b 100644--- a/docs/editor-fork.md+++ b/docs/editor-fork.md@@ -8,9 +8,9 @@The Motion host now exposes an MVP editor. `StudioHost.mvpEditor` gates product entry points without deleting native editing, source, history or MCP services. The root route resolves the active project before mounting `ArtifactViewer`; home, conversation and browser-tab components are not mounted. `WorkspaceFrame` lists searchable projects, waits for pending saves before switching, and opens the project drawer on demand, including embedded views.-The visible panels are Compositions, Assets, Catalog, Preview, Design, Layers, Renders and Timeline. `Dock.Root` uses fixed positions and `motion.mvp.dock.v1` preferences; resizing dividers and restoring their sizes remain supported. Panel close/move/reset controls and layout presets are hidden. Preview alone supports temporary expansion within the editor. The allowed-panel list also rejects programmatic reopening of excluded panels.+The visible panels are Compositions, Assets, Catalog, Preview, Design, Layers, Renders, Version history and Timeline. `Dock.Root` uses fixed positions and `motion.mvp.dock.v1` preferences; resizing dividers and restoring their sizes remain supported. Newly enabled fixed panels are added to saved layouts without resetting divider sizes. Panel close/move/reset controls and layout presets are hidden. Preview alone supports temporary expansion within the editor. The allowed-panel list also rejects programmatic reopening of excluded panels.-The header retains rename, transient save/error status, templates, undo/redo and native export. Save status is not a history action and disappears when idle. The sidebar footer keeps theme/language. Integration/model setup, Capture, Inspector toggle, version history and preview/slideshow controls are hidden. Existing native history and Agent version APIs remain unchanged.+The header retains rename, transient save/error status, templates, undo/redo and native export. Save status is not a history action and disappears when idle. The sidebar footer keeps theme/language. Integration/model setup, Capture, Inspector toggle and preview/slideshow controls are hidden. The right-side Version history tab reuses `MotionHistoryPanel` for entries, changed-file details, pins and restores. Existing native history and Agent version APIs remain unchanged.The inspector retains text, font, size, color, three alignments, solid fill, opacity, geometry and Ask Agent. Advanced animation/style controls, recording, rotation, variables and blur are hidden. Opening an authored project must not remove its existing animations, gradients, effects or styles. Canvas selection, drag, resize, crop, text editing and context actions remain; canvas snapping stays enabled without guide/grid controls.@@ -59,7 +59,7 @@ Model configuration and media generation are hidden in the MVP editor. `MediaGat| 编辑器主题 | `studio/src/motion/theme.css` || Dock 与面板注册 | `studio/src/components/dock/` || Legacy preview/layout presets (hidden in MVP) | `studio/src/motion/MotionLayoutControls.tsx` |-| Hidden history panel and retained native history API | `studio/src/motion/MotionHistoryPanel.tsx` |+| Version history panel and native history API | `studio/src/motion/MotionHistoryPanel.tsx` || Editor language resources, formatting and language menu | `studio/src/i18n/` || 时间轴、片段、关键帧 | `studio/src/player/` || 画布、属性与动画编辑 | `studio/src/components/editor/` |diff --git a/docs/product/architecture.md b/docs/product/architecture.mdindex 8f300913..62bab929 100644--- a/docs/product/architecture.md+++ b/docs/product/architecture.md@@ -169,8 +169,8 @@ Preview/export preflight and the bundled OpenMotion lint command use the pinned| 项目创作会话 | `MotionSessionFrame.tsx`、`ProjectConversation.tsx`、`shared/session.ts` | Session identities, requirements and artifacts remain backend data. Conversation and Artifact browser UI are not mounted in the MVP. || 会话内网页浏览 | `browser.ts`、`WebBrowser.tsx`、`shared/browser.ts` | Retained browser runtime; no webpage/browser-tab entry in the MVP editor. See [browser runtime](../browser-runtime.md). || 编辑器与工作区交互 | `studio/src/`,尤其 `studio/src/motion/` | 完整 Hyperframes 0.9.7 Studio 前端源码;宿主通过插槽适配品牌和入口,预览使用独立 iframe |-| 面板与布局恢复 | `studio/src/components/dock/`、`MotionLayoutControls.tsx` | MVP allows only preview, timeline, compositions, assets, catalog, design, layers and renders. Fixed positions, resizable dividers, separate per-project `motion.mvp.dock.v1` preferences. |-| 撤销、版本保留与恢复 | `MotionHistoryPanel.tsx`、原生历史 API | Header undo/redo remains. Timeline history buttons and version-history UI are hidden; native history and MCP restore continue to preserve later records. |+| 面板与布局恢复 | `studio/src/components/dock/`、`MotionLayoutControls.tsx` | MVP allows preview, timeline, compositions, assets, catalog, design, layers, renders and version history. Fixed positions, resizable dividers, separate per-project `motion.mvp.dock.v1` preferences. Newly enabled fixed panels are added to saved layouts without resetting divider sizes. |+| 撤销、版本保留与恢复 | `MotionHistoryPanel.tsx`、原生历史 API | Header undo/redo remains. The right-side Version history tab shows native entries, changed files, pinning and restoration; restores checkpoint pending edits and preserve later records. Timeline history buttons remain hidden. || Editor interface language | `studio/src/i18n/`、`web/i18n.ts` | Eleven languages, Chinese by default; editor and embedded dialog labels update without remounting. Authored content, copied Agent instructions and long guides retain their source language; native-speaker review remains separate. || 多 Agent 薄适配器 | `scripts/export-adapters.ts`、`shared/integration.ts` | Codex、Claude、DSH、WorkBuddy Connector 共用外置运行时;本机生成,WorkBuddy 桌面待验收,详见 [适配器](../agent-adapters.md) || MCP 接入与指引 | `mcp.ts`、`mcp-tools.ts`、`shared/integration.ts`、`web/connect.*` | 本机 stdio;macOS 业务由共享后台执行,ChatGPT 云端远程 MCP 尚未提供 |diff --git a/docs/usage.md b/docs/usage.mdindex f4064608..1c7319c3 100644--- a/docs/usage.md+++ b/docs/usage.md@@ -11,7 +11,7 @@ openmotion 0.6.2 是面向 Agent 的本地创作工作区与 Codex 插件,一- 动画遵循 Hyperframes 的 composition 属性和可 seek 的 GSAP timeline。视频、音频、字幕、嵌套 composition 使用它的原生语法。- 导出执行 `hyperframes lint` 和 `hyperframes render`,由上游负责逐帧捕获、编码与混音。关闭页面或将窗口放到后台不会中止导出。-顶栏「预览」可以重新打开关闭的预览面板;「布局」提供各面板的显示开关、代码创作/专注预览预设及默认布局恢复。原生撤销/重做保留在顶栏和时间轴;点击「历史」或项目旁的自动保存状态,可以查看修改文件、保留当前版本、取消保留及恢复历史版本。版本数据继续由 Hyperframes 原生历史服务管理,恢复不会删除后续记录。+编辑器使用固定面板布局,分隔线大小按项目保存。原生撤销/重做保留在顶栏;右侧「版本历史」标签展示全部记录和保留版本,可以查看修改文件、保留当前版本、取消保留及恢复历史版本。已有项目会自动补上此标签,并保留原有分隔线大小。版本数据继续由 Hyperframes 原生历史服务管理,恢复前等待保存并建立检查点,恢复不会删除后续记录。首页提供新建创作、最近会话和分类模板;输入框一期只有 Motion 模式。选择模板后提交需求,创建一个会话和对应工程,通过「模板 + motion-production skill」继续制作。所有页面共享最左侧会话列表。会话与右侧浏览器顶格并列,完整 Motion 编辑器放在浏览器 Tab 内;关闭浏览器可继续完整会话,收起会话可沉浸编辑,新 Tab 可以打开另一个所属工程或网页。会话名与工程名独立保存。旧工程、需求与书签兼容,切换前等待原生保存,失败保留当前页。会话的 Agent 推理与工具编排仍由外部 MCP 客户端负责,网页不包含聊天 Agent 运行器;外部 Agent 可通过 `design_append_message` 写回真实回复。详细行为、网页浏览能力与单活动工程边界见 [会话与 Artifact 浏览器](project-workspace.md)。diff --git a/studio/src/components/dock/Dock.test.tsx b/studio/src/components/dock/Dock.test.tsxindex ba6843c9..986713bc 100644--- a/studio/src/components/dock/Dock.test.tsx+++ b/studio/src/components/dock/Dock.test.tsx@@ -447,6 +447,27 @@ it('changes native dock titles live without recreating panels, preview or layoutexpect(host.querySelector('iframe')).toBe(preview);});+it("adds version history to an existing MVP layout without resetting divider sizes", () => {+ const options = { fixedLayout: true, storageKey: "motion.mvp.dock.v1" };+ mount("p1", {}, { ...options, panels: MVP_PANEL_IDS.filter(id => id !== "history") });+ act(() => {+ dockApi!.getPanel("compositions")!.api.setSize({ width: 320 });+ vi.advanceTimersByTime(1000);+ });+ const leftWidth = dockApi!.getPanel("compositions")!.group.width;+ const rightWidth = dockApi!.getPanel("design")!.group.width;+ act(() => root?.unmount());+ root = null;++ const host = mount("p1", {}, { ...options, panels: MVP_PANEL_IDS });+ expect(dockApi!.getPanel("history")?.group.id).toBe(dockApi!.getPanel("design")!.group.id);+ expect(dockApi!.getPanel("compositions")!.group.width).toBe(leftWidth);+ expect(dockApi!.getPanel("design")!.group.width).toBe(rightWidth);+ act(() => useDockLayoutStore.getState().activatePanel("history"));+ expect(host.querySelector('[data-testid="content-history"]')).not.toBeNull();+ expect(dockApi!.getPanel("code")).toBeUndefined();+});+it("keeps the MVP panels fixed, rejects hidden panels, and restores divider sizes", () => {mount("p1", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, storageKey: "motion.mvp.dock.v1" });const store = useDockLayoutStore.getState();diff --git a/studio/src/components/dock/Dock.tsx b/studio/src/components/dock/Dock.tsxindex 471d3617..dfb88a99 100644--- a/studio/src/components/dock/Dock.tsx+++ b/studio/src/components/dock/Dock.tsx@@ -233,6 +233,8 @@ function Root({disposeRef.current();const options = { panels, storageKey, dockWidth, fixedLayout };restoreOrBuild(api, projectId, options);+ const controller = createController(api, options);+ if (fixedLayout) for (const id of panels) controller.open(id);const timeline = api.getPanel("timeline");if (fixedLayout && timeline) timeline.group.header.hidden = true;applySideMinimums(api, dockWidth());@@ -243,7 +245,7 @@ function Root({const resizeObserver = new ResizeObserver(() => applySideMinimums(api, dockWidth()));if (root) resizeObserver.observe(root);const store = useDockLayoutStore.getState();- store.attach(createController(api, options), panels);+ store.attach(controller, panels);store.sync(snapshot(api));const pending = store.takePendingActivation();if (pending) store.activatePanel(pending);diff --git a/studio/src/components/dock/panelRegistry.ts b/studio/src/components/dock/panelRegistry.tsindex 332bf607..b2d3fbfc 100644--- a/studio/src/components/dock/panelRegistry.ts+++ b/studio/src/components/dock/panelRegistry.ts@@ -18,7 +18,7 @@ export const PANEL_IDS = [export type PanelId = (typeof PANEL_IDS)[number];export const MVP_PANEL_IDS: readonly PanelId[] = [- "preview", "timeline", "compositions", "assets", "catalog", "design", "layers", "renders",+ "preview", "timeline", "compositions", "assets", "catalog", "design", "layers", "renders", "history",];export type PanelZone = "left" | "center" | "right";diff --git a/studio/src/motion/MotionStudioHost.tsx b/studio/src/motion/MotionStudioHost.tsxindex 05a2b5c8..005838c6 100644--- a/studio/src/motion/MotionStudioHost.tsx+++ b/studio/src/motion/MotionStudioHost.tsx@@ -3,11 +3,13 @@ import { I18nProvider, useI18n } from "../i18n/I18n";import { useEffect, useRef, useState, type ReactNode } from 'react';import { useStudioShellContext } from '../contexts/StudioContext';import { TimelineHistoryButtons } from '../components/TimelineHistoryButtons';+import { Dock } from '../components/dock/Dock';import { isStudioEditSaving } from '../utils/studioPendingEdits';import { MotionIcon } from './icons';import { StudioHostContext, type StudioHost } from './StudioHost';import { WorkspaceFrame, WorkspaceMenuButton, useWorkspaceChrome, useOptionalWorkspaceChrome } from './WorkspaceFrame';import { MotionHistoryProvider, useMotionHistoryOperation } from './MotionHistoryState';+import { MotionHistoryPanel } from './MotionHistoryPanel';import { MediaGatewayProvider } from './MediaGatewayContext';import { useShownStudioTheme } from '../utils/studioTheme';import { workspacePresentation } from '../../../shared/workspace-url';@@ -122,6 +124,7 @@ const host: StudioHost = {projectLabel: <WorkspaceProject />,headerActions: <WorkspaceActions />,historyActions: <WorkspaceHistoryActions />,+ panels: <Dock.Panel id="history"><MotionHistoryPanel /></Dock.Panel>,previewAction: <></>,windowMenu: <></>,themeToggle: false,