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
feat(studio): refine Motion MVP editing, feedback and empty states (#272)
open-design-crew[bot]eabdaa06dd1f
diff --git a/docs/editor-fork.md b/docs/editor-fork.mdindex 40292f95..15bc6a09 100644--- a/docs/editor-fork.md+++ b/docs/editor-fork.md@@ -8,13 +8,13 @@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, 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 visible panels are Compositions, Assets, Catalog, Preview, Design, Layers 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. Side headers offer a collapse toggle; collapsed groups retain their panels in 48px icon rails and give the released space to preview. The toggle restores the last tab and width; rail icons expand their target module. Both sides start collapsed, with the timeline at 30% of dock height; shrinking the host below 900px collapses the sides again. Collapsed sizes are not persisted, and the preview stays mounted. Preview also 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 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 header retains rename, transient save/error status, templates, undo/redo, a version-history button and native export. MVP undo/redo use plain curved arrows and name-plus-shortcut tooltips. The MVP playback row omits browser fullscreen and its keyboard target, with volume, speed and loop controls aligned right. 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 history button opens a right-aligned popover below the trigger, with an independently scrolling version list and the existing restore action. The MVP omits version-pinning buttons, filters and badges. The popover footer contains only the restore button; file-change details and explanatory copy are omitted. History is not a dock tab. Existing native history and Agent version APIs remain unchanged. MVP track headers omit clip-count badges and provide one speaker before visibility for audio and audible video clips (click to mute, hover or focus to adjust volume); batch saves preserve per-clip gain when toggling mute and create one undo step per operation. Video visibility and preview-monitor volume stay independent.-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.+The inspector retains text, font, size, color, three alignments, solid fill and opacity. The MVP hides the Layout section, including X/Y/W/H inputs. The element Ask Agent footer and its empty-state hint are hidden. 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.-Timeline editing, snapping, zoom/Fit, imports, track visibility, clip clipboard/delete/split and clip/range Ask Agent remain. Generation/image replacement, advanced clip tools, lower undo/redo, keyframes, linked/ripple controls and beats are hidden; thumbnails stay enabled. Keyboard editing and native save/reload guards remain in place.+Timeline editing, snapping, zoom/Fit, imports, track visibility, clip clipboard/delete/split remain. Clip/range Ask Agent entry points are hidden. Generation/image replacement, advanced clip tools, lower undo/redo, keyframes, linked/ripple controls and beats are hidden; thumbnails stay enabled. Keyboard editing and native save/reload guards remain in place.Undo/redo availability is filtered by the workspace host using history metadata and readable native blob/aside files, without loading media contents. Missing contents, pruned steps and known later file conflicts disable the matching visible undo/redo control; keyboard shortcuts do not dispatch an unavailable step. Adding media can still be undone and redone through the native aside store. Native execution retains its final validation for concurrent changes and I/O failures. This does not change history budgets, pin behavior or MCP retained-version storage.@@ -26,7 +26,7 @@ Simplified Chinese interface copy uses “项目” for a project throughout theLocalization covers editor labels, tooltips, placeholders, empty/error states and the embedded MCP/template dialog. The DOM fragment updates bound labels in place, preserving the selected client, searches and live media. Switching language does not remount the editor, change Dock layout, modify property values or translate authored text, project/template titles, source paths and protocol identifiers. Property sections receive English source titles and translate them only for display, so duplicate translations cannot change their internal IDs. README/Skill/installer translations, third-party template descriptions, copied Agent instructions and long connection guides are outside this interface change. MVP audit additions live in `mvp-zh-CN.json` and currently cover Chinese/English; the other nine locales retain English fallback for these additions, while their shared vocabulary remains intact. New locale dictionaries include machine-translated text; automated key/placeholder checks do not replace native-speaker review.-Header Export and the Renders panel continue using the native render queue, retaining MP4/MOV/WebM, resolution, frame rate, quality, cancellation, progress, render history and download. Composition-row render actions and GPU controls are hidden. 一期插件 `motion_export_request` 仍提供独立的后台快照渲染,供 Agent 使用;不会替代界面的原生导出。+Header Export opens a compact, right-aligned popover below the button with settings and task history, replacing the MVP Renders tab. Opening it does not start a render; its Export action continues using the native render queue, retaining MP4/MOV/WebM/GIF, resolution, frame rate, quality, cancellation, progress, render history and download. GIF retains native loop-count controls and the 30 fps limit. Composition-row render actions and GPU controls are hidden. 一期插件 `motion_export_request` 仍提供独立的后台快照渲染,供 Agent 使用;不会替代界面的原生导出。品牌宿主隐藏上游桌面下载推广与反馈邀约,相关上游组件仍保留在源码中。Studio 的原生暗色/浅色偏好由 `hf-studio-ui-preferences` 管理;`data-theme="paper"` 为浅色,无属性为暗色。设计系统变量映射到这一机制,不再使用第二套编辑器主题状态。@@ -36,9 +36,9 @@ Header Export and the Renders panel continue using the native render queue, reta先用 [产品架构](product/architecture.md#职责分层与依赖方向) 判断需求归属;多模态入口、原图修改和后续属性面板接入遵循 [素材生成设计](product/media-generation-design.md)。该设计记录用户意图、候选采用、原生历史与过期目标的边界,本页维护实现位置。-Model configuration and media generation are hidden in the MVP editor. `MediaGatewayProvider` remains mounted for native import and contextual Agent workflows; the Gateway backend and external Agent tools are unchanged. Asset context menus expose rename/delete; drag-to-timeline and uploads keep their native paths.+Model configuration and media generation are hidden in the MVP editor. `MediaGatewayProvider` remains mounted for native import; the Gateway backend and external Agent tools are unchanged. Asset context menus expose rename/delete; drag-to-timeline and uploads keep their native paths.-`TimelineMediaBar` keeps selected-clip, ruler and Shift-range context. Both prompt submission and Ask Agent open `EditPopover` with the selected time range and prompt; they do not invoke media generation. The legacy generation and image replacement implementation is retained for non-MVP hosts. Existing source writes, revision checks and native history must not be bypassed.+`TimelineMediaBar` and the fallback range `EditPopover` are not mounted in the MVP, so selecting clips, the ruler or a Shift-range does not open an Agent prompt. The legacy generation and image replacement implementation is retained for non-MVP hosts. Existing source writes, revision checks and native history must not be bypassed.`MediaRequest.anchor` 保存触发元素或时间轴虚拟锚点。`useMediaPopoverPosition` 共用实际浮层尺寸、滚动监听与 `ResizeObserver`:优先放在目标上方,空间不足时翻转或限制高度,保持 8px 间距与 12px 视口边距,不再轮询整个时间轴顶部。片段锚点读取可见片段的位置;范围/标尺锚点换算缩放与滚动后的坐标。空态引导在生成面板打开时隐藏且不可聚焦,保留布局以跟随按钮位置;文件拖入仍显示拖放反馈。是否切换到真实轨道继续由原生元素列表决定,不维护另一个“已插入”标记;关闭面板后仍为空或撤销至空轨道时恢复引导。@@ -51,7 +51,7 @@ Model configuration and media generation are hidden in the MVP editor. `MediaGat| Legacy home template UI (hidden in MVP) | `studio/src/motion/HomeTemplates.tsx` || 宿主插槽 | `studio/src/motion/StudioHost.tsx`、`studio/src/components/StudioHeader.tsx` || 模型设置、生成面板、时间轴桥接 | `studio/src/motion/ModelSettings.tsx`、`MediaGenerator.tsx`、`MediaGatewayContext.tsx`、`MotionTimelineMedia.tsx` |-| Timeline Ask Agent and legacy media actions | `studio/src/motion/TimelineMediaBar.tsx`、`timelineMediaSelection.ts`;挂载于 `Timeline.tsx` 的原生 Provider 内;定位共用 `mediaPopoverPosition.ts`、`useMediaPopoverPosition.ts` |+| Legacy non-MVP timeline Agent and media actions | `studio/src/motion/TimelineMediaBar.tsx`、`timelineMediaSelection.ts`;挂载于 `Timeline.tsx` 的原生 Provider 内;定位共用 `mediaPopoverPosition.ts`、`useMediaPopoverPosition.ts` || 共享生成合约与服务 | `shared/gateway.ts`、`gateway/`、`server.ts`、`mcp.ts` || 原生 Capture、Inspector、Export | `studio/src/components/StudioHeader.tsx` || 模板画廊、视频预览、出处与热度 | `web/template-gallery.ts`、`web/template-gallery.css`、`template-catalog.ts` |@@ -61,7 +61,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` |-| Version history panel and native history API | `studio/src/motion/MotionHistoryPanel.tsx` |+| Version-history popover and retained native history API | `studio/src/motion/MotionHistoryPopover.tsx`, `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 d9ab5202..83e41b13 100644--- a/docs/product/architecture.md+++ b/docs/product/architecture.md@@ -18,16 +18,19 @@ Model Gateway remains a shared media-generation backend for MCP, using local Cod- Agent 与用户操作同一份工程,修改能在工作室继续编辑。- The project sidebar opens as a modal drawer over the editor at every viewport size. It starts closed, leaves the editor dimensions unchanged, and closes via its button, outside click or Escape. The header toggle remains mounted for focus restoration; privacy, theme and language settings live in the drawer footer. Error and empty-session views retain a drawer toggle so users can select an existing project or create one. Project rows show names without dates; the heading offers a New project button instead of a count. Creation uses the existing save and revision guards before opening the blank project.-- Preview zoom percentage and Fit sit in the MVP preview header, outside the picture; fullscreen retains the in-view controls.-- The composition list marks the live preview target, including the full video. The MVP omits the duplicate preview breadcrumb; composition switching and existing return shortcuts remain available.-- The editor header keeps the OpenDesign logo, drawer toggle and template library on the left, centers the editable project name, and places undo/redo and export on the right. Transient save/error status remains available. The template library reuses the website catalog layout: brand/use-case/video-type facets, configured featured templates, search and sorting, without site navigation, promotional hero or footer. Prism metadata and local cache updates drive the list. The catalog selects the editor locale from a shared multilingual publication, falling back to English and then the Resource default; template-copy prompts support the same eleven UI languages. Previews, author/source links and editable-project opening remain available. The detail view keeps the motion.md download action (`motionDocumentUrl`) above its guide content (`styleDescription`, `reviewFocus`, `motionGuideUrl`). Recreate opens a separate prompt dialog; copied instructions never occupy the guide area.-- The asset panel shows only the current project, with compact search/import controls, type filters, and a dedicated scrollable list. Usage filtering is omitted; used assets still sort first within each type. The global cache view remains in source but has no editor entry in the MVP.-- Panel positions are fixed. Divider resizing and per-project size persistence remain; panel movement, closing and layout presets are absent. Preview alone can temporarily expand within the editor workspace, keeping the host chat visible and the player mounted. Its header button or Escape restores the previous layout and playback position; expansion is not persisted across reloads.-- MVP controls share a locally bundled Remix Icon 4.9.1 set with the reference design system. Side-panel tabs remain text-only; brand artwork and timeline geometry are separate from control icons.+- An empty, loaded root composition shows a centered import/drop prompt over the mounted preview and hides transport controls, including the placeholder duration. The empty state requires both no timeline clips and no authored preview content; loading, failed previews and nested compositions retain their existing states. Import uses the existing timeline gateway and file-drop pipeline. The empty timeline retains its drop target and ruler, with a muted dashed track sketch instead of a duplicate import prompt or button. Empty timelines disable zoom controls. A confirmed empty composition blocks new exports at both the settings button and the shared editor render-start handler, while existing export history remains available. Properties distinguish no content from no selection; small panel empty states share muted text and icon sizing. Preview zoom percentage and Fit sit in the MVP preview header, outside the picture. Browser fullscreen is unavailable in the MVP, including its playback button and keyboard entry; workspace preview expansion remains available. Playback controls respond to their own container width: secondary-button gaps narrow below 420px, and speed/loop controls hide below 420px so timecode, play/pause and volume remain on one row. Preview and track volume use upward floating vertical sliders, opened by hover or keyboard focus; clicking the speaker still toggles mute.+- The composition list places the full video first, preserves the remaining clip order, and marks the live preview target. A confirmed empty root is omitted from this list using the same loaded-preview content check; when no clips remain, the panel shows a brief empty state. The MVP omits the duplicate preview breadcrumb; composition switching and existing return shortcuts remain available.+- The editor header keeps the OpenDesign logo, drawer toggle and template library on the left, centers the editable project name, and places undo/redo and export on the right. Transient save/error status remains available. Workspace and export failures show concise causes and available next steps, with raw diagnostics behind expandable, copyable details. Reconnecting retries status reads only; dismissing a notice does not bypass write guards. Toasts stack at the top center of the editor. Informational toasts disappear after three seconds without a close control; actionable error notices remain dismissible and do not auto-expire. Save-queue pauses use a brief, localized feedback toast without paths, diagnostics or a retry action; it expires after three seconds without clearing the write guard or claiming that failed edits were saved. The template library reuses the website catalog layout: brand/use-case/video-type facets, configured featured templates, search and sorting, without site navigation, promotional hero or footer. Prism metadata and local cache updates drive the list. The catalog selects the editor locale from a shared multilingual publication, falling back to English and then the Resource default; template-copy prompts support the same eleven UI languages. Previews, author/source links and editable-project opening remain available. The detail view keeps the motion.md download action (`motionDocumentUrl`) above its guide content (`styleDescription`, `reviewFocus`, `motionGuideUrl`). Recreate opens a separate prompt dialog; copied instructions never occupy the guide area.+- The asset panel shows only the current project, with compact search/import controls, type filters, and a dedicated scrollable list. Usage filtering is omitted; used assets still sort first within each type. In both My assets and the official animation library, hover plays only the card thumbnail, while clicking opens a centered modal preview over a gray full-editor backdrop. The modal reuses Studio-styled playback, volume and speed controls; closing it restores access to the paused composition; previewing media does not add it to the project. The global cache view remains in source but has no editor entry in the MVP.+- Panel positions are fixed. Export settings and render history live in a compact popover below the header Export button, outside the right panel. Both side groups can temporarily collapse into 48px vertical icon rails, giving their width to preview; the rail toggle restores the previous width and tab, while a module icon opens that module. Collapse does not remove panels or remount the player. Opening the MVP starts both sides collapsed and the timeline at 30% of the available dock height (subject to minimum sizes); users can then drag the divider to enlarge or reduce it. The fixed layout reserves at least 360px for preview and 320px for each expanded side. Side availability is derived from these minimums plus rail/gap space: below 740px both side groups and rails hide; from 740px to 1011px only one side can expand; wider hosts allow both only when their requested widths leave the preview floor intact. Opening a side through a toggle, module shortcut or programmatic activation uses the same fit check and closes the opposite side when necessary. Shrinking the host collapses expanded sides when they no longer fit; widening restores collapsed rails without automatically reopening panels. At widths smaller than the preview floor, preview uses the available workspace. Remembered expanded side widths remain available when reopening a side. Divider resizing and per-project expanded-size persistence remain; panel movement, closing and layout presets are absent. Preview alone can temporarily expand within the editor workspace, keeping the host chat visible and the player mounted. Its header button or Escape restores the previous layout and playback position; expansion is not persisted across reloads.+- MVP controls share a locally bundled Remix Icon 4.9.1 set with the reference design system. Expanded side-panel tabs remain text-only; collapsed rails use the corresponding panel icons. Brand artwork and timeline geometry are separate from control icons.+- The editor startup shell and project/editor loading boundaries share a centered, theme-aware OD symbol without adding a minimum loading delay. Below 700px of workspace content width, the editor header stays on one row: undo/redo and version history hide, the template library becomes icon-only, the project title truncates, and Export stays at the right edge.+- MVP audio-bearing tracks expose a single speaker button before visibility in the track header: click toggles mute, while hover or keyboard focus opens a compact volume slider, writing every audio/video clip in that row through native saves and undo. Video visibility remains separate, and preview-monitor volume remains a playback preference. Clip-count badges are omitted to make room for these controls. The audio-meter toolbar toggle, meter display and audio FX entry points (track presets, group effects and inspector rack) are omitted in the MVP. Track volume sliders cover 0–100% and show effective zero output while muted, retaining the saved volume for unmute.- Timeline clips omit a title that duplicates the track header, giving its space to the preview. Distinct clip names, accessible labels, status badges and track visibility controls remain available.+- Export offers native MP4, MOV, WebM and GIF. GIF includes loop-count controls and a 30 fps limit. MOV and WebP use short format names; ProRes appears in the MOV format help. WebP remains disabled; its encoding backend is not implemented.- The MVP omits the standalone timeline title strip to give its space to tracks, retaining the tool row and ruler.-- The MVP shows Select and Split as adjacent timeline tools. Split at playhead remains available by keyboard shortcut, without a duplicate toolbar button. Tooltips add a short explanation for less familiar controls while simple actions retain a name-only hint.-- The MVP does not open an Agent prompt or media-action popover from clip selection, time-range selection or ruler clicks. Element-level Agent requests remain available in the Design panel.+- The MVP shows Select and Split as adjacent timeline tools. Split at playhead remains available by keyboard shortcut, without a duplicate toolbar button. Tooltips add a short explanation for less familiar controls while simple actions retain a name-only hint. Overlay surfaces share subtle entrance motion; Base UI popovers and media-preview dialogs also retain their surfaces through a short exit. Tooltip hover delay is 200ms, with instant keyboard-focus hints. Reduced-motion preferences disable overlay transitions; dock expansion keeps its separate animation.+- The MVP does not open an Agent prompt or media-action popover from clip selection, time-range selection or ruler clicks.- 模板先展示真实成片效果;作者、出处、内容种类和有来源的热度帮助选择。- Template copy uses the public environment-specific installation guide, the exact template title/ID, the requested HTML/MP4 deliverables and an empty requirements section. Local connection guides remain available for workspace setup.- 导出成功需要真实产物与验证证据;技术检查与画面、声音、播放器检查分别记录。@@ -125,7 +128,7 @@ README 参考 OpenDesign 的产品导览和 HTML Anything 的贡献、来源表2. The Agent uses the existing MCP integration and verifies the selected project, revision and workflow. Integration setup remains available outside the MVP editor. Successful Agent-led installation returns the canonical reply rules from `docs/install.md` plus bounded real catalog summaries in the setup result, without waiting for the first MCP use. The Agent defaults to one eligible template; explicit comparison requests can receive three confirmed candidates. Acceptance preserves that exact choice and creates one independent editable project; refusal stops. Registration does not prove active-chat loading or that an invitation was actually displayed. No invitation telemetry/state service is introduced. Follow the [first-run defaults](../../skills/motion-production/references/templates.md#first-run-experience-defaults) for creation and delivery.3. `motion_open_preview({projectId})` opens the project directly. Project switching waits for pending saves and reloads the document to release the previous edit session. Opening a bookmark warms only its scoped native context without switching other editor tabs. Rendering and write conflicts continue to block unsafe switches. Original creation, reference recreation and template production automatically open the saved project before delivery; the open editor is the deliverable, and video files are handed over only when requested (video-to-template still delivers its template ZIP). Continued edits and restores return a project/revision/version-bound previewHandoff. Reuse the native project tab: present it when the calling chat is active, otherwise queue it without switching chats and resolve the latest version when the user returns. Only this turn's explicit `presentation=now` request permits switching back; explicit background requests suppress presentation. Codex IAB synchronizes visibility within the calling chat. A queued acknowledgment is separate from observed visibility and live-content freshness; `record_display` rejects stale content identities, and stored previewDisplay remains historical host-reported evidence. The shared [editable preview handoff](../../skills/motion-production/references/native.md#editable-preview-handoff) defines readiness, host checks and capability limitations.4. Agent 根据本轮目标直接选择 Skill:motion-director 负责原创、局部/整体叙事动作声音重新设计和创作审片;motion-template-to-video 负责已有模板出片;motion-recreate 负责参考作品重建(已接入实际流程、独立参考与测量脚本);motion-video-to-template 负责可复用模板生产;motion-production 承接既定决定下的工程操作、预览、技术检查、排错和导出。共享规则同源引用,已有 production/start 保留导航,无需前置总路由。项目来源与画面锁定不固定入口;保持项和已完成操作继续有效。-5. The Agent imports or generates media through the existing backend. In the editor, the user imports assets, edits text/solid color/opacity/geometry, previews, and edits clips on the timeline. Element prompts provide Ask Agent in the Design panel; clip selection, time-range selection and ruler clicks do not open an Agent prompt in the MVP. Generation, image replacement, advanced style/animation controls, code and version-history panels are hidden without rewriting existing source content or removing Agent capabilities.+5. The Agent imports or generates media through the existing backend. In the editor, the user imports assets, edits text/solid color/opacity, previews, and edits clips on the timeline. Element, clip, time-range and official animation-library Ask Agent entry points are hidden in the MVP; users can continue requesting edits through their external Agent. Text controls include headings with explicit line breaks and preserve those breaks when edited. The MVP omits the layer-count heading and Add text field controls. Unselected off-canvas elements have no dashed markers in the MVP preview; selecting an element, including from Layers, retains its selection boundary. Text selections omit the separate Style group and background-fill control; element opacity remains in Text. For opacity-animated elements, the MVP opacity control saves an independent CSS filter multiplier, retaining the authored fade and existing static filters rather than writing over the animated opacity channel. The multiplier is part of project source, so preview and export use the same value. Other element types retain their Style controls. Generation, image replacement, advanced style/animation controls, code and inspector Layout settings are hidden without rewriting existing source content or removing Agent capabilities.6. 完成画面、文案、声音检查后,按用户要求导出固定 revision 的快照,等待真实产物并验证。后续需求应注明改变了哪一步、影响哪些角色,以及用户能观察到的完成条件。@@ -174,9 +177,9 @@ 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 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 project content and existing instructions retain their source language; newly generated template-copy prompts use the current UI locale, and guide/download URLs come from that locale’s catalog; native-speaker review remains separate. |+| 面板与布局恢复 | `studio/src/components/dock/`、`MotionLayoutControls.tsx` | MVP allows only preview, timeline, compositions, assets, catalog, design and layers. Export settings and render history open in a compact popover below the header Export button; closing it does not cancel rendering. Fixed positions, resizable dividers, separate per-project `motion.mvp.dock.v1` preferences. |+| 撤销、版本保留与恢复 | `MotionHistoryPanel.tsx`、原生历史 API | Header undo/redo remains, alongside a version-history button that opens a popover below the trigger for viewing and restoring versions. The MVP hides version-pinning controls, filters and badges; the underlying pin API and existing data remain available. New layer-style edits replace the existing single-line history title with the target, localized property names and saved values; older generic labels remain unchanged when details are unavailable. The version list scrolls above a restore-only footer without file-change details; history does not occupy the right dock. Timeline history buttons remain hidden; native history and MCP restore continue to preserve later records. |+| Editor interface language | `studio/src/i18n/`、`web/i18n.ts` | Eleven languages, Chinese by default; editor and embedded dialog labels update without remounting. Phase-one controls, export guidance, common edit-history descriptions and import/split failure messages have localized additions in all eleven languages. Retained advanced-editor controls outside the MVP may still fall back to English. Authored project content and existing instructions retain their source language; newly generated template-copy prompts use the current UI locale, and guide/download URLs come from that locale’s catalog; 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 尚未提供 || Codex 安装 | `install.sh`、`scripts/install-motion.command` | 远端源码下载、依赖安装与编辑器构建、本地插件注册和 MCP 握手;需预装 Git、Node/npm 与支持插件的 Codex CLI,保留安装目录,遇到已有目录停止;the source installation entry is available on main |diff --git a/docs/reviews/motion-mvp-followup/README.md b/docs/reviews/motion-mvp-followup/README.mdnew file mode 100644index 00000000..8e722e83--- /dev/null+++ b/docs/reviews/motion-mvp-followup/README.md@@ -0,0 +1,36 @@+# Motion MVP follow-up review++Representative states captured from the local interaction build on November 10–11, 2026. These screenshots accompany the follow-up to PR #198. Video text and filenames are authored test-project content.++- [Compact layout](compact-layout.jpg): collapsed side rails in a narrow editor host.+- [Export](export.jpg): compact settings and scrollable render history below the header button.+- [Version history](history.jpg): neutral selection, green Latest badge and restore-only footer.+- [Media preview](media-preview.jpg): named preview dialog, gray editor backdrop and Studio playback controls.+- [Audio track](audio-track.jpg): compact asset row and timeline speaker control.++Screenshots show representative UI states, not cross-platform acceptance or proof of every export format. WebP remains a disabled placeholder. Runtime test media and project edits are not included in this PR.+++## Empty-state follow-up (2026-11-11)++The goal is to make a blank project visibly empty, offer one central import entry, and avoid controls that cannot produce a useful result. Small panel hints share 18px icons, 10px text and the disabled-control gray. Template-library styling is unchanged.++- Confirmed blank previews omit the fake full-video card, transport and placeholder duration; the timeline sketch aligns with real track labels and the zero origin.+- Properties and Layers use the shared empty state; the asset drop zone uses the same icon/text treatment.+- Empty timeline zoom controls and new exports are disabled. Export history remains accessible. Real content restores export and zoom availability.++Screenshots were captured from the working checkout at localhost:4173. The integration checkout retains its newer runtime and template-library implementation; focused tests and production compilation cover those differences. After integration with `feature/motion` at `40153c5`, a temporary preview at localhost:4174 additionally confirmed empty export/zoom gating and real template-library focus restoration through Escape and the close button (`motion-integrated-empty-export.png`).++| Check | Result / evidence |+| --- | --- |+| Before: empty export enabled | `audit-empty-export.png` |+| After: blank clips, layers, aligned timeline and disabled zoom | `motion-empty-clips-final.png` |+| Empty properties | `motion-empty-properties-final.png` |+| Empty layers | `motion-empty-layers-final.png` |+| Consistent asset drop hint | `motion-empty-assets-final.png` |+| Empty export blocked with concise reason | `motion-empty-export-final.png` |+| Populated composition export remains enabled | `motion-populated-export-final.png`; no render job submitted |+| Shared render-start guard / static content recovery | Deterministic hook regression passed |+| Repeated template open/close, Escape and trigger focus | Integration DOM regression passed |+| Destructive recovery and actual export encoding | Unverified in this follow-up; no destructive recovery or export executed |+| Native installers / all animated-filter combinations | Unverified; outside this UI follow-up |diff --git a/docs/reviews/motion-mvp-followup/audio-track.jpg b/docs/reviews/motion-mvp-followup/audio-track.jpgnew file mode 100644index 00000000..99433970Binary files /dev/null and b/docs/reviews/motion-mvp-followup/audio-track.jpg differdiff --git a/docs/reviews/motion-mvp-followup/audit-empty-export.png b/docs/reviews/motion-mvp-followup/audit-empty-export.pngnew file mode 100644index 00000000..7b65f33fBinary files /dev/null and b/docs/reviews/motion-mvp-followup/audit-empty-export.png differdiff --git a/docs/reviews/motion-mvp-followup/compact-layout.jpg b/docs/reviews/motion-mvp-followup/compact-layout.jpgnew file mode 100644index 00000000..e0d4c0adBinary files /dev/null and b/docs/reviews/motion-mvp-followup/compact-layout.jpg differdiff --git a/docs/reviews/motion-mvp-followup/export.jpg b/docs/reviews/motion-mvp-followup/export.jpgnew file mode 100644index 00000000..51075821Binary files /dev/null and b/docs/reviews/motion-mvp-followup/export.jpg differdiff --git a/docs/reviews/motion-mvp-followup/history.jpg b/docs/reviews/motion-mvp-followup/history.jpgnew file mode 100644index 00000000..91166325Binary files /dev/null and b/docs/reviews/motion-mvp-followup/history.jpg differdiff --git a/docs/reviews/motion-mvp-followup/media-preview.jpg b/docs/reviews/motion-mvp-followup/media-preview.jpgnew file mode 100644index 00000000..b21f4509Binary files /dev/null and b/docs/reviews/motion-mvp-followup/media-preview.jpg differdiff --git a/docs/reviews/motion-mvp-followup/motion-empty-assets-final.png b/docs/reviews/motion-mvp-followup/motion-empty-assets-final.pngnew file mode 100644index 00000000..71074008Binary files /dev/null and b/docs/reviews/motion-mvp-followup/motion-empty-assets-final.png differdiff --git a/docs/reviews/motion-mvp-followup/motion-empty-clips-final.png b/docs/reviews/motion-mvp-followup/motion-empty-clips-final.pngnew file mode 100644index 00000000..28236668Binary files /dev/null and b/docs/reviews/motion-mvp-followup/motion-empty-clips-final.png differdiff --git a/docs/reviews/motion-mvp-followup/motion-empty-export-final.png b/docs/reviews/motion-mvp-followup/motion-empty-export-final.pngnew file mode 100644index 00000000..f0bd6566Binary files /dev/null and b/docs/reviews/motion-mvp-followup/motion-empty-export-final.png differdiff --git a/docs/reviews/motion-mvp-followup/motion-empty-layers-final.png b/docs/reviews/motion-mvp-followup/motion-empty-layers-final.pngnew file mode 100644index 00000000..e0e3bf7eBinary files /dev/null and b/docs/reviews/motion-mvp-followup/motion-empty-layers-final.png differdiff --git a/docs/reviews/motion-mvp-followup/motion-empty-properties-final.png b/docs/reviews/motion-mvp-followup/motion-empty-properties-final.pngnew file mode 100644index 00000000..572a4eb5Binary files /dev/null and b/docs/reviews/motion-mvp-followup/motion-empty-properties-final.png differdiff --git a/docs/reviews/motion-mvp-followup/motion-integrated-empty-export.png b/docs/reviews/motion-mvp-followup/motion-integrated-empty-export.pngnew file mode 100644index 00000000..0cdd23f7Binary files /dev/null and b/docs/reviews/motion-mvp-followup/motion-integrated-empty-export.png differdiff --git a/docs/reviews/motion-mvp-followup/motion-populated-export-final.png b/docs/reviews/motion-mvp-followup/motion-populated-export-final.pngnew file mode 100644index 00000000..3fd9b22fBinary files /dev/null and b/docs/reviews/motion-mvp-followup/motion-populated-export-final.png differdiff --git a/studio/index.html b/studio/index.htmlindex 351a66d2..2e002b01 100644--- a/studio/index.html+++ b/studio/index.html@@ -17,9 +17,15 @@<link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="stylesheet" href="/web/design-system/tokens.css" /><link rel="stylesheet" href="/web/design-system/fonts.css" />+ <link rel="stylesheet" href="/src/motion/loading.css" /></head><body>- <div id="root"></div>+ <div id="root">+ <div class="motion-loading" role="status">+ <span class="motion-loading-mark" aria-hidden="true"></span>+ <span class="motion-loading-label">正在打开项目…</span>+ </div>+ </div><script type="module" src="/src/main.tsx"></script></body></html>diff --git a/studio/src/App.tsx b/studio/src/App.tsxindex 5d487740..a37d5def 100644--- a/studio/src/App.tsx+++ b/studio/src/App.tsx@@ -7,7 +7,6 @@ import { useDismissingTabSetter, useRightPanelIntent } from "./hooks/useRightPanimport { useRenderQueue } from "./components/renders/useRenderQueue";import { usePlayerStore } from "./player";import { StudioOverlays } from "./components/StudioOverlays";-import { SaveQueuePausedBanner } from "./components/SaveQueuePausedBanner";import { ExternalFileConflictBanner } from "./components/ExternalFileConflictBanner";import { ProjectUnreachableBanner } from "./components/ProjectUnreachableBanner";import { CompositionMissingBanner } from "./components/CompositionMissingBanner";@@ -522,12 +521,6 @@ export function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason }: StinspectorPanelActive={inspectorPanelActive}onExport={handleExport}/>- {previewPersistence.domEditSaveQueuePaused && !externalFileChanges.blocked && (- <SaveQueuePausedBanner- message={previewPersistence.domEditSaveQueuePaused}- onRetry={previewPersistence.resetDomEditSaveQueueBreaker}- />- )}<ExternalFileConflictBanner coordinator={externalFileChanges} />{sdkHandle.unreachableProject && (<ProjectUnreachableBanner projectId={sdkHandle.unreachableProject} />diff --git a/studio/src/components/ConflictNotice.test.tsx b/studio/src/components/ConflictNotice.test.tsxnew file mode 100644index 00000000..9c538663--- /dev/null+++ b/studio/src/components/ConflictNotice.test.tsx@@ -0,0 +1,54 @@+// @vitest-environment happy-dom+import { act } from 'react';+import { createRoot } from 'react-dom/client';+import { expect, it, vi } from 'vitest';+import { ExternalFileConflictBanner } from './ExternalFileConflictBanner';+import { StudioHostContext } from '../motion/StudioHost';+import { StudioFileConflictError } from '../utils/studioSaveDiagnostics';+import type { ExternalFileChangeCoordinatorHandle } from '../hooks/useExternalFileChangeCoordinator';+globalThis.IS_REACT_ACT_ENVIRONMENT = true;+function setup(blocked: ExternalFileChangeCoordinatorHandle['blocked']) {+ const coordinator = { blocked, retry: vi.fn(async () => {}), useExternalFile: vi.fn(async () => {}), keepStudioFile: vi.fn(async () => {}) };+ const host = document.createElement('div'); const root = createRoot(host);+ act(() => root.render(<StudioHostContext.Provider value={{ mvpEditor: true }}><ExternalFileConflictBanner coordinator={coordinator}/></StudioHostContext.Provider>));+ return { host, root, coordinator };+}+it('hides paths and code, confirms version choices and catches rejected recovery actions', async () => {+ const {host,root,coordinator}=setup({status:'conflict',generation:1,payload:{},error:new StudioFileConflictError({filePath:'/private/'+'long'.repeat(100),currentVersion:'v2',currentContent:'<html>external</html>',attemptedContent:'<html>mine</html>'})});+ expect(host.textContent).toContain('The project changed elsewhere');+ expect(host.textContent).not.toMatch(/private|<html>|Review or export/);+ expect(host.querySelector('textarea')).toBeNull();+ const confirm=vi.spyOn(window,'confirm').mockReturnValue(false);+ await act(async()=>host.querySelector('button')!.click()); expect(coordinator.useExternalFile).not.toHaveBeenCalled();+ confirm.mockReturnValue(true);+ coordinator.useExternalFile.mockRejectedValueOnce(new Error('EACCES /private/file.html'));+ await act(async()=>host.querySelector('button')!.click());+ expect(host.textContent).toContain('No permission to save changes.'); expect(host.textContent).not.toContain('/private');+ expect(host.querySelector('button')!.disabled).toBe(false);+ act(()=>root.unmount()); confirm.mockRestore();+});+it('offers no fabricated action when neither a version nor recoverable changes are available',()=>{+ const {host,root}=setup({status:'failed',generation:1,path:'secret.html',payload:{},error:new Error('InternalError /secret'),studioContent:null,recovered:false});+ expect(host.textContent).toBe('Changes were not saved. Saving is paused.'); expect(host.querySelector('button')).toBeNull();+ act(()=>root.unmount());+});+it('only offers retry for a live draft and overwrite for a recovered draft',()=>{+ for(const recovered of [false,true]){+ const {host,root}=setup({status:'failed',generation:1,path:'secret.html',payload:{},error:new Error('offline'),studioContent:'<html>draft</html>',recovered});+ expect(host.textContent?.includes('Retry saving')).toBe(!recovered); expect(host.textContent?.includes('Keep my changes')).toBe(recovered);+ act(()=>root.unmount());+ }+});++it('blocks repeated version selection while a real recovery request is pending', async () => {+ const {host,root,coordinator}=setup({status:'conflict',generation:1,payload:{},error:new StudioFileConflictError({filePath:'index.html',currentVersion:'v2',currentContent:'external',attemptedContent:'mine'})});+ let finish!: () => void;+ coordinator.keepStudioFile.mockImplementationOnce(()=>new Promise<void>(resolve=>{finish=resolve;}));+ const confirm=vi.spyOn(window,'confirm').mockReturnValue(true);+ const buttons=host.querySelectorAll('button');+ act(()=>{buttons[1].click();buttons[1].click();});+ expect(coordinator.keepStudioFile).toHaveBeenCalledOnce();+ expect(buttons[0].disabled).toBe(true); expect(buttons[1].disabled).toBe(true);+ await act(async()=>finish()); expect(buttons[1].disabled).toBe(false);+ act(()=>root.unmount()); confirm.mockRestore();+});diff --git a/studio/src/components/ConflictNotice.tsx b/studio/src/components/ConflictNotice.tsxnew file mode 100644index 00000000..265e4c9c--- /dev/null+++ b/studio/src/components/ConflictNotice.tsx@@ -0,0 +1,41 @@+import { useRef, useState } from "react";+import { useI18n } from "../i18n/I18n";+import type { ExternalFileChangeCoordinatorHandle } from "../hooks/useExternalFileChangeCoordinator";+import { saveFailureFeedback } from "../utils/saveFailureFeedback";+import { getStudioSaveStatusCode, getStudioSaveErrorMessage } from "../utils/studioSaveDiagnostics";++/** MVP recovery uses plain language; the coordinator remains the write authority. */+export function ConflictNotice({ coordinator }: { coordinator: ExternalFileChangeCoordinatorHandle }) {+ const { t } = useI18n();+ const [busy, setBusy] = useState(false);+ const running = useRef(false);+ const [actionError, setActionError] = useState<string | null>(null);+ const blocked = coordinator.blocked;+ if (!blocked) return null;+ const conflict = blocked.status === "conflict";+ const hasDraft = !conflict && blocked.studioContent != null;+ const canKeep = conflict || (hasDraft && blocked.recovered);+ const canRetry = !conflict && hasDraft && !blocked.recovered;+ // Without a known current version or a recoverable draft, don't invent a choice.+ const canUseUpdated = conflict || hasDraft || (blocked.payload != null && typeof blocked.payload === "object" && "content" in blocked.payload && typeof blocked.payload.content === "string");+ const reason = conflict+ ? "The project changed elsewhere. Changes were not saved."+ : saveFailureFeedback(getStudioSaveStatusCode(blocked.error) ?? null, getStudioSaveErrorMessage(blocked.error));+ const run = async (action: () => Promise<void>, confirmation?: string) => {+ if (running.current || (confirmation && !window.confirm(t(confirmation)))) return;+ running.current = true;+ setBusy(true);+ setActionError(null);+ try { await action(); }+ catch (error) { setActionError(saveFailureFeedback(getStudioSaveStatusCode(error) ?? null, getStudioSaveErrorMessage(error))); }+ finally { running.current = false; setBusy(false); }+ };+ return <div className="motion-conflict-notice" role="alert" aria-busy={busy}>+ <p>{t(actionError ?? reason)}</p>+ {(canUseUpdated || canKeep || canRetry) && <div className="motion-conflict-actions">+ {canUseUpdated && <button className="motion-button" disabled={busy} onClick={() => void run(coordinator.useExternalFile, "Use the updated version and discard your unsaved changes?")}>{t("Use updated version")}</button>}+ {canKeep && <button className="motion-button" disabled={busy} onClick={() => void run(coordinator.keepStudioFile, "Keep your changes and replace the version updated elsewhere?")}>{t("Keep my changes")}</button>}+ {canRetry && <button className="motion-button" disabled={busy} onClick={() => void run(coordinator.retry)}>{t("Retry saving")}</button>}+ </div>}+ </div>;+}diff --git a/studio/src/components/EditorShell.tsx b/studio/src/components/EditorShell.tsxindex d18927f7..02e92811 100644--- a/studio/src/components/EditorShell.tsx+++ b/studio/src/components/EditorShell.tsx@@ -326,6 +326,7 @@ function EditorShellBody({panels={host?.mvpEditor ? MVP_PANEL_IDS : undefined}storageKey={host?.mvpEditor ? "motion.mvp.dock.v1" : undefined}fixedLayout={host?.mvpEditor}+ initialCompactLayout={host?.mvpEditor}><Dock.Panel id="preview"><div className="relative flex h-full w-full min-w-0 flex-col">diff --git a/studio/src/components/ExternalFileConflictBanner.tsx b/studio/src/components/ExternalFileConflictBanner.tsxindex 606e1bdc..9e0fdfd1 100644--- a/studio/src/components/ExternalFileConflictBanner.tsx+++ b/studio/src/components/ExternalFileConflictBanner.tsx@@ -1,3 +1,5 @@+import { useMvpEditor } from "../motion/StudioHost";+import { ConflictNotice } from "./ConflictNotice";import { useI18n } from "../i18n/I18n";import { useRef, useState } from "react";import type {@@ -162,9 +164,11 @@ export function ExternalFileConflictBanner({coordinator: ExternalFileChangeCoordinatorHandle;}) {const { t } = useI18n();+ const mvp = useMvpEditor();const [reviewing, setReviewing] = useState(false);const blocked = coordinator.blocked;if (!blocked) return null;+ if (mvp) return <ConflictNotice key={`${blocked.generation}:${blocked.status}:${blocked.status === "conflict" ? blocked.error.filePath : blocked.path}`} coordinator={coordinator} />;const conflict = blocked.status === "conflict" ? blocked : null;const failure = blocked.status === "failed" ? blocked : null;diff --git a/studio/src/components/SaveQueuePausedBanner.tsx b/studio/src/components/SaveQueuePausedBanner.tsxdeleted file mode 100644index c3ae2e73..00000000--- a/studio/src/components/SaveQueuePausedBanner.tsx+++ /dev/null@@ -1,25 +0,0 @@-import { useI18n } from "../i18n/I18n";-interface SaveQueuePausedBannerProps {- message: string;- /** Resets the save-queue circuit breaker so persistence resumes. */- onRetry: () => void;-}--/** Alert shown when the DOM-edit save queue circuit breaker pauses persistence. */-export function SaveQueuePausedBanner({ message, onRetry }: SaveQueuePausedBannerProps) {- const { t } = useI18n();- return (- <div- className="hf-backdrop-in absolute left-1/2 top-14 z-92 flex max-w-[calc(100vw-32px)] -translate-x-1/2 items-center gap-3 rounded-md border border-red-500/30 bg-red-950/85 px-4 py-2 text-[12px] font-medium text-red-100 shadow-lg shadow-black/30"- role="alert"- >- <span>{message}</span>- <button- type="button"- onClick={onRetry}- className="rounded-sm border border-red-300/20 px-2 py-1 text-[11px] text-red-100 transition-colors hover:bg-red-400/10 active:scale-[0.98]"- >- {t("Retry saving")}</button>- </div>- );-}diff --git a/studio/src/components/StudioHeader.tsx b/studio/src/components/StudioHeader.tsxindex 425afe4c..797e3e24 100644--- a/studio/src/components/StudioHeader.tsx+++ b/studio/src/components/StudioHeader.tsx@@ -1,11 +1,12 @@import { RemixIcon } from "../icons/RemixIcons";import { useI18n } from "../i18n/I18n";-import { Fragment, memo, useContext, type MouseEvent } from "react";+import { Fragment, memo, useContext, useEffect, useRef, useState, type MouseEvent } from "react";import { Camera } from "../icons/SystemIcons";import { useStudioShellContext } from "../contexts/StudioContext";import { usePanelLayoutContext } from "../contexts/PanelLayoutContext";import { trackStudioEvent } from "../utils/studioTelemetry";import { Button, buttonBase, buttonSizes, buttonVariants, cn, Tooltip } from "./ui";+import { ExportDialog } from "./renders/ExportDialog";import { Dock } from "./dock/Dock";import { InspectorIcon } from "./icons/InspectorIcon";import { OpenInDesktopButton } from "./OpenInDesktopButton";@@ -51,12 +52,15 @@ export const StudioHeader = memo(function StudioHeader({}: StudioHeaderProps) {const { t } = useI18n();const host = useStudioHost();+ const [exportOpen, setExportOpen] = useState(false);+ const exportTriggerRef = useRef<HTMLButtonElement>(null);const HeaderFrame = host?.HeaderFrame ?? Fragment;const showThemeToggle = useContext(ShowThemeToggle);const { projectId, renderQueue } = useStudioShellContext();const { rightCollapsed, setRightCollapsed, setRightPanelTab } = usePanelLayoutContext();const isRendering = renderQueue.isRendering;const ffmpegMissing = renderQueue.ffmpegMissing;+ useEffect(() => setExportOpen(false), [projectId]);return (<HeaderFrame>@@ -147,8 +151,9 @@ export const StudioHeader = memo(function StudioHeader({{host?.windowMenu ?? <Dock.WindowMenu />}{host?.desktopLink !== false && <OpenInDesktopButton />}<Tooltip+ disabled={host?.mvpEditor}label={- ffmpegMissing+ host?.mvpEditor ? t("Export") : ffmpegMissing? renderQueue.ffmpeg?.runtime ? t("Video components are not ready. Check preparation status.") : t("FFmpeg is not installed. Opens the Renders panel with the install command."): isRendering? t("A render is already in progress")@@ -159,8 +164,11 @@ export const StudioHeader = memo(function StudioHeader({<Buttonvariant="primary"data-testid="header-export"- disabled={isRendering}+ ref={exportTriggerRef}+ aria-haspopup={host?.mvpEditor ? "dialog" : undefined}+ disabled={!host?.mvpEditor && isRendering}onClick={() => {+ if (host?.mvpEditor) { setExportOpen(true); return; }if (isRendering) return;setRightPanelTab("renders");setRightCollapsed(false);@@ -178,6 +186,7 @@ export const StudioHeader = memo(function StudioHeader({</Tooltip></div></div>+ {host?.mvpEditor && <ExportDialog open={exportOpen} onOpenChange={setExportOpen} triggerRef={exportTriggerRef} />}</HeaderFrame>);});diff --git a/studio/src/components/StudioOverlays.tsx b/studio/src/components/StudioOverlays.tsxindex f8d1cd31..65e71e7e 100644--- a/studio/src/components/StudioOverlays.tsx+++ b/studio/src/components/StudioOverlays.tsx@@ -82,20 +82,24 @@ export const StudioOverlays = memo(function StudioOverlays({}}/>)}- {/* One bottom-right stack so the feedback card and toasts queue instead- of covering each other. Empty when nothing is showing. */}- <div className="absolute bottom-6 right-6 z-91 flex flex-col items-end gap-2">+ {/* Center notices above the editor; gaps remain transparent to pointer input. */}+ <div className="pointer-events-none absolute top-16 left-1/2 z-91 flex w-[min(420px,calc(100%-48px))] -translate-x-1/2 flex-col items-center gap-2">{toasts.map((toast) => (<StudioToastkey={toast.id}message={toast.message}tone={toast.tone}+ presentation={toast.presentation}leaving={toast.leaving}onDismiss={() => dismissToast(toast.id)}/>))}- {host?.feedback !== false && <StudioFeedbackCard />}</div>+ {host?.feedback !== false && (+ <div className="absolute bottom-6 right-6 z-91">+ <StudioFeedbackCard />+ </div>+ )}</>);});diff --git a/studio/src/components/StudioToast.tsx b/studio/src/components/StudioToast.tsxindex 8588f847..d1794214 100644--- a/studio/src/components/StudioToast.tsx+++ b/studio/src/components/StudioToast.tsx@@ -1,41 +1,28 @@-import { RemixIcon } from "../icons/RemixIcons";+import { ErrorNotice } from "./ui/ErrorNotice";import { useI18n } from "../i18n/I18n";import { systemMessage } from "../i18n/systemMessages";interface StudioToastProps {message: string;tone?: "error" | "info";+ presentation?: "feedback";/** Plays the exit animation when true (owner removes the node after ~160ms). */leaving?: boolean;onDismiss?: () => void;}-export function StudioToast({ message, tone, leaving, onDismiss }: StudioToastProps) {+export function StudioToast({ message, tone, presentation, leaving, onDismiss }: StudioToastProps) {const { t } = useI18n();const isError = tone === "error";return (<div- role={isError ? "alert" : "status"}- className={`motion-reduce:animate-none ${leaving ? "hf-toast-exit" : "hf-toast-enter"}`}+ role={isError ? (presentation === "feedback" ? "alert" : undefined) : "status"}+ className={`pointer-events-auto max-w-full motion-reduce:animate-none ${leaving ? "hf-toast-exit" : "hf-toast-enter"}`}>- <div- className={`relative flex max-w-[min(420px,calc(100vw-48px))] items-center gap-3 overflow-hidden rounded-2xl py-3 pl-4 pr-2 text-[12px] ${toastSurface(isError)}`}- >- <span- className={`min-w-0 wrap-break-word leading-5 ${isError ? "text-danger-ink" : "text-text-0"}`}- >- {systemMessage(message, t)}- </span>- {onDismiss && (- <button- type="button"- onClick={onDismiss}- className="flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-neutral-500 transition-colors hover:bg-hover hover:text-neutral-300"- aria-label={t("Dismiss")}- >- <RemixIcon name="close-line" size={14} />- </button>- )}- </div>+ {isError && presentation !== "feedback" ? <div className="max-w-[min(420px,calc(100vw-48px))] rounded-2xl border border-danger/40 bg-raised p-3 shadow-popover">+ <ErrorNotice key={message} message={message} compact onDismiss={onDismiss} />+ </div> : <div className={`max-w-[min(420px,calc(100vw-48px))] overflow-hidden rounded-2xl px-4 py-2 text-[12px] shadow-popover bg-toast-feedback text-toast-feedback-ink`}>+ <span className="line-clamp-3 leading-5 [overflow-wrap:anywhere]" title={systemMessage(message, t)}>{systemMessage(message, t)}</span>+ </div>}</div>);}diff --git a/studio/src/components/TimelineHistoryButtons.dom.test.tsx b/studio/src/components/TimelineHistoryButtons.dom.test.tsxindex 76d61a61..157ff753 100644--- a/studio/src/components/TimelineHistoryButtons.dom.test.tsx+++ b/studio/src/components/TimelineHistoryButtons.dom.test.tsx@@ -5,6 +5,8 @@ import { afterEach, beforeEach, expect, it, vi } from "vitest";import { cleanupMounted, mountHost } from "./ui/mountHost.testHelpers";import { isTypingTarget } from "../utils/typingTarget";import { shouldIgnorePlaybackShortcutTarget } from "../player/lib/playbackShortcuts";+import { StudioHostContext } from "../motion/StudioHost";+import { getHistoryShortcutLabel } from "../utils/studioHelpers";const editHistory = {canUndo: false,@@ -163,3 +165,12 @@ it("keeps a button disabled when it has no handler, whatever canUndo/canRedo sayfor (const label of ["Undo", "Redo"]) expect(button(host, label).disabled).toBe(true);});++it("shows only the action and shortcut in MVP history tooltips", async () => {+ editHistory.canUndo = true;+ editHistory.undoLabel = "Move timeline clip";+ const host = mount(<StudioHostContext.Provider value={{ mvpEditor: true }}><TimelineHistoryButtons /></StudioHostContext.Provider>);+ act(() => button(host, "Undo").focus());+ await act(async () => { await new Promise(resolve => setTimeout(resolve, 0)); });+ expect(document.querySelector('[role="tooltip"]')?.textContent).toBe(`Undo (${getHistoryShortcutLabel('undo')})`);+});diff --git a/studio/src/components/TimelineHistoryButtons.tsx b/studio/src/components/TimelineHistoryButtons.tsxindex 1d4b7289..2e7afc41 100644--- a/studio/src/components/TimelineHistoryButtons.tsx+++ b/studio/src/components/TimelineHistoryButtons.tsx@@ -4,8 +4,10 @@ import { RotateCcw, RotateCw } from "../icons/SystemIcons";import { trackStudioEvent } from "../utils/studioTelemetry";import { historyEntryLabel } from '../i18n/historyMessages';import { getHistoryShortcutLabel } from '../utils/studioHelpers';-import { flatDisabled, flatIdle } from "./timelineToolbarStyles";+import { flatBtn, flatDisabled, flatIdle } from "./timelineToolbarStyles";import { Tooltip } from "./ui";+import { useMvpEditor } from "../motion/StudioHost";+import { RemixIcon } from "../icons/RemixIcons";interface HistoryButtonProps {action: "undo" | "redo";@@ -16,23 +18,24 @@ interface HistoryButtonProps {function HistoryButton({ action, can, label, onClick }: HistoryButtonProps) {const { t } = useI18n();+ const mvp = useMvpEditor();const Icon = action === "undo" ? RotateCcw : RotateCw;const enabled = Boolean(onClick) && can;const verb = t(action === 'undo' ? 'Undo' : 'Redo');const shortcut = getHistoryShortcutLabel(action);return (- <Tooltip label={label ? t('{action} {label} ({shortcut})', { action: verb, label: historyEntryLabel(label, t), shortcut }) : t('{action} ({shortcut})', { action: verb, shortcut })}>+ <Tooltip label={!mvp && label ? t('{action} {label} ({shortcut})', { action: verb, label: historyEntryLabel(label, t), shortcut }) : t('{action} ({shortcut})', { action: verb, shortcut })}><buttontype="button"aria-label={action === "undo" ? t("Undo") : t("Redo")}disabled={!enabled}- className={enabled ? flatIdle : flatDisabled}+ className={enabled ? (mvp ? `${flatBtn} text-text-0 hover:bg-hover active:bg-press active:scale-[0.98]` : flatIdle) : flatDisabled}onClick={() => {trackStudioEvent("toolbar_action", { action });void onClick?.();}}>- <Icon size={16} />+ {mvp ? <RemixIcon name={action === "undo" ? "arrow-go-back-line" : "arrow-go-forward-line"} size={16} /> : <Icon size={16} />}</button></Tooltip>);diff --git a/studio/src/components/TimelineToolbar.test.tsx b/studio/src/components/TimelineToolbar.test.tsxindex 8ff36bde..26955bcd 100644--- a/studio/src/components/TimelineToolbar.test.tsx+++ b/studio/src/components/TimelineToolbar.test.tsx@@ -11,6 +11,7 @@ import { readStudioUiPreferences } from "../utils/studioUiPreferences";import { dispatchPlainKey, type HotkeyCallbacks } from "../hooks/appHotkeysDispatch";import { AudioMeterStrip } from "./nle/AudioMeterStrip";import { TimelineToolbar } from "./TimelineToolbar";+import { StudioHostContext } from "../motion/StudioHost";import { registerTimelineZoomViewport } from "../player/components/timelineZoomInput";vi.mock("../contexts/StudioContext", () => ({@@ -655,3 +656,41 @@ describe("TimelineToolbar split hint", () => {expect(await splitTooltip({ splitShortcut: "⌘B" })).toBe("Split at playhead (⌘B)");});});++it("omits audio meters in the MVP even with audio and a previously enabled preference", () => {+ usePlayerStore.setState({ elements: [{ id: "music", tag: "audio", start: 0, duration: 10, track: 1 }] });+ useAudioMetersVisible.getState().setVisible(true);+ const host = document.createElement("div");+ document.body.append(host);+ const root = createRoot(host);+ try {+ act(() => root.render(<StudioHostContext.Provider value={{ mvpEditor: true }}><TimelineToolbar /><AudioMeterStrip /></StudioHostContext.Provider>));+ expect(host.querySelector('[aria-label="Toggle audio meters"]')).toBeNull();+ expect(host.querySelector('[data-testid="audio-meter-strip"]')).toBeNull();+ } finally {+ act(() => root.unmount());+ host.remove();+ useAudioMetersVisible.setState(useAudioMetersVisible.getInitialState());+ }+});++it("disables empty MVP zoom and restores it when a clip arrives", () => {+ usePlayerStore.setState({ elements: [], selectedElementIds: new Set(), selectedElementId: null });+ const host = document.createElement("div");+ document.body.append(host);+ const root = createRoot(host);+ try {+ act(() => root.render(<StudioHostContext.Provider value={{ mvpEditor: true }}><TimelineToolbar /></StudioHostContext.Provider>));+ const controls = ["Fit timeline to width", "Zoom out", "Zoom in"].map(label => host.querySelector<HTMLButtonElement>(`button[aria-label="${label}"]`)!);+ const slider = host.querySelector<HTMLInputElement>('input[aria-label="Timeline zoom"]')!;+ expect(controls.every(control => control.disabled)).toBe(true);+ expect(slider.disabled).toBe(true);+ act(() => controls.forEach(control => control.click()));+ act(() => usePlayerStore.setState({ elements: [{ id: "clip", tag: "video", start: 0, duration: 5, track: 0 }] }));+ expect(controls.every(control => !control.disabled)).toBe(true);+ expect(slider.disabled).toBe(false);+ } finally {+ act(() => root.unmount());+ usePlayerStore.getState().reset();+ }+});diff --git a/studio/src/components/TimelineToolbar.tsx b/studio/src/components/TimelineToolbar.tsxindex 97fa7d76..c3673a4b 100644--- a/studio/src/components/TimelineToolbar.tsx+++ b/studio/src/components/TimelineToolbar.tsx@@ -4,7 +4,7 @@ import { useI18n } from "../i18n/I18n";import { memo, useEffect, useRef, type ReactNode } from "react";import {ArrowsOutLineHorizontal,- FrameCorners,+ ZoomSelection,Image,Magnet,MagnifyingGlassMinus,@@ -191,6 +191,7 @@ export const TimelineToolbar = memo(function TimelineToolbar({const selectedElementId = usePlayerStore((s) => s.selectedElementId);const selectedElementIds = usePlayerStore((s) => s.selectedElementIds);const elements = usePlayerStore((s) => s.elements);+ const zoomDisabled = mvp && elements.length === 0;const canZoomSelection = canZoomToSelectedClips({elements,selectedElementId,@@ -224,6 +225,7 @@ export const TimelineToolbar = memo(function TimelineToolbar({const store = usePlayerStore.getState();store.setThumbnailMode("adaptive");store.setRippleEditEnabled(false);+ useAudioMetersVisible.getState().setVisible(false);useLinkedClipPreferences.getState().setLinkedSelection(false);}, [mvp]);@@ -284,7 +286,7 @@ export const TimelineToolbar = memo(function TimelineToolbar({<RippleEditIcon size={16} /></button></Tooltip> </>}- {projectHasAudio && (+ {!mvp && projectHasAudio && (<Tooltip label={audioMetersVisible ? t("Hide audio meters") : t("Show audio meters")}><buttontype="button"@@ -524,7 +526,7 @@ export const TimelineToolbar = memo(function TimelineToolbar({onClick={() => zoomTimelineToSelectedClips()}className={canZoomSelection ? flatIdle : flatDisabled}>- <FrameCorners size={16} aria-hidden="true" />+ <ZoomSelection size={16} aria-hidden="true" /></button></Tooltip><Tooltip@@ -533,9 +535,10 @@ export const TimelineToolbar = memo(function TimelineToolbar({><buttontype="button"- onClick={() => setZoomMode("fit")}+ disabled={zoomDisabled}+ onClick={() => { if (!zoomDisabled) setZoomMode("fit"); }}aria-label={t("Fit timeline to width")}- className={flatIdle}+ className={zoomDisabled ? flatDisabled : flatIdle}><ArrowsOutLineHorizontal size={16} aria-hidden="true" /></button>@@ -549,14 +552,16 @@ export const TimelineToolbar = memo(function TimelineToolbar({<buttontype="button"aria-label={t("Zoom out")}- onClick={() => zoomTimelineStep("out")}- className={flatIdle}+ disabled={zoomDisabled}+ onClick={() => { if (!zoomDisabled) zoomTimelineStep("out"); }}+ className={zoomDisabled ? flatDisabled : flatIdle}><MagnifyingGlassMinus size={16} aria-hidden="true" /></button></Tooltip><inputtype="range"+ disabled={zoomDisabled}min="0"max="100"value={timelineZoomPercentToSlider(displayedTimelineZoomPercent, timelineFitPps)}@@ -564,7 +569,7 @@ export const TimelineToolbar = memo(function TimelineToolbar({data-studio-control="timeline-zoom"aria-label={t("Timeline zoom")}onChange={(e) =>- setManualZoomPercent(+ !zoomDisabled && setManualZoomPercent(timelineSliderToZoomPercent(Number(e.target.value), timelineFitPps),)}@@ -576,8 +581,9 @@ export const TimelineToolbar = memo(function TimelineToolbar({<buttontype="button"aria-label={t("Zoom in")}- onClick={() => zoomTimelineStep("in")}- className={flatIdle}+ disabled={zoomDisabled}+ onClick={() => { if (!zoomDisabled) zoomTimelineStep("in"); }}+ className={zoomDisabled ? flatDisabled : flatIdle}><MagnifyingGlassPlus size={16} aria-hidden="true" /></button>diff --git a/studio/src/components/dock/Dock.test.tsx b/studio/src/components/dock/Dock.test.tsxindex 986713bc..a3cbf2d2 100644--- a/studio/src/components/dock/Dock.test.tsx+++ b/studio/src/components/dock/Dock.test.tsx@@ -314,7 +314,7 @@ describe("Dock wiring", () => {target?.classList.contains("hf-dock"),);act(() => dockObservers.forEach(({ callback }) => callback()));- expect(applySideMinimums).toHaveBeenCalledWith(expect.anything(), 560);+ expect(applySideMinimums).toHaveBeenCalledWith(expect.anything(), 560, false);} finally {Object.defineProperty(window, "innerWidth", { value: innerWidth, configurable: true });}@@ -375,7 +375,7 @@ describe("a host's dock", () => {target?.classList.contains("hf-dock"),);act(() => dockObservers.forEach(({ callback }) => callback()));- expect(applySideMinimums).toHaveBeenCalledWith(expect.anything(), 700);+ expect(applySideMinimums).toHaveBeenCalledWith(expect.anything(), 700, false);});});@@ -447,9 +447,9 @@ 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", () => {+it("adds a missing allowed side panel 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") });+ mount("p1", {}, { ...options, panels: MVP_PANEL_IDS.filter(id => id !== "layers") });act(() => {dockApi!.getPanel("compositions")!.api.setSize({ width: 320 });vi.advanceTimersByTime(1000);@@ -460,11 +460,11 @@ it("adds version history to an existing MVP layout without resetting divider sizroot = 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("layers")?.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();+ act(() => useDockLayoutStore.getState().activatePanel("layers"));+ expect(host.querySelector('[data-testid="content-layers"]')).not.toBeNull();expect(dockApi!.getPanel("code")).toBeUndefined();});@@ -493,6 +493,12 @@ it("keeps the MVP panels fixed, rejects hidden panels, and restores divider size});+it("keeps version history outside the MVP dock", () => {+ mount("p1", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, storageKey: "motion.mvp.dock.v1" });+ act(() => useDockLayoutStore.getState().activatePanel("history"));+ expect(dockApi!.getPanel("history")).toBeUndefined();+});+it("expands only the MVP preview and restores layout without remounting the player", () => {const host = document.createElement("div");document.body.append(host);@@ -509,13 +515,18 @@ it("expands only the MVP preview and restores layout without remounting the playconst api = dockApi!;act(() => {api.getPanel("compositions")!.api.setSize({ width: 310 });- api.getPanel("renders")!.api.setActive();+ api.getPanel("layers")!.api.setActive();vi.advanceTimersByTime(1000);});const grid = api.toJSON().grid;const player = host.querySelector("iframe");- const click = (label: string) => act(() => host.querySelector<HTMLButtonElement>(`[aria-label="${label}"]`)!.click());+ const animation = { cancel: vi.fn(), onfinish: null };+ const animate = vi.fn(() => animation);+ Object.defineProperty(api.getPanel("preview")!.view.content.element, "animate", { value: animate, configurable: true });+ const click = (label: string) => act(() => host.querySelector<HTMLButtonElement>(`[aria-label="${label}"]`)!+ .dispatchEvent(new MouseEvent("click", { bubbles: true, detail: 1 })));click("Expand preview");+ expect(animate).toHaveBeenCalledWith(expect.any(Array), { duration: 180, easing: "cubic-bezier(0.22, 1, 0.36, 1)" });expect(api.getPanel("preview")!.group.api.isMaximized()).toBe(true);expect(host.querySelector("iframe")).toBe(player);expect(document.fullscreenElement).toBeFalsy();@@ -535,4 +546,287 @@ it("expands only the MVP preview and restores layout without remounting the playexpect(api.toJSON().grid).toEqual(grid);expect(host.querySelector("iframe")).toBe(player);expect(document.activeElement).toBe(host.querySelector('[aria-label="Expand preview"]'));+ expect(animation.cancel).toHaveBeenCalled();+ const calls = animate.mock.calls.length;+ const reduced = vi.spyOn(window, "matchMedia").mockReturnValue({ matches: true } as MediaQueryList);+ try {+ click("Expand preview");+ expect(api.hasMaximizedGroup()).toBe(true);+ expect(animate).toHaveBeenCalledTimes(calls);+ click("Restore preview");+ expect(api.toJSON().grid).toEqual(grid);+ } finally {+ reduced.mockRestore();+ }+});++it("collapses both MVP sides into rails, restores their tabs and widths, and preserves the preview", async () => {+ const host = document.createElement("div");+ document.body.append(host);+ root = createRoot(host);+ act(() => root?.render(+ <I18nProvider initialLocale="en"><StudioHostContext.Provider value={{ mvpEditor: true }}>+ <Dock.Root projectId="p1" panels={MVP_PANEL_IDS} fixedLayout dockWidth={() => 1400} storageKey="motion.mvp.dock.v1">+ {MVP_PANEL_IDS.map(id => <Dock.Panel key={id} id={id}>+ {id === "preview" ? <iframe title="Preview player" /> : <textarea aria-label={`${id} draft`} defaultValue="Keep draft" />}+ </Dock.Panel>)}+ </Dock.Root>+ </StudioHostContext.Provider></I18nProvider>,+ ));+ const api = dockApi!;+ act(() => {+ api.layout(1400, 800);+ api.getPanel("compositions")!.group.api.setSize({ width: 310 });+ vi.advanceTimersByTime(1000);+ });+ const left = api.getPanel("compositions")!.group;+ const right = api.getPanel("design")!.group;+ const preview = api.getPanel("preview")!.group;+ const widths = [left.width, right.width, preview.width];+ const saved = readStudioUiPreferences(undefined, "p1", "motion.mvp.dock.v1").dockLayout;+ const player = host.querySelector("iframe");+ const draft = host.querySelector('[aria-label="compositions draft"]');+ const click = async (label: string) => act(async () => {+ host.querySelector<HTMLButtonElement>(`button[aria-label="${label}"]`)!.click();+ await Promise.resolve();+ });+ await click("Collapse left panel");+ expect(right.width).toBe(widths[1]);+ await click("Collapse right panel");+ expect(left.width).toBe(48);+ expect(right.width).toBe(48);+ expect(preview.width).toBeGreaterThan(widths[2]!);+ expect(host.querySelectorAll(".hf-dock-side-rail")).toHaveLength(2);+ expect(host.querySelector('[aria-label="compositions draft"]')).toBe(draft);+ expect(draft?.closest('[inert]')).not.toBeNull();+ act(() => {+ dockLayout.applySideMinimums(api, 1000);+ vi.advanceTimersByTime(1000);+ });+ expect(left.width).toBe(48);+ expect(readStudioUiPreferences(undefined, "p1", "motion.mvp.dock.v1").dockLayout).toEqual(saved);+ await click("Expand preview");+ await click("Restore preview");+ expect(left.width).toBe(48);+ expect(right.width).toBe(48);+ expect(host.querySelector("iframe")).toBe(player);+ await click("Expand left panel");+ expect(left.width).toBe(widths[0]);+ expect(draft?.closest('[inert]')).toBeNull();+ await click("Layers");+ expect(right.width).toBe(widths[1]);+ expect(right.activePanel?.id).toBe("layers");+ expect(host.querySelectorAll(".hf-dock-side-rail")).toHaveLength(0);+ expect(host.querySelector("iframe")).toBe(player);+ await click("Collapse right panel");+ await click("Expand preview");+ await act(async () => useDockLayoutStore.getState().activatePanel("layers"));+ expect(api.hasMaximizedGroup()).toBe(false);+ expect(right.width).toBe(widths[1]);+ expect(right.activePanel?.id).toBe("layers");+});+++it("animates side widths, reverses from the current width, and leaves the opposite side and player intact", () => {+ mount("motion", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, dockWidth: () => 1400 });+ const api = dockApi!;+ act(() => api.layout(1400, 800));+ const left = api.getPanel("compositions")!.group;+ const right = api.getPanel("design")!.group;+ const preview = api.getPanel("preview")!.group;+ const initial = { left: left.width, right: right.width, preview: preview.width };+ const controller = useDockLayoutStore.getState().controller!;+ act(() => controller.setGroupCollapsed!("compositions", true, true));+ expect(left.width).toBe(initial.left);+ act(() => vi.advanceTimersByTime(64));+ expect(left.width).toBeGreaterThan(48);+ expect(left.width).toBeLessThan(initial.left);+ expect(right.width).toBe(initial.right);+ expect(preview.width).toBeGreaterThan(initial.preview);+ const halfway = left.width;+ act(() => controller.setGroupCollapsed!("compositions", false, true));+ expect(left.width).toBe(halfway);+ act(() => vi.advanceTimersByTime(240));+ expect(left.width).toBe(initial.left);+ expect(left.element.hasAttribute("data-side-motion")).toBe(false);+ act(() => {+ controller.setGroupCollapsed!("compositions", true, true);+ controller.setGroupCollapsed!("design", true, true);+ vi.advanceTimersByTime(240);+ });+ expect(left.width).toBe(48);+ expect(right.width).toBe(48);+ act(() => {+ controller.setGroupCollapsed!("compositions", false, true);+ controller.setGroupCollapsed!("design", false, true);+ vi.advanceTimersByTime(240);+ });+ expect(left.width).toBe(initial.left);+ expect(right.width).toBe(initial.right);+});++it("skips side motion when reduced motion is requested", () => {+ const media = vi.spyOn(window, "matchMedia").mockReturnValue({+ matches: true, addEventListener: vi.fn(), removeEventListener: vi.fn(),+ } as unknown as MediaQueryList);+ try {+ mount("reduced", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, dockWidth: () => 1400 });+ act(() => dockApi!.layout(1400, 800));+ const left = dockApi!.getPanel("compositions")!.group;+ act(() => useDockLayoutStore.getState().controller!.setGroupCollapsed!("compositions", true, true));+ expect(left.width).toBe(48);+ expect(left.element.hasAttribute("data-side-motion")).toBe(false);+ } finally {+ media.mockRestore();+ }+});+++it("opens the compact MVP with both rails and a 30% timeline, without locking divider resizing", () => {+ mount("compact", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, initialCompactLayout: true, dockWidth: () => 1400 });+ const api = dockApi!;+ act(() => { api.layout(1400, 800); vi.advanceTimersByTime(32); });+ expect(api.getPanel("compositions")!.group.width).toBe(48);+ expect(api.getPanel("design")!.group.width).toBe(48);+ expect(useDockLayoutStore.getState().collapsedZones).toEqual(expect.arrayContaining(["left", "right"]));+ const timeline = api.getPanel("timeline")!.group;+ expect(timeline.height).toBe(240);+ act(() => timeline.api.setSize({ height: 360 }));+ expect(timeline.height).toBe(360);+ act(() => api.layout(1400, 800));+ expect(timeline.height).toBe(360);+ act(() => useDockLayoutStore.getState().controller!.setGroupCollapsed!("design", false));+ expect(api.getPanel("design")!.group.width).toBeGreaterThan(48);+ expect(timeline.height).toBe(360);+});+++it("collapses MVP sides when the host narrows, preserves content, and allows explicit reopening", () => {+ let width = 1400;+ const host = mount("responsive", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, dockWidth: () => width });+ const api = dockApi!;+ act(() => api.layout(width, 800));+ const content = host.querySelector('[data-testid="content-preview"]');+ const left = api.getPanel("compositions")!.group;+ const right = api.getPanel("design")!.group;+ act(() => api.getPanel("catalog")!.api.setActive());+ const resize = (nextWidth: number) => act(() => {+ width = nextWidth;+ [...liveObservers].filter(({ target }) => target?.classList.contains("hf-dock"))+ .forEach(({ callback }) => callback());+ api.layout(width, 800);+ });+ resize(800);+ expect(left.width).toBe(48);+ expect(right.width).toBe(48);+ expect(left.activePanel?.id).toBe("catalog");+ expect(host.querySelector('[data-testid="content-preview"]')).toBe(content);+ act(() => useDockLayoutStore.getState().activatePanel("assets"));+ resize(800); // A height-only resize must not close a manually opened side.+ expect(left.width).toBeGreaterThan(48);+ expect(right.width).toBe(48);+ resize(739);+ expect(left.width).toBe(0);+ resize(1400);+ expect(left.width).toBe(48);+ expect(right.width).toBe(48);+ resize(320);+ expect(left.width).toBe(0);+ expect(right.width).toBe(0);+ expect(api.getPanel("preview")!.group.width).toBeGreaterThanOrEqual(308);+ resize(800);+ expect(left.width).toBe(48);+ expect(right.width).toBe(48);+ expect(api.getPanel("preview")!.group.width).toBeGreaterThan(0);+ expect(host.querySelector('[data-testid="content-preview"]')).toBe(content);+});++it.each([740, 800, 1000])("keeps compact sides exclusive and readable at %ipx across activation and animation reversal", (width) => {+ const host = mount("exclusive", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, dockWidth: () => width });+ const api = dockApi!;+ act(() => api.layout(width, 800));+ const left = api.getPanel("compositions")!.group;+ const right = api.getPanel("design")!.group;+ const content = host.querySelector('[data-testid="content-preview"]');+ const controller = useDockLayoutStore.getState().controller!;+ act(() => controller.setGroupCollapsed!("design", false, true));+ act(() => vi.advanceTimersByTime(240));+ expect(left.width).toBe(48);+ expect(right.width).toBeGreaterThanOrEqual(320);+ act(() => useDockLayoutStore.getState().activatePanel("assets"));+ expect(right.width).toBe(48);+ expect(left.width).toBeGreaterThanOrEqual(320);+ expect(left.activePanel?.id).toBe("assets");+ act(() => {+ controller.setGroupCollapsed!("design", false, true);+ vi.advanceTimersByTime(64);+ controller.setGroupCollapsed!("compositions", false, true);+ vi.advanceTimersByTime(240);+ dockLayout.applySideMinimums(api, width, true);+ });+ expect(right.width).toBe(48);+ expect(left.width).toBeGreaterThanOrEqual(320);+ expect(useDockLayoutStore.getState().collapsedZones).toEqual(["right"]);+ expect(api.getPanel("preview")!.group.width).toBeGreaterThanOrEqual(360);+ expect(left.width + right.width + api.getPanel("preview")!.group.width).toBeLessThanOrEqual(width);+ expect(host.querySelector('[data-testid="content-preview"]')).toBe(content);+});+++it.each([320, 480, 640, 739])("keeps both sides hidden at %ipx even when explicitly activated", (width) => {+ const host = mount("preview-first", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, dockWidth: () => width });+ const api = dockApi!;+ act(() => api.layout(width, 800));+ const content = host.querySelector('[data-testid="content-preview"]');+ for (const id of ["design", "assets", "layers", "catalog"] as const) {+ act(() => {+ useDockLayoutStore.getState().controller!.setGroupCollapsed!(id, false, true);+ useDockLayoutStore.getState().activatePanel(id);+ vi.advanceTimersByTime(240);+ });+ expect(api.getPanel(id)!.group.width).toBe(0);+ expect(api.getPanel(id)!.group.element.classList.contains("hf-dock-side-hidden")).toBe(true);+ expect(api.getPanel("preview")!.group.width).toBeGreaterThanOrEqual(width - 12);+ expect(useDockLayoutStore.getState().collapsedZones).toEqual(expect.arrayContaining(["left", "right"]));+ }+ expect(host.querySelector('[data-testid="content-preview"]')).toBe(content);+});++it("collapses oversized remembered sides when reopening would crowd the preview on a wide host", () => {+ mount("remembered-width", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, dockWidth: () => 1200 });+ const api = dockApi!;+ act(() => api.layout(1200, 800));+ const left = api.getPanel("compositions")!.group;+ const right = api.getPanel("design")!.group;+ const controller = useDockLayoutStore.getState().controller!;+ act(() => {+ controller.setGroupCollapsed!("design", true);+ left.api.setSize({ width: 650 });+ controller.setGroupCollapsed!("compositions", true);+ controller.setGroupCollapsed!("design", false);+ controller.setGroupCollapsed!("compositions", false);+ });+ expect(right.width).toBe(48);+ expect(left.width).toBeGreaterThanOrEqual(320);+ expect(api.getPanel("preview")!.group.width).toBeGreaterThanOrEqual(360);+});+++it("finishes an in-flight opening before narrowing into preview-only mode", () => {+ let width = 800;+ mount("resize-motion", {}, { panels: MVP_PANEL_IDS, fixedLayout: true, dockWidth: () => width });+ const api = dockApi!;+ act(() => {+ api.layout(width, 800);+ useDockLayoutStore.getState().controller!.setGroupCollapsed!("design", false, true);+ vi.advanceTimersByTime(64);+ width = 480;+ [...liveObservers].filter(({ target }) => target?.classList.contains("hf-dock"))+ .forEach(({ callback, target }) => (callback as (entries: unknown[]) => void)([{ target, contentRect: { width, height: 800 } }]));+ api.layout(width, 800);+ vi.advanceTimersByTime(240);+ });+ expect(api.getPanel("design")!.group.width).toBe(0);+ expect(api.getPanel("compositions")!.group.width).toBe(0);+ expect(api.getPanel("preview")!.group.width).toBeGreaterThanOrEqual(468);});diff --git a/studio/src/components/dock/Dock.tsx b/studio/src/components/dock/Dock.tsxindex dfb88a99..794f43fd 100644--- a/studio/src/components/dock/Dock.tsx+++ b/studio/src/components/dock/Dock.tsx@@ -21,7 +21,8 @@ import { DockStripActions } from "./DockStripActions";import { DockHeaderSlotsProvider } from "./DockHeaderSlots";import { DockTab } from "./DockTab";import { installTabFill } from "./dockTabFill";-import { addRegisteredPanel, applySideMinimums, buildEditLayout, defaultSideWidths } from "./dockLayout";+import { createSidePanelMotion } from "./dockSidePanelMotion";+import { addRegisteredPanel, applySideMinimums, buildEditLayout, defaultSideWidths, isSideCollapsed, sideMinimumWidth, previewMinimumWidth, COMPACT_DOCK_WIDTH, PREVIEW_ONLY_DOCK_WIDTH, MIN_PREVIEW_W, DOCK_GAPS, collapsedSideWidth } from "./dockLayout";import { DOCK_PANEL_COMPONENT, parseDockLayout } from "./dockLayoutSchema";import { useDockLayoutStore, type DockController, type DockSnapshot } from "./dockLayoutStore";import {@@ -56,13 +57,14 @@ function useSlots(): SlotsContextValue {function PanelSlot({ api }: IDockviewPanelProps) {const { registerSlot } = useSlots();const id = api.id;+ const collapsed = useDockLayoutStore(state => isPanelId(id) && (state.collapsedZones?.includes(PANEL_DEFINITIONS[id].zone) ?? false));const ref = useCallback((element: HTMLDivElement | null) => {if (isPanelId(id)) registerSlot(id, element);},[id, registerSlot],);- return <div ref={ref} className="h-full w-full min-h-0 min-w-0 overflow-hidden" />;+ return <div ref={ref} inert={collapsed} style={collapsed ? { display: "none" } : undefined} className="h-full w-full min-h-0 min-w-0 overflow-hidden" />;}const COMPONENTS = { [DOCK_PANEL_COMPONENT]: PanelSlot };@@ -85,6 +87,10 @@ function snapshot(api: DockviewApi): DockSnapshot {visiblePanels,activePanel: isPanelId(active) ? active : null,groupActivePanels,+ collapsedZones: api.groups.filter(isSideCollapsed).flatMap(group => {+ const id = group.panels[0]?.id;+ return isPanelId(id) ? [PANEL_DEFINITIONS[id].zone] : [];+ }),};}@@ -95,7 +101,56 @@ interface DockOptions {fixedLayout?: boolean;}-function createController(api: DockviewApi, options: DockOptions): DockController {+function createController(api: DockviewApi, options: DockOptions): DockController & { dispose: () => void; finishTransitions: () => void } {+ const motion = createSidePanelMotion();+ const expandedWidths = new WeakMap<object, number>();+ const setGroupCollapsed = (id: PanelId, collapsed: boolean, animate = false) => {+ const group = api.getPanel(id)?.group;+ if (!options.fixedLayout || !group || PANEL_DEFINITIONS[id].zone === "center" || isSideCollapsed(group) === collapsed) return;+ if (!collapsed && options.dockWidth() < PREVIEW_ONLY_DOCK_WIDTH) return;+ const railWidth = collapsedSideWidth(options.dockWidth(), true);+ const compact = options.dockWidth() < COMPACT_DOCK_WIDTH;+ const zone = PANEL_DEFINITIONS[id].zone as "left" | "right";+ const preferredWidth = Math.max(expandedWidths.get(group) ?? defaultSideWidths(options.dockWidth())[zone], sideMinimumWidth(options.dockWidth(), true));+ const otherSideWidth = api.groups.filter(other => other !== group && other.panels.every(panel => isPanelId(panel.id) && PANEL_DEFINITIONS[panel.id].zone !== "center"))+ .reduce((sum, other) => sum + other.width, 0);+ if (!collapsed && (compact || preferredWidth + otherSideWidth + MIN_PREVIEW_W + DOCK_GAPS > options.dockWidth())) {+ // The newly requested side wins, including rail shortcuts and programmatic+ // activation. Keep the opposite group's tabs and content mounted.+ for (const other of api.groups) {+ const otherId = other.panels[0]?.id;+ if (other !== group && isPanelId(otherId) && PANEL_DEFINITIONS[otherId].zone !== "center") {+ setGroupCollapsed(otherId, true);+ }+ }+ }+ // A reversal starts at the current width but retains the original expanded width.+ if (collapsed && !motion.has(group.element)) expandedWidths.set(group, group.width);+ const from = group.width;+ const remainingSides = api.groups.filter(other => other !== group && other.panels.every(panel => isPanelId(panel.id) && PANEL_DEFINITIONS[panel.id].zone !== "center"))+ .reduce((sum, other) => sum + other.width, 0);+ const target = collapsed ? railWidth : Math.min(preferredWidth, options.dockWidth() - remainingSides - MIN_PREVIEW_W - DOCK_GAPS);+ group.element.classList.toggle("hf-dock-side-collapsed", collapsed);+ api.getPanel("preview")?.group.api.setConstraints({ minimumWidth: previewMinimumWidth(options.dockWidth(), true) });+ const resize = (width: number, finished: boolean) => {+ // Dockview owns both the card and its separately portaled content. Resize through+ // its API so borders, hit targets and the live preview stay aligned throughout.+ const otherSides = api.groups.filter(other => other !== group && other.panels.every(panel => isPanelId(panel.id) && PANEL_DEFINITIONS[panel.id].zone !== "center"));+ for (const other of otherSides) other.api.setConstraints({ minimumWidth: other.width, maximumWidth: other.width });+ group.api.setConstraints({ minimumWidth: railWidth, maximumWidth: Number.POSITIVE_INFINITY });+ group.api.setSize({ width });+ if (finished) group.api.setConstraints({+ minimumWidth: collapsed ? railWidth : sideMinimumWidth(options.dockWidth(), true),+ maximumWidth: collapsed ? railWidth : Number.POSITIVE_INFINITY,+ });+ for (const other of otherSides) other.api.setConstraints({+ minimumWidth: motion.has(other.element) || isSideCollapsed(other) ? railWidth : sideMinimumWidth(options.dockWidth(), true),+ maximumWidth: isSideCollapsed(other) && !motion.has(other.element) ? railWidth : Number.POSITIVE_INFINITY,+ });+ };+ motion.run(group.element, from, target, animate, resize);+ useDockLayoutStore.getState().sync(snapshot(api));+ };const open = (id: PanelId) => {if (!options.panels.includes(id) || api.getPanel(id)) return;if (id === "preview") {@@ -152,11 +207,15 @@ function createController(api: DockviewApi, options: DockOptions): DockControlleaddRegisteredPanel(api, id, hasAnchor ? position : fallback);};return {+ dispose: motion.dispose,+ finishTransitions: motion.finishAll,open,+ setGroupCollapsed,activate: (id) => {open(id);const panel = api.getPanel(id);if (!panel?.group.api.isMaximized()) api.exitMaximizedGroup();+ setGroupCollapsed(id, false);if (panel && !panel.group.api.isVisible) panel.group.api.setVisible(true);panel?.api.setActive();},@@ -171,9 +230,14 @@ function createController(api: DockviewApi, options: DockOptions): DockControlleif ((!options.fixedLayout || visible) && group && group.api.isVisible !== visible) group.api.setVisible(visible);},reset: () => {+ motion.finishAll();buildEditLayout(api, options.dockWidth(), options.panels);const timeline = api.getPanel("timeline");if (options.fixedLayout && timeline) timeline.group.header.hidden = true;+ if (options.fixedLayout && options.dockWidth() < COMPACT_DOCK_WIDTH) {+ for (const id of options.panels) setGroupCollapsed(id, true);+ }+ applySideMinimums(api, options.dockWidth(), options.fixedLayout);},};}@@ -201,6 +265,7 @@ function Root({panels = PANEL_IDS,storageKey,fixedLayout = false,+ initialCompactLayout = false,dockWidth = windowWidth,children,}: {@@ -208,6 +273,7 @@ function Root({panels?: readonly PanelId[];storageKey?: string;fixedLayout?: boolean;+ initialCompactLayout?: boolean;dockWidth?: () => number;children: ReactNode;}) {@@ -237,40 +303,82 @@ function Root({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());+ applySideMinimums(api, dockWidth(), fixedLayout);const root = api.groups[0]?.element.closest<HTMLElement>(".hf-dock");const disposeAccessibility = root ? installDockAccessibility(api, root, (message) => translateRef.current(message)) : () => {};const disposeTabFill = root ? installTabFill(api, root) : () => {};// Sides size against dockWidth, the window by default; the dock's own box lags a resize.- const resizeObserver = new ResizeObserver(() => applySideMinimums(api, dockWidth()));- if (root) resizeObserver.observe(root);+ let needsInitialTimelineSize = fixedLayout && initialCompactLayout;+ let initialSizeFrame: number | undefined;+ const initializeTimelineSize = () => {+ if (!needsInitialTimelineSize || initialSizeFrame !== undefined || api.height <= 0) return;+ // Dockview first lays out against its minimum dimensions. Wait for its+ // initial host measurement before deriving the opening ratio.+ initialSizeFrame = requestAnimationFrame(() => {+ initialSizeFrame = undefined;+ if (api.height <= 0) return;+ needsInitialTimelineSize = false;+ timeline?.group.api.setSize({ height: Math.max(100, Math.round(api.height * 0.3)) });+ });+ };const store = useDockLayoutStore.getState();store.attach(controller, panels);+ let previousWidth = dockWidth();+ const fitHostWidth = () => {+ const width = dockWidth();+ if (width <= 0) return;+ if (width !== previousWidth) controller.finishTransitions();+ previousWidth = width;+ const expandedSides = api.groups.filter(group => !isSideCollapsed(group) && group.panels.every(panel => isPanelId(panel.id) && PANEL_DEFINITIONS[panel.id].zone !== "center"));+ const sidesWidth = api.groups.filter(group => group.panels.every(panel => isPanelId(panel.id) && PANEL_DEFINITIONS[panel.id].zone !== "center"))+ .reduce((sum, group) => sum + (isSideCollapsed(group) ? collapsedSideWidth(width, true) : Math.max(group.width, sideMinimumWidth(width, true))), 0);+ // Revalidate restored layouts, shrinking hosts and expanded widths alike.+ // A height-only resize leaves an expansion intact whenever it still fits.+ if (fixedLayout && (width < PREVIEW_ONLY_DOCK_WIDTH || (expandedSides.length > 0 && sidesWidth + MIN_PREVIEW_W + DOCK_GAPS > width))) {+ for (const zone of ["left", "right"] as const) {+ const id = panels.find(id => PANEL_DEFINITIONS[id].zone === zone);+ if (id) controller.setGroupCollapsed?.(id, true);+ }+ }+ applySideMinimums(api, width, fixedLayout);+ initializeTimelineSize();+ };+ const resizeObserver = new ResizeObserver(fitHostWidth);+ if (root) resizeObserver.observe(root);+ if (fixedLayout && initialCompactLayout) {+ for (const zone of ["left", "right"] as const) {+ const id = panels.find(id => PANEL_DEFINITIONS[id].zone === zone);+ if (id) controller.setGroupCollapsed?.(id, true);+ }+ initializeTimelineSize();+ }store.sync(snapshot(api));const pending = store.takePendingActivation();if (pending) store.activatePanel(pending);+ fitHostWidth();let timer: ReturnType<typeof setTimeout> | undefined;const persist = () => {clearTimeout(timer);timer = setTimeout(() => {- if (fixedLayout && api.hasMaximizedGroup()) return;+ if (fixedLayout && (api.hasMaximizedGroup() || api.groups.some(group => isSideCollapsed(group) || group.element.hasAttribute("data-side-motion")))) return;writeStudioUiPreferences({ dockLayout: api.toJSON() }, undefined, projectId, storageKey);}, PERSIST_DEBOUNCE_MS);};// dockview does not fire onDidLayoutChange for add/remove/activate,// so every event class is wired to the same sync+persist pair.const onDockChange = () => {+ initializeTimelineSize();useDockLayoutStore.getState().sync(snapshot(api));persist();};const subscriptions = [api.onDidAddPanel(() => {- applySideMinimums(api, dockWidth());+ applySideMinimums(api, dockWidth(), fixedLayout);onDockChange();}),api.onDidMovePanel(() => {- applySideMinimums(api, dockWidth());+ applySideMinimums(api, dockWidth(), fixedLayout);onDockChange();}),api.onDidRemovePanel(onDockChange),@@ -280,6 +388,8 @@ function Root({];disposeRef.current = () => {clearTimeout(timer);+ if (initialSizeFrame !== undefined) cancelAnimationFrame(initialSizeFrame);+ controller.dispose();for (const subscription of subscriptions) subscription.dispose();disposeAccessibility();disposeTabFill();@@ -287,7 +397,7 @@ function Root({useDockLayoutStore.getState().detach();};},- [projectId, panels, storageKey, dockWidth, fixedLayout],+ [projectId, panels, storageKey, dockWidth, fixedLayout, initialCompactLayout],);return (diff --git a/studio/src/components/dock/DockSideActions.tsx b/studio/src/components/dock/DockSideActions.tsxnew file mode 100644index 00000000..195f2def--- /dev/null+++ b/studio/src/components/dock/DockSideActions.tsx@@ -0,0 +1,58 @@+import { useEffect, useRef } from "react";+import { createPortal } from "react-dom";+import type { IDockviewHeaderActionsProps } from "dockview-react";+import { RemixIcon } from "../../icons/RemixIcons";+import { useI18n } from "../../i18n/I18n";+import { IconButton, Tooltip } from "../ui";+import { TAB_ICONS } from "./DockTab";+import { useDockLayoutStore } from "./dockLayoutStore";+import { isPanelId, PANEL_DEFINITIONS } from "./panelRegistry";++/** A collapsed side keeps its Dockview group, tabs and preview sibling intact. */+export function DockSideActions({ group, panels }: Pick<IDockviewHeaderActionsProps, "group" | "panels" | "activePanel">) {+ const { t } = useI18n();+ const first = panels.find(panel => isPanelId(panel.id))?.id;+ const zone = isPanelId(first) ? PANEL_DEFINITIONS[first].zone : "center";+ const collapsed = useDockLayoutStore(state => state.collapsedZones?.includes(zone) ?? false);+ const controller = useDockLayoutStore(state => state.controller);+ const activatePanel = useDockLayoutStore(state => state.activatePanel);+ const buttonRef = useRef<HTMLButtonElement>(null);+ const previous = useRef(collapsed);+ useEffect(() => {+ if (previous.current !== collapsed) buttonRef.current?.focus({ preventScroll: true });+ previous.current = collapsed;+ }, [collapsed]);+ if (!isPanelId(first) || zone === "center") return null;+ const label = t(zone === "left"+ ? collapsed ? "Expand left panel" : "Collapse left panel"+ : collapsed ? "Expand right panel" : "Collapse right panel");+ const toggle = (+ <Tooltip label={t(collapsed ? "Expand" : "Collapse")} side={collapsed ? zone === "left" ? "right" : "left" : "bottom"}>+ <IconButton ref={buttonRef} size={collapsed ? "lg" : "sm"} aria-label={label}+ aria-expanded={!collapsed} icon={<RemixIcon name="arrow-right-s-line" size={16} mirrored={zone === "left" ? !collapsed : collapsed} />}+ onClick={event => controller?.setGroupCollapsed?.(first, !collapsed, event.detail > 0)} />+ </Tooltip>+ );+ if (!collapsed) return <div className="hf-dock-side-actions">{toggle}</div>;+ return createPortal(+ <nav className="hf-dock-side-rail" aria-label={t(zone === "left" ? "Left panels" : "Right panels")}>+ {toggle}+ <div className="hf-dock-side-rail-divider" role="separator" />+ <div className="hf-dock-side-rail-items">+ {panels.map(panel => {+ if (!isPanelId(panel.id)) return null;+ const id = panel.id;+ const Icon = TAB_ICONS[id];+ const title = panel.title || t(PANEL_DEFINITIONS[id].title);+ return <Tooltip key={id} label={title} side={zone === "left" ? "right" : "left"}>+ <IconButton size="lg" aria-label={title} aria-expanded={false}+ icon={<Icon size={16} />} onClick={event => {+ controller?.setGroupCollapsed?.(id, false, event.detail > 0);+ activatePanel(id);+ }} />+ </Tooltip>;+ })}+ </div>+ </nav>, group.element,+ );+}diff --git a/studio/src/components/dock/DockStripActions.tsx b/studio/src/components/dock/DockStripActions.tsxindex 389b7b47..2790050a 100644--- a/studio/src/components/dock/DockStripActions.tsx+++ b/studio/src/components/dock/DockStripActions.tsx@@ -1,4 +1,5 @@import { DockHeaderSlot } from "./DockHeaderSlots";+import { DockSideActions } from "./DockSideActions";import { useMvpEditor } from "../../motion/StudioHost";import { useI18n } from "../../i18n/I18n";import { useCallback, useEffect, useRef, useSyncExternalStore } from "react";@@ -14,6 +15,8 @@ export function DockStripActions({containerApi,panels,isGroupActive,+ group,+ activePanel,}: IDockviewHeaderActionsProps) {const { t } = useI18n();const mvp = useMvpEditor();@@ -30,6 +33,32 @@ export function DockStripActions({const resetLayout = useDockLayoutStore((state) => state.resetLayout);const previewGroup = panels.some((panel) => panel.id === "preview");const expandButton = useRef<HTMLButtonElement>(null);+ const previewMotion = useRef<Animation | null>(null);+ useEffect(() => {+ const preference = window.matchMedia?.("(prefers-reduced-motion: reduce)");+ const stop = () => { previewMotion.current?.cancel(); previewMotion.current = null; };+ const onChange = () => { if (preference?.matches) stop(); };+ preference?.addEventListener("change", onChange);+ return () => { stop(); preference?.removeEventListener("change", onChange); };+ }, []);+ const togglePreview = (animate: boolean) => {+ const element = containerApi.getPanel("preview")?.view.content.element;+ const previous = previewMotion.current && element ? getComputedStyle(element) : null;+ const from = previous ? { opacity: previous.opacity, transform: previous.transform } : null;+ previewMotion.current?.cancel();+ previewMotion.current = null;+ const restoring = api.isMaximized();+ if (restoring) api.exitMaximized();+ else api.maximize();+ if (!animate || !element?.animate || window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;+ // Animate the live content, not Dockview's measured overlay or a cloned player.+ const animation = element.animate([+ from ?? { opacity: 0.86, transform: restoring ? "scale(1.01)" : "scale(0.985)" },+ { opacity: 1, transform: "scale(1)" },+ ], { duration: 180, easing: "cubic-bezier(0.22, 1, 0.36, 1)" });+ previewMotion.current = animation;+ animation.onfinish = () => { if (previewMotion.current === animation) previewMotion.current = null; };+ };useEffect(() => {if (!mvp || !previewGroup || !maximized) return;const restore = (event: KeyboardEvent) => {@@ -37,6 +66,8 @@ export function DockStripActions({if (document.querySelector('[role="dialog"], [role="menu"], [role="listbox"]')) return;event.preventDefault();event.stopImmediatePropagation();+ previewMotion.current?.cancel();+ previewMotion.current = null;api.exitMaximized();expandButton.current?.focus({ preventScroll: true });};@@ -56,11 +87,11 @@ export function DockStripActions({aria-label={t(maximized ? "Restore preview" : "Expand preview")}aria-expanded={maximized}icon={maximized ? <CornersIn size={16} /> : <CornersOut size={16} />}- onClick={() => (maximized ? api.exitMaximized() : api.maximize())}+ onClick={event => togglePreview(event.detail > 0)}/></Tooltip></div>- ) : null;+ ) : <DockSideActions group={group} panels={panels} activePanel={activePanel} />;if (!isGroupActive) return null;const first = panels.find((panel) => isPanelId(panel.id))?.id;diff --git a/studio/src/components/dock/DockTab.tsx b/studio/src/components/dock/DockTab.tsxindex c1890a3c..f67ecbe9 100644--- a/studio/src/components/dock/DockTab.tsx+++ b/studio/src/components/dock/DockTab.tsx@@ -8,12 +8,12 @@ import {ClockCounterClockwise,Code,FilmSlate,+ FilmStrip,Image,- Layout,Monitor,Presentation,SlidersHorizontal,- SquaresFour,+ Sparkle,Stack,X,type Icon,@@ -21,13 +21,13 @@ import {import type { IDockviewPanelHeaderProps } from "dockview-react";import { isPanelId, PANEL_DEFINITIONS, type PanelId } from "./panelRegistry";-const TAB_ICONS: Record<PanelId, Icon> = {+export const TAB_ICONS: Record<PanelId, Icon> = {preview: Monitor,timeline: ChartBarHorizontal,- compositions: Layout,+ compositions: FilmStrip,assets: Image,code: Code,- catalog: SquaresFour,+ catalog: Sparkle,design: SlidersHorizontal,layers: Stack,renders: FilmSlate,diff --git a/studio/src/components/dock/dock.css b/studio/src/components/dock/dock.cssindex 4c2bcb6a..80c0cd71 100644--- a/studio/src/components/dock/dock.css+++ b/studio/src/components/dock/dock.css@@ -54,6 +54,32 @@border-radius: 10px;}+/* Dockview portals panel content beside the group, so the card's clipping does+ not reach it. Match its inner bottom corners without drawing another edge. */+:root[data-motion-ui] .dv-shell .dv-render-overlay {+ border-radius: 0 0 9px 9px;+ overflow: hidden;+}++.hf-dock-side-actions { display: flex; align-items: center; height: 100%; padding-right: 4px; }+.hf-dock .hf-dock-side-collapsed { position: relative; }+.hf-dock .hf-dock-side-collapsed > .dv-tabs-and-actions-container,+.hf-dock .hf-dock-side-collapsed > .dv-content-container { display: none; }+.hf-dock-side-rail {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ flex-direction: column;+ gap: 10px;+ padding: 6px 0;+ overflow-y: auto;+ background: var(--panel-card-bg);+ border-radius: inherit;+}+.hf-dock-side-rail-divider { flex-shrink: 0; width: 26px; border-top: 1px solid var(--panel-card-border); }+.hf-dock-side-rail-items { display: flex; flex-direction: column; gap: 6px; }+.hf-dock .dv-tabs-and-actions-container {align-items: flex-end;padding: 6px 0 0 4px;@@ -111,6 +137,10 @@--dv-inactivegroup-hiddenpanel-tab-color: var(--color-text-1);}+:root[data-motion-ui] .hf-dock .dv-tab {+ border-radius: 6px;+}+.hf-dock .dv-tab:focus-visible {outline: 1.5px solid var(--color-accent);outline-offset: -1.5px;@@ -203,3 +233,21 @@animation: none;}}+++/* Align MVP titles, header controls and the collapsed rail toggles on one row. */+:root[data-motion-ui] .hf-dock .dv-tabs-and-actions-container {+ align-items: center;+ padding-top: 0;+}+:root[data-motion-ui] .hf-dock .dv-right-actions-container {+ align-self: center;+}+:root[data-motion-ui] .hf-dock-side-rail {+ padding-top: 2px;+ gap: 6px;+}++/* Zero-width side groups remain mounted but cannot expose offscreen controls. */+.hf-dock .hf-dock-side-hidden { visibility: hidden; border: 0; }+.hf-dock .dv-view:has(> .hf-dock-side-hidden) { padding: 0; }diff --git a/studio/src/components/dock/dockLayout.ts b/studio/src/components/dock/dockLayout.tsindex 7af9675e..f8c8c9e9 100644--- a/studio/src/components/dock/dockLayout.ts+++ b/studio/src/components/dock/dockLayout.ts@@ -2,7 +2,7 @@ import type { Direction, DockviewApi } from "dockview-react";import { DOCK_PANEL_COMPONENT } from "./dockLayoutSchema";import { PANEL_DEFINITIONS, PANEL_IDS, isPanelId, type PanelId } from "./panelRegistry";-const MIN_PREVIEW_W = 360;+export const MIN_PREVIEW_W = 360;const MIN_PREVIEW_H = 200;const MIN_TIMELINE_H = 100;const MIN_SIDE_W = 200;@@ -10,6 +10,16 @@ const MIN_SIDE_W_FLOOR = 120;const DEFAULT_TIMELINE_H = 360;const DEFAULT_LEFT = ["compositions", "assets", "code", "catalog"] as const;const DEFAULT_RIGHT = ["design", "layers", "renders", "variables", "motionBlur"] as const;+export const COLLAPSED_SIDE_WIDTH = 48;+const COMPACT_SIDE_WIDTH = 320;+export const DOCK_GAPS = 12;+// Breakpoints derive from usable panel sizes, not an independent viewport guess.+export const COMPACT_DOCK_WIDTH = MIN_PREVIEW_W + 2 * COMPACT_SIDE_WIDTH + DOCK_GAPS;+export const PREVIEW_ONLY_DOCK_WIDTH = MIN_PREVIEW_W + COMPACT_SIDE_WIDTH + COLLAPSED_SIDE_WIDTH + DOCK_GAPS;+export const collapsedSideWidth = (width: number, fixedLayout = false) =>+ fixedLayout && width < PREVIEW_ONLY_DOCK_WIDTH ? 0 : COLLAPSED_SIDE_WIDTH;+export const isSideCollapsed = (group: DockviewApi["groups"][number]) =>+ group.element.classList.contains("hf-dock-side-collapsed");/** Preferred side widths; when they overflow the preview's floor the right yields first, then the left. */export function defaultSideWidths(viewportWidth: number) {@@ -23,14 +33,20 @@ export function defaultSideWidths(viewportWidth: number) {}/**- * Side groups keep MIN_SIDE_W while both fit beside the preview's floor, then shrink down to- * MIN_SIDE_W_FLOOR; below that the dock overflows and clips rather than squeezing the preview.+ * Fixed MVP sides keep their readable control width; the controller collapses them+ * when space runs out. Free-layout sides retain the native shrinking policy.*/-export function sideMinimumWidth(dockWidth: number): number {+export function sideMinimumWidth(dockWidth: number, fixedLayout = false): number {+ if (fixedLayout) return COMPACT_SIDE_WIDTH;const fair = Math.floor((dockWidth - MIN_PREVIEW_W) / 2);return Math.min(MIN_SIDE_W, Math.max(MIN_SIDE_W_FLOOR, fair));}+export function previewMinimumWidth(dockWidth: number, fixedLayout: boolean): number {+ if (!fixedLayout) return MIN_PREVIEW_W;+ return Math.min(MIN_PREVIEW_W, Math.max(0, dockWidth - 2 * collapsedSideWidth(dockWidth, true) - DOCK_GAPS));+}+function holdsPreview(group: DockviewApi["groups"][number]) {return group.panels.some((panel) => panel.id === "preview");}@@ -46,18 +62,27 @@ function sideZone(group: DockviewApi["groups"][number]): "left" | "right" | null}/** Idempotent; rewrites every group's minimum, since dockview keeps a constraint once set. */-export function applySideMinimums(api: DockviewApi, dockWidth = window.innerWidth) {- const minimumWidth = sideMinimumWidth(dockWidth);+export function applySideMinimums(api: DockviewApi, dockWidth = window.innerWidth, fixedLayout = false) {+ const minimumWidth = sideMinimumWidth(dockWidth, fixedLayout);+ const compact = fixedLayout && dockWidth < COMPACT_DOCK_WIDTH;const cap = defaultSideWidths(dockWidth);+ const railWidth = collapsedSideWidth(dockWidth, fixedLayout);for (const group of api.groups) {+ group.element.classList.toggle("hf-dock-side-hidden", railWidth === 0 && !!sideZone(group));+ if (group.element.hasAttribute("data-side-motion")) continue;+ if (isSideCollapsed(group)) {+ group.api.setConstraints({ minimumWidth: railWidth, maximumWidth: railWidth });+ group.api.setSize({ width: railWidth });+ continue;+ }if (holdsPreview(group)) {- group.api.setConstraints({ minimumWidth: MIN_PREVIEW_W });+ group.api.setConstraints({ minimumWidth: previewMinimumWidth(dockWidth, fixedLayout) });continue;}- group.api.setConstraints({ minimumWidth });+ group.api.setConstraints({ minimumWidth, maximumWidth: Number.POSITIVE_INFINITY });const zone = sideZone(group);const limit = zone === "right" ? cap.right : cap.left;- if (zone && minimumWidth < MIN_SIDE_W && group.width > limit) {+ if (zone && !compact && minimumWidth < MIN_SIDE_W && group.width > limit) {group.api.setSize({ width: limit });}}diff --git a/studio/src/components/dock/dockLayoutStore.ts b/studio/src/components/dock/dockLayoutStore.tsindex 3887734d..db177e2a 100644--- a/studio/src/components/dock/dockLayoutStore.ts+++ b/studio/src/components/dock/dockLayoutStore.ts@@ -17,6 +17,7 @@ export interface DockController {close: (id: PanelId) => void;/** Hides or shows the panel's whole tab group without closing it. */setGroupVisible: (id: PanelId, visible: boolean) => void;+ setGroupCollapsed?: (id: PanelId, collapsed: boolean, animate?: boolean) => void;reset: () => void;}@@ -27,6 +28,7 @@ export interface DockSnapshot {activePanel: PanelId | null;/** The tab each group shows, so a restored layout still records what every side column last showed. */groupActivePanels?: readonly PanelId[];+ collapsedZones?: readonly PanelZone[];}type LastActive = Partial<Record<PanelZone, PanelId>>;diff --git a/studio/src/components/dock/dockSidePanelMotion.ts b/studio/src/components/dock/dockSidePanelMotion.tsnew file mode 100644index 00000000..6234e8c4--- /dev/null+++ b/studio/src/components/dock/dockSidePanelMotion.ts@@ -0,0 +1,49 @@+const DURATION_MS = 180;++/** One interruptible transition per side; no panel or player is recreated. */+export function createSidePanelMotion() {+ const running = new Map<HTMLElement, { frame: number; finish: () => void }>();+ const reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)");+ const cancel = (element: HTMLElement) => {+ const current = running.get(element);+ if (current) cancelAnimationFrame(current.frame);+ running.delete(element);+ element.removeAttribute("data-side-motion");+ };+ const finishAll = () => {+ for (const current of [...running.values()]) current.finish();+ };+ const onPreferenceChange = () => {+ if (reducedMotion?.matches) finishAll();+ };+ reducedMotion?.addEventListener("change", onPreferenceChange);+ return {+ finishAll,+ has: (element: HTMLElement) => running.has(element),+ run(element: HTMLElement, from: number, to: number, animate: boolean,+ resize: (width: number, finished: boolean) => void) {+ cancel(element);+ if (!animate || reducedMotion?.matches || Math.abs(from - to) < 1) {+ resize(to, true);+ return;+ }+ element.setAttribute("data-side-motion", "");+ const start = performance.now();+ const finish = () => { cancel(element); resize(to, true); };+ const state = { frame: 0, finish };+ const step = (now: number) => {+ const progress = Math.min(1, Math.max(0, (now - start) / DURATION_MS));+ if (progress === 1) { finish(); return; }+ // Cubic ease-out: immediate response with a gentle, non-bouncy landing.+ resize(from + (to - from) * (1 - (1 - progress) ** 3), false);+ state.frame = requestAnimationFrame(step);+ };+ running.set(element, state);+ state.frame = requestAnimationFrame(step);+ },+ dispose() {+ for (const element of running.keys()) cancel(element);+ reducedMotion?.removeEventListener("change", onPreferenceChange);+ },+ };+}diff --git a/studio/src/components/dock/dockTabs.contract.test.ts b/studio/src/components/dock/dockTabs.contract.test.tsindex 4f1c866d..b74350e3 100644--- a/studio/src/components/dock/dockTabs.contract.test.ts+++ b/studio/src/components/dock/dockTabs.contract.test.ts@@ -38,11 +38,12 @@ const bodyOf = (selector: string) =>rules(dockCss).find((rule) => rule.selector === selector)?.body;describe("dock panel strip contract", () => {- it("draws one border per surface: the card's, and no divider, separator or tab outline", () => {+ it("limits borders to cards and rail separators, clearing hidden side groups", () => {const bordered = rules(dockCss).filter((rule) => /(^|[\s;{])border(-(top|right|bottom|left))?\s*:/.test(rule.body)).map((rule) => rule.selector);- expect(bordered).toEqual([".hf-dock .dv-groupview"]);+ expect(bordered).toEqual([".hf-dock .dv-groupview", ".hf-dock-side-rail-divider", ".hf-dock .hf-dock-side-hidden"]);+ expect(bodyOf(".hf-dock .hf-dock-side-hidden")).toMatch(/border:\s*0\s*;/);const dock = bodyOf(".hf-dock");expect(dock).toContain("--dv-tab-divider-color: transparent");expect(dock).toContain("--dv-separator-border: transparent");diff --git a/studio/src/components/dock/panelRegistry.ts b/studio/src/components/dock/panelRegistry.tsindex b2d3fbfc..04bc6e1e 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", "history",+ "preview", "timeline", "compositions", "assets", "catalog", "design", "layers",];export type PanelZone = "left" | "center" | "right";diff --git a/studio/src/components/editor/DomEditOverlay.tsx b/studio/src/components/editor/DomEditOverlay.tsxindex 9d49d8e4..1f7d9c18 100644--- a/studio/src/components/editor/DomEditOverlay.tsx+++ b/studio/src/components/editor/DomEditOverlay.tsx@@ -550,7 +550,7 @@ export const DomEditOverlay = memo(function DomEditOverlay({editing session, which does. */}{inlineText.toolbar}<OffCanvasIndicators- rects={hostInput ? [] : offCanvasRects}+ rects={hostInput || mvp ? [] : offCanvasRects}elements={offCanvasElementsRef}compRect={compRect}selection={selection}diff --git a/studio/src/components/editor/LayersPanel.tsx b/studio/src/components/editor/LayersPanel.tsxindex 476b752e..ac1b5267 100644--- a/studio/src/components/editor/LayersPanel.tsx+++ b/studio/src/components/editor/LayersPanel.tsx@@ -1,3 +1,5 @@+import { PanelEmptyState } from "../ui/PanelEmptyState";+import { useMvpEditor } from "../../motion/StudioHost";import { RemixIcon } from "../../icons/RemixIcons";import { useI18n } from "../../i18n/I18n";import { useLivePreviewIframe } from "../../player/store/previewIframeStore";@@ -112,6 +114,7 @@ function useLayersPanelHost(host: LayersPanelHost | undefined): LayersPanelHost// fallow-ignore-next-line complexityexport const LayersPanel = memo(function LayersPanel({ host }: { host?: LayersPanelHost }) {+ const mvp = useMvpEditor();const { t } = useI18n();const {previewIframeRef,@@ -417,6 +420,7 @@ export const LayersPanel = memo(function LayersPanel({ host }: { host?: LayersPa});if (layers.length === 0) {+ if (mvp) return <PanelEmptyState icon="stack-line" message={t("No layers")} />;return (<div className="flex h-full flex-col items-center justify-center bg-panel-bg px-6 text-center"><Layers size={18} className="mb-3 text-panel-text-5" />@@ -431,9 +435,9 @@ export const LayersPanel = memo(function LayersPanel({ host }: { host?: LayersPaclassName="flex h-full min-h-0 flex-col overflow-hidden bg-panel-bg"onPointerLeave={() => handleLayerHover(null)}>- <div className="border-b border-panel-border px-3 py-2 text-[11px] text-panel-text-3">+ {!mvp && <div className="border-b border-panel-border px-3 py-2 text-[11px] text-panel-text-3">{t("{count} layers", { count: layers.length })}- </div>+ </div>}<divref={scrollContainerRef}className="relative min-h-0 flex-1 select-none overflow-y-auto py-1"diff --git a/studio/src/components/editor/PropertyPanelEmptyState.tsx b/studio/src/components/editor/PropertyPanelEmptyState.tsxindex a228706e..a0e1b542 100644--- a/studio/src/components/editor/PropertyPanelEmptyState.tsx+++ b/studio/src/components/editor/PropertyPanelEmptyState.tsx@@ -1,3 +1,6 @@+import { PanelEmptyState } from "../ui/PanelEmptyState";+import { useEmptyPreview } from "../nle/useEmptyPreview";+import { useStudioShellContextOptional } from "../../contexts/StudioContext";import { RemixIcon } from "../../icons/RemixIcons";import { useMvpEditor } from "../../motion/StudioHost";import { useI18n } from "../../i18n/I18n";@@ -9,6 +12,11 @@ import { useTrackDesignInput } from "../../contexts/DesignPanelInputContext";function FlatEmptyState() {const { t } = useI18n();const mvp = useMvpEditor();+ const projectId = useStudioShellContextOptional()?.projectId ?? "";+ const empty = useEmptyPreview(projectId, mvp);+ if (mvp) return <PanelEmptyState icon="cursor-line"+ message={t(empty ? "No editable content" : "Nothing selected")}+ description={empty ? undefined : t("Click any element on the canvas to edit it.")} />;return (<div className="flex h-full flex-col items-center justify-center gap-2.5 px-8 py-10 text-center"><span className="flex h-11 w-11 items-center justify-center rounded-xl border border-panel-border-input bg-panel-input text-panel-text-3">@@ -17,7 +25,7 @@ function FlatEmptyState() {<div className="text-[13px] font-semibold text-panel-text-0">{t("Nothing selected")}</div><div className="max-w-[250px] text-[11px] leading-normal text-panel-text-3">{t(mvp ? "Click any element on the canvas to edit it." : "Click any element on the canvas to edit it, or drag to select several.")}</div>- <div className="mt-2 flex w-full flex-col gap-1.5">+ {!mvp && <div className="mt-2 flex w-full flex-col gap-1.5">{!mvp && <><span className="flex items-center justify-between rounded-lg border border-panel-border bg-panel-bg px-3 py-2"><span className="flex items-center gap-2 text-[11px] text-panel-text-2">@@ -36,7 +44,7 @@ function FlatEmptyState() {⌘K</span></span>- </div>+ </div>}</div>);}diff --git a/studio/src/components/editor/PropertyPanelFlat.tsx b/studio/src/components/editor/PropertyPanelFlat.tsxindex d648ac70..2b4f309d 100644--- a/studio/src/components/editor/PropertyPanelFlat.tsx+++ b/studio/src/components/editor/PropertyPanelFlat.tsx@@ -18,7 +18,7 @@ import { PropertyPanelFlatFooter } from "./PropertyPanelFlatFooter";import { closedGroupHeader, isSelectionHidden } from "./propertyPanelFlatClosedGroup";import { FlatGroupHeader } from "./propertyPanelFlatPrimitives";import { FlatTextSection } from "./propertyPanelFlatTextSection";-import { FlatStyleSection } from "./propertyPanelFlatStyleSections";+import { FlatOpacitySlider, FlatStyleSection } from "./propertyPanelFlatStyleSections";import { FlatLayoutSection } from "./propertyPanelFlatLayoutSection";import { FlatMotionSection, motionSectionLabel } from "./propertyPanelFlatMotionSection";import { AudioFxGroup } from "./propertyPanelAudioFxGroup.js";@@ -221,7 +221,7 @@ export function PropertyPanelFlat({const reveal = useAudioFxRevealSection({elementId: element?.id,- hasAudioFxSection: Boolean(sections.audioFx),+ hasAudioFxSection: !mvp && Boolean(sections.audioFx),});if (reveal.revealNonce !== null) {reveal.consume(reveal.revealNonce);@@ -321,6 +321,10 @@ export function PropertyPanelFlat({// eslint-disable-next-line react-hooks/exhaustive-deps -- store replacement signals live group membership changed}, [element, storeElements]);+ const preserveOpacityAnimation = mvp && gsapAnimations.some(animation =>+ [animation.properties, animation.fromProperties, ...(animation.keyframes?.keyframes.map(frame => frame.properties) ?? [])]+ .some(properties => properties && ("opacity" in properties || "autoAlpha" in properties)),+ );const groups: FlatGroupDescriptor[] = [];if (isTextEditable) {groups.push({@@ -328,21 +332,34 @@ export function PropertyPanelFlat({title: "Text",summary: formatTextFieldPreview(element.textFields[0]?.value ?? ""),content: (- <FlatTextSection- element={element}- styles={styles}- fontAssets={fontAssets}- onImportFonts={onImportFonts}- onSetText={onSetText}- onSetTextFieldStyle={onSetTextFieldStyle}- onPreviewTextFieldStyle={onPreviewTextFieldStyle}- onAddTextField={onAddTextField}- onRemoveTextField={onRemoveTextField}- />+ <>+ <FlatTextSection+ element={element}+ styles={styles}+ fontAssets={fontAssets}+ onImportFonts={onImportFonts}+ onSetText={onSetText}+ onSetTextFieldStyle={onSetTextFieldStyle}+ onPreviewTextFieldStyle={onPreviewTextFieldStyle}+ onAddTextField={onAddTextField}+ onRemoveTextField={onRemoveTextField}+ />+ {mvp && showEditableSections && (+ <div className="mt-1.5">+ <FlatOpacitySlider+ styles={styles}+ inlineStyles={element.inlineStyles}+ preserveOpacityAnimation={preserveOpacityAnimation}+ disabled={!element.capabilities.canEditStyles}+ onSetStyle={onSetStyle}+ />+ </div>+ )}+ </>),});}- if (showEditableSections) {+ if (showEditableSections && !(mvp && isTextEditable)) {const opacityValue = parseFloat(styles.opacity ?? "1");const opacityPct = Math.round((Number.isFinite(opacityValue) ? opacityValue : 1) * 100);groups.push({@@ -351,6 +368,7 @@ export function PropertyPanelFlat({summary: t("Fill: {fill} · {opacity}%", { fill: t(styles["background-image"] && styles["background-image"] !== "none" ? "Image/gradient" : styles["background-color"] ? "Solid" : "None"), opacity: opacityPct }),content: (<FlatStyleSection+ preserveOpacityAnimation={preserveOpacityAnimation}projectId={projectId}element={element}styles={styles}@@ -364,7 +382,7 @@ export function PropertyPanelFlat({),});}- if (sections.layout) {+ if (!mvp && sections.layout) {groups.push({id: "layout",title: "Layout",@@ -494,7 +512,7 @@ export function PropertyPanelFlat({});}}- if (sections.audioFx) {+ if (!mvp && sections.audioFx) {groups.push({id: "audio-fx",title: "Audio FX",@@ -562,7 +580,7 @@ export function PropertyPanelFlat({>{mvp ? groups.map((group) => (<DesignPanelInputProvider key={group.id} section={slugifyDesignInput(group.title)}>- <section data-flat-group-open="true" className="shrink-0 border-b border-panel-hairline">+ <section data-flat-group-open="true" className="shrink-0 border-b border-panel-hairline last:border-b-0"><div className="flex items-center justify-between px-4 py-3"><h3 className="text-[12px] font-semibold text-panel-text-0">{t(group.title)}</h3>{group.accessory}diff --git a/studio/src/components/editor/PropertyPanelFlatFooter.tsx b/studio/src/components/editor/PropertyPanelFlatFooter.tsxindex 8862945e..cb25d3de 100644--- a/studio/src/components/editor/PropertyPanelFlatFooter.tsx+++ b/studio/src/components/editor/PropertyPanelFlatFooter.tsx@@ -24,6 +24,8 @@ export function PropertyPanelFlatFooter({? t("Stop recording {value0}s", { value0: (recordingDuration ?? 0).toFixed(1) }): t("Record gesture ({recordKey})", { recordKey: recordKey });+ if (mvp) return null;+return (// No border-t here: every possible element immediately above this footer// in the new fixed-headers + scrollable-open-section layout (a collapseddiff --git a/studio/src/components/editor/domEditing.test.ts b/studio/src/components/editor/domEditing.test.tsindex a067d7dc..e0a8ad98 100644--- a/studio/src/components/editor/domEditing.test.ts+++ b/studio/src/components/editor/domEditing.test.ts@@ -1390,3 +1390,12 @@ describe("hfId — find, key, capabilities (R7 fixes)", () => {expect(result.canMove).toBe(true);});});++it("recognizes a heading with explicit line breaks as editable text", async () => {+ const document = createDocument('<h1 id="title">Your next<br data-hf-id="break">great story.</h1>');+ const selection = await resolveDomEditSelection(document.getElementById("title")!, {+ activeCompositionPath: null, isMasterView: false, preferClipAncestor: false,+ });+ expect(isTextEditableSelection(selection!)).toBe(true);+ expect(selection!.textFields).toMatchObject([{ source: "self", value: "Your next\ngreat story.", preserveLineBreaks: true }]);+});diff --git a/studio/src/components/editor/domEditing.ts b/studio/src/components/editor/domEditing.tsindex 5ebc7898..fc4342a6 100644--- a/studio/src/components/editor/domEditing.ts+++ b/studio/src/components/editor/domEditing.ts@@ -18,6 +18,7 @@ export type {// Element finders, visibility, visual scoring, raster detectionexport {findElementForSelection,+ findElementsForSelection,findElementForTimelineElement,isLargeRasterDomEditSelection,resolveVisualDomEditSelectionTarget,diff --git a/studio/src/components/editor/domEditingDom.ts b/studio/src/components/editor/domEditingDom.tsindex d47e1dbc..88a1516a 100644--- a/studio/src/components/editor/domEditingDom.ts+++ b/studio/src/components/editor/domEditingDom.ts@@ -5,6 +5,7 @@*/import { COLOR_GRADING_SOURCE_HIDDEN_ATTR } from "@hyperframes/core/color-grading";import { getSourceScopedSelectorIndex } from "../../utils/sourceScopedSelectorIndex";+import { LAYER_OPACITY_PROPERTY } from "./layerOpacity";import { CURATED_STYLE_PROPERTIES } from "./domEditingTypes";// ─── Type guard ───────────────────────────────────────────────────────────────@@ -36,7 +37,7 @@ const knownTextLeaves = new WeakSet<HTMLElement>();export function isEditableTextLeaf(el: HTMLElement): boolean {const tag = el.tagName.toLowerCase();- if (!isTextBearingTag(tag) || el.children.length !== 0) return false;+ if (!isTextBearingTag(tag) || Array.from(el.children).some(child => child.tagName.toLowerCase() !== "br")) return false;if (el.textContent?.trim()) {knownTextLeaves.add(el);return true;@@ -135,7 +136,7 @@ export function getCuratedComputedStyles(el: HTMLElement): Record<string, stringexport function getInlineStyles(el: HTMLElement): Record<string, string> {const styles: Record<string, string> = {};- for (const property of CURATED_STYLE_PROPERTIES) {+ for (const property of [...CURATED_STYLE_PROPERTIES, LAYER_OPACITY_PROPERTY]) {const value = el.style.getPropertyValue(property);if (value) styles[property] = value;}diff --git a/studio/src/components/editor/domEditingElement.ts b/studio/src/components/editor/domEditingElement.tsindex 045d20e8..ab24b6d1 100644--- a/studio/src/components/editor/domEditingElement.ts+++ b/studio/src/components/editor/domEditingElement.ts@@ -285,11 +285,11 @@ type FindElementSelection = Pick<DomEditSelection, "id" | "hfId" | "selector" |sourceFile?: string;};-export function findElementForSelection(+export function findElementsForSelection(doc: Document,selection: FindElementSelection,activeCompositionPath: string | null = null,-): HTMLElement | null {+): HTMLElement[] {const sourceMatches = (candidate: Element): candidate is HTMLElement =>isHtmlElement(candidate) &&(!selection.sourceFile ||@@ -299,19 +299,29 @@ export function findElementForSelection(querySelectorAllSafely(doc, selector).filter(sourceMatches);if (selection.hfId) {- const byHfId = findAll(`[data-hf-id="${escapeCssString(selection.hfId)}"]`)[0];- if (byHfId) return byHfId;+ const byHfId = findAll(`[data-hf-id="${escapeCssString(selection.hfId)}"]`);+ if (byHfId.length) return byHfId;}if (selection.id) {// Flattened sub-compositions can repeat authored ids. getElementById returns// only the first document match, so filter every id match by source first.- const byId = findAll(`[id="${escapeCssString(selection.id)}"]`)[0];- if (byId) return byId;+ const byId = findAll(`[id="${escapeCssString(selection.id)}"]`);+ if (byId.length) return byId;}- if (!selection.selector) return null;- return findAll(selection.selector)[selection.selectorIndex ?? 0] ?? null;+ if (!selection.selector) return [];+ const match = findAll(selection.selector)[selection.selectorIndex ?? 0];+ return match ? [match] : [];+}++/** Single-node callers retain their existing lookup; source style edits update every instance. */+export function findElementForSelection(+ doc: Document,+ selection: FindElementSelection,+ activeCompositionPath: string | null = null,+): HTMLElement | null {+ return findElementsForSelection(doc, selection, activeCompositionPath)[0] ?? null;}// The selected node while mounted, else its copy in the selection's own file (ids repeat across files), else any copy.diff --git a/studio/src/components/editor/domEditingLayers.ts b/studio/src/components/editor/domEditingLayers.tsindex bcb802b4..b1173b1b 100644--- a/studio/src/components/editor/domEditingLayers.ts+++ b/studio/src/components/editor/domEditingLayers.ts@@ -70,7 +70,10 @@ function buildTextField(return {key,label: getTextFieldLabel(tagName, index, total, source),- value: el.textContent ?? "",+ value: Array.from(el.childNodes).map(node =>+ node.nodeType === 1 && (node as Element).tagName.toLowerCase() === "br" ? "\n" : node.textContent ?? "",+ ).join(""),+ ...(el.querySelector(":scope > br") ? { preserveLineBreaks: true } : {}),tagName,attributes: Array.from(el.attributes).filter((attribute) => !NOT_COPIED_ATTRS.has(attribute.name))@@ -138,6 +141,11 @@ function escapeHtmlText(value: string): string {return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");}+export function serializeDomEditTextFieldValue(field: DomEditTextField): string {+ const escaped = escapeHtmlText(field.value);+ return field.preserveLineBreaks ? escaped.replace(/\r?\n/g, "<br>") : escaped;+}+function serializeTextFieldStyle(field: DomEditTextField): string {const entries = Object.entries(field.inlineStyles).filter(([, value]) => Boolean(value));if (entries.length === 0) return "";@@ -159,7 +167,7 @@ export function serializeDomEditTextFields(fields: DomEditTextField[]): string {.join("");const style = serializeTextFieldStyle(field);const styleAttr = style ? ` style="${style.replace(/"/g, """)}"` : "";- return `<${field.tagName}${attrs}${styleAttr}>${escapeHtmlText(field.value)}</${field.tagName}>`;+ return `<${field.tagName}${attrs}${styleAttr}>${serializeDomEditTextFieldValue(field)}</${field.tagName}>`;}).join("");}diff --git a/studio/src/components/editor/domEditingTypes.ts b/studio/src/components/editor/domEditingTypes.tsindex 1839b56e..434af6cc 100644--- a/studio/src/components/editor/domEditingTypes.ts+++ b/studio/src/components/editor/domEditingTypes.ts@@ -74,6 +74,8 @@ export interface DomEditTextField {computedStyles: Record<string, string>;source: "self" | "child" | "text-node";sourceChildIndex?: number;+ /** Explicit HTML line breaks must survive inspector text edits. */+ preserveLineBreaks?: boolean;}export interface DomEditSelection extends PatchTarget {diff --git a/studio/src/components/editor/layerOpacity.test.ts b/studio/src/components/editor/layerOpacity.test.tsnew file mode 100644index 00000000..0bece127--- /dev/null+++ b/studio/src/components/editor/layerOpacity.test.ts@@ -0,0 +1,32 @@+// @vitest-environment happy-dom+import { describe, expect, it } from "vitest";+import { layerOpacityStyles, layerOpacityValue, LAYER_OPACITY_PROPERTY } from "./layerOpacity";+import { getInlineStyles } from "./domEditingDom";+import { applyPatch } from "../../utils/sourcePatcher";++describe("independent layer opacity", () => {+ it("persists and reads back the multiplier without changing the authored fade", () => {+ const script = '<script>tl.fromTo("#title", {opacity: 0}, {opacity: 1, duration: .7});</script>';+ let source = '<h1 id="title" style="filter: blur(2px)">Title</h1>' + script;+ const styles = layerOpacityStyles(.47, {filter: "blur(2px)"}, {opacity: ".99"});+ for (const [property, value] of Object.entries(styles)) {+ source = applyPatch(source, "title", {type: "inline-style", property, value});+ }+ expect(source).toContain(script);+ const doc = new DOMParser().parseFromString(source, "text/html");+ const el = doc.getElementById("title")!;+ expect(layerOpacityValue(getInlineStyles(el))).toBe(.47);+ // Seeking the authored fade can continue to write opacity independently.+ el.style.opacity = ".2";+ expect(el.style.filter).toBe("blur(2px) opacity(var(--hf-layer-opacity))");+ expect(el.style.getPropertyValue(LAYER_OPACITY_PROPERTY)).toBe("0.47");+ });++ it("does not accumulate filters and can recover from zero", () => {+ const zero = layerOpacityStyles(0, {}, {filter: "blur(2px)"});+ const restored = layerOpacityStyles(1, zero, {filter: "blur(2px) opacity(0)"});+ expect(restored.filter).toBe("blur(2px) opacity(var(--hf-layer-opacity))");+ expect(layerOpacityValue(restored)).toBe(1);+ expect(restored).not.toHaveProperty("opacity");+ });+});diff --git a/studio/src/components/editor/layerOpacity.ts b/studio/src/components/editor/layerOpacity.tsnew file mode 100644index 00000000..f32a8be9--- /dev/null+++ b/studio/src/components/editor/layerOpacity.ts@@ -0,0 +1,23 @@+/** A separate opacity multiplier leaves an authored GSAP fade untouched. */+export const LAYER_OPACITY_PROPERTY = "--hf-layer-opacity";+const LAYER_OPACITY_FILTER = `opacity(var(${LAYER_OPACITY_PROPERTY}))`;++export function layerOpacityValue(inlineStyles: Record<string, string>): number {+ const value = Number.parseFloat(inlineStyles[LAYER_OPACITY_PROPERTY] ?? "1");+ return Number.isFinite(value) ? Math.max(0, Math.min(1, value)) : 1;+}++export function layerOpacityStyles(+ value: number,+ inlineStyles: Record<string, string>,+ computedStyles: Record<string, string>,+): Record<string, string> {+ // Prefer the authored filter so repeated changes never bake the previous+ // multiplier into a computed filter or discard unrelated blur/color effects.+ const filter = inlineStyles.filter || computedStyles.filter || "none";+ const base = filter.replaceAll(LAYER_OPACITY_FILTER, "").trim();+ return {+ [LAYER_OPACITY_PROPERTY]: String(Math.max(0, Math.min(1, value))),+ filter: `${base === "none" ? "" : base + " "}${LAYER_OPACITY_FILTER}`.trim(),+ };+}diff --git a/studio/src/components/editor/persistSeam.integration.test.ts b/studio/src/components/editor/persistSeam.integration.test.tsindex b2fdd9d2..b0601c3e 100644--- a/studio/src/components/editor/persistSeam.integration.test.ts+++ b/studio/src/components/editor/persistSeam.integration.test.ts@@ -15,6 +15,7 @@ import {buildDomEditTextPatchOperation,} from "./domEditingLayers";import { makeSelection } from "../../hooks/domSelectionTestHarness";+import { planDomTextCommit } from "../../hooks/domEditTextCommitPlan";import { buildTextFieldChildOperations } from "../../hooks/domEditTextFieldCommitOps";const testDir = dirname(fileURLToPath(import.meta.url));@@ -244,3 +245,21 @@ describe("persist seam source mutation", () => {expect(findElementInHtml(html, ".leaf-b").textContent).toBe("Second updated");});});++it("preserves multiline headings when changing text color and editing their copy", () => {+ const source = '<h1 id="title" data-hf-id="heading">Your next<br data-hf-id="break">great story.</h1>';+ const holder = document.createElement("div");+ holder.innerHTML = source;+ const heading = holder.firstElementChild as HTMLElement;+ const fields = collectDomEditTextFields(heading);+ const colored = patchAndExpectChange(source, { hfId: "heading" }, [buildDomEditStylePatchOperation("color", "#ff0000")]);+ expect(findElementInHtml(colored, "h1").innerHTML).toBe(heading.innerHTML);+ const copy = 'Your next\n<great> & story.';+ const plan = planDomTextCommit(fields, [{ ...fields[0], value: copy }], copy);+ const saved = patchAndExpectChange(colored, { hfId: "heading" }, plan.operations);+ const result = findElementInHtml(saved, "h1");+ expect(result.querySelectorAll("br")).toHaveLength(1);+ expect(result.querySelector("great")).toBeNull();+ expect(result.textContent).toBe('Your next<great> & story.');+ expect(collectDomEditTextFields(result as HTMLElement)[0].value).toBe(copy);+});diff --git a/studio/src/components/editor/previewReadOnly.overlay.test.tsx b/studio/src/components/editor/previewReadOnly.overlay.test.tsxindex 139d16f2..d1bacda7 100644--- a/studio/src/components/editor/previewReadOnly.overlay.test.tsx+++ b/studio/src/components/editor/previewReadOnly.overlay.test.tsx@@ -9,6 +9,7 @@ import { __resetForTests } from "../../utils/canvasNudgeGate";import { PreviewReadOnlyProvider } from "./previewReadOnlyContext";import "./domEditOverlayTestMocks";import { DomEditOverlay } from "./DomEditOverlay";+import { StudioHostContext } from "../../motion/StudioHost";import { UNREADABLE_TRANSLATE } from "./plainTranslate";(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;@@ -62,6 +63,7 @@ function textElement(id: string): HTMLElement {function fixture(overrides: Partial<React.ComponentProps<typeof DomEditOverlay>> = {},readOnly = false,+ mvpEditor = false,) {const spies = {onCanvasMouseDown: vi.fn(),@@ -97,7 +99,7 @@ function fixture(act(() =>root.render(<PreviewReadOnlyProvider readOnly={readOnly}>- <DomEditOverlay {...props} />+ <StudioHostContext.Provider value={{ mvpEditor }}><DomEditOverlay {...props} /></StudioHostContext.Provider></PreviewReadOnlyProvider>,),);@@ -513,3 +515,12 @@ describe("DomEditOverlay on a layer whose translate Studio can't read", () => {expect(selection.element.style.getPropertyValue("translate")).toBe("abs(10% - 50px) 0px");});});+++it("hides unselected off-canvas markers in MVP while keeping the selected outline", () => {+ layout.offCanvasElements.set("stray", textElement("stray"));+ layout.offCanvas = [{ key: "stray", left: 820, top: 10, width: 120, height: 40 }];+ const { overlay } = fixture({}, false, true);+ expect(overlay.querySelector('[aria-label="Select off-canvas element stray"]')).toBeNull();+ expect(overlay.querySelector(BOX)).not.toBeNull();+});diff --git a/studio/src/components/editor/propertyPanelColor.test.tsx b/studio/src/components/editor/propertyPanelColor.test.tsxindex 82dd7461..6dda2e28 100644--- a/studio/src/components/editor/propertyPanelColor.test.tsx+++ b/studio/src/components/editor/propertyPanelColor.test.tsx@@ -69,12 +69,14 @@ function clickOutside(): void {}describe("ColorField flat trigger", () => {- it("renders label and value inline with a small swatch, no boxed border", () => {+ it("renders an inline color control with swatch and separate alpha", () => {const host = renderColorField({ value: "rgb(255, 176, 32)" });const trigger = host.querySelector<HTMLButtonElement>('[data-flat-color-trigger="true"]');expect(trigger).not.toBeNull();expect(trigger?.className).not.toContain("border-neutral-800");expect(host.textContent).toContain("Color");+ expect(trigger?.textContent).toContain("FFB020");+ expect(trigger?.textContent).not.toContain("rgb(");});it("persists one keyboard slider gesture on keyup", () => {@@ -101,6 +103,22 @@ describe("ColorField flat trigger", () => {});describe("ColorField hex editing", () => {+ it.each([0, 0.5])("displays hex and separate alpha without changing a translucent color (%s)", (alpha) => {+ const onCommit = vi.fn();+ const host = renderColorField({ value: `rgba(34, 68, 102, ${alpha})`, onCommit });+ const trigger = host.querySelector('[data-flat-color-trigger="true"]')!;+ expect(trigger.textContent).toContain("224466");+ expect(trigger.textContent).toContain(`${alpha * 100}%`);+ const input = openHexInput(host);+ expect(input.value).toBe("#224466");+ const dialog = document.querySelector('[role="dialog"]')!;+ expect(dialog.textContent).toContain("#224466");+ expect(dialog.textContent).not.toContain("rgba(");+ expect(dialog.textContent).toContain(`A ${alpha * 100}%`);+ act(clickOutside);+ expect(onCommit).not.toHaveBeenCalled();+ });+it("allows #333333 to be backspaced to #3 without snapping", () => {const input = openHexInput(renderColorField());diff --git a/studio/src/components/editor/propertyPanelColor.tsx b/studio/src/components/editor/propertyPanelColor.tsxindex df88a094..5ffe9521 100644--- a/studio/src/components/editor/propertyPanelColor.tsx+++ b/studio/src/components/editor/propertyPanelColor.tsx@@ -182,6 +182,10 @@ export function ColorField({});const opaqueColor = formatCssColor({ ...draftColor, alpha: 1 });const currentColor = formatCssColor(draftColor);+ const currentHex = toHexColor(draftColor).toUpperCase();+ const displayColor = open ? draftColor : parseCssColor(value);+ const displayHex = displayColor ? toHexColor(displayColor).toUpperCase() : value;+ const displayAlpha = displayColor ? Math.round(displayColor.alpha * 100) : 100;const saturationPercent = Math.round(hsv.saturation * 100);const brightnessPercent = Math.round(hsv.value * 100);const alphaPercent = Math.round(draftColor.alpha * 100);@@ -396,7 +400,7 @@ export function ColorField({/><div className="min-w-0 flex-1"><div className="truncate text-[11px] font-medium text-neutral-100">- {currentColor}+ {currentHex}</div><div className="mt-0.5 text-[9px] text-neutral-600">S {saturationPercent}% · B {brightnessPercent}% · A {alphaPercent}%@@ -465,7 +469,7 @@ export function ColorField({if (flat) {return (- <div className="flex min-h-[30px] items-center justify-between">+ <div className="flex min-h-[30px] items-center justify-between gap-2"><span className="text-[11px] text-panel-text-2">{label}</span><buttontype="button"@@ -474,14 +478,20 @@ export function ColorField({aria-label={t("Pick {value0} color", { value0: label.toLowerCase() })}ref={buttonRef}onClick={openPicker}- className="flex items-center gap-2 disabled:cursor-not-allowed"+ className="flex h-7 min-w-0 items-center rounded-md bg-panel-bg-soft px-1.5 text-[11px] text-panel-text-0 transition-colors hover:bg-panel-hover disabled:cursor-not-allowed"><span- className="h-4 w-4 shrink-0 rounded-[4px]"- style={{ backgroundColor: open ? currentColor : value || "transparent" }}- />- <span className="font-mono text-[11px] text-panel-text-0">- {open ? currentColor : value}+ className="relative h-3.5 w-3.5 shrink-0 overflow-hidden rounded-[3px] border border-panel-hairline"+ style={{ backgroundImage: 'conic-gradient(var(--color-transparency-light) 25%, var(--color-transparency-dark) 0 50%, var(--color-transparency-light) 0 75%, var(--color-transparency-dark) 0)', backgroundSize: '6px 6px' }}+ >+ <span className="absolute inset-0" style={{ backgroundColor: open ? currentColor : value || "transparent" }} />+ </span>+ <span className="min-w-0 truncate pl-1.5 pr-3 text-left tabular-nums">+ {displayHex.replace(/^#/, '')}+ </span>+ <span className="flex h-5 shrink-0 items-center gap-2 border-l border-panel-hairline pl-2 tabular-nums">+ <span className="min-w-[20px] text-right">{displayAlpha}</span>+ <span className="text-panel-text-4">%</span></span>{mixed && (<span@@ -523,7 +533,8 @@ export function ColorField({style={{ backgroundColor: value || "transparent" }}/><span className="min-w-0 flex-1 truncate text-[11px] font-medium text-neutral-100">- {value}+ {displayHex}+ {displayAlpha < 100 && <span className="ml-2 text-panel-text-4">{displayAlpha}%</span>}</span>{mixed && (<spandiff --git a/studio/src/components/editor/propertyPanelFlatPrimitives.tsx b/studio/src/components/editor/propertyPanelFlatPrimitives.tsxindex 15dcec3f..969b5f5a 100644--- a/studio/src/components/editor/propertyPanelFlatPrimitives.tsx+++ b/studio/src/components/editor/propertyPanelFlatPrimitives.tsx@@ -142,13 +142,14 @@ export function FlatSegmentedRow({type="button"data-flat-segment="true"aria-label={t(option.label)}+ title={typeof option.node === "string" ? undefined : t(option.label)}aria-pressed={option.active}disabled={disabled}onClick={() => {if (!option.active) track("segmented", label);onChange(option.key);}}- className={`px-1.5 py-1 text-[11px] transition-colors disabled:cursor-not-allowed ${+ className={`${filled ? "inline-flex h-7 w-7 shrink-0 items-center justify-center" : "px-1.5 py-1"} text-[11px] transition-colors disabled:cursor-not-allowed ${filled? `rounded-md ${option.active ? "bg-panel-bg-inset font-semibold text-panel-text-0" : "text-panel-text-4 hover:bg-panel-bg-inset hover:text-panel-text-2"}`: option.activediff --git a/studio/src/components/editor/propertyPanelFlatStyleSections.test.tsx b/studio/src/components/editor/propertyPanelFlatStyleSections.test.tsxindex fe7e0c36..a6e8c23b 100644--- a/studio/src/components/editor/propertyPanelFlatStyleSections.test.tsx+++ b/studio/src/components/editor/propertyPanelFlatStyleSections.test.tsx@@ -4,7 +4,7 @@ import { StudioHostContext } from "../../motion/StudioHost";import React, { act } from "react";import { createRoot } from "react-dom/client";import { afterEach, describe, expect, it, vi } from "vitest";-import { FlatStyleSection } from "./propertyPanelFlatStyleSections";+import { FlatOpacitySlider, FlatStyleSection } from "./propertyPanelFlatStyleSections";import type { DomEditSelection } from "./domEditing";import { buildDefaultGradientModel, serializeGradient } from "./gradientValue";@@ -669,3 +669,22 @@ describe("MVP solid fill", () => {act(() => root.unmount());});});+++it("edits overall opacity separately from an animated opacity value", () => {+ const host = document.createElement("div");+ document.body.append(host);+ const root = createRoot(host);+ const onSetStyle = vi.fn();+ act(() => root.render(<FlatOpacitySlider styles={{opacity: "0.99", filter: "blur(2px)"}}+ inlineStyles={{filter: "blur(2px)"}} preserveOpacityAnimation disabled={false} onSetStyle={onSetStyle} />));+ expect(host.textContent).toContain("100%");+ const track = host.querySelector('[data-flat-slider-track="true"]')!;+ Object.defineProperty(track, "getBoundingClientRect", {value: () => ({left: 0, width: 100})});+ act(() => {+ track.dispatchEvent(new MouseEvent("pointerdown", {bubbles: true, clientX: 47}));+ track.dispatchEvent(new MouseEvent("pointerup", {bubbles: true, clientX: 47}));+ });+ expect(onSetStyle).toHaveBeenCalledWith({"--hf-layer-opacity": "0.47", filter: "blur(2px) opacity(var(--hf-layer-opacity))"});+ act(() => root.unmount());+});diff --git a/studio/src/components/editor/propertyPanelFlatStyleSections.tsx b/studio/src/components/editor/propertyPanelFlatStyleSections.tsxindex ea1bbf0d..ac28666a 100644--- a/studio/src/components/editor/propertyPanelFlatStyleSections.tsx+++ b/studio/src/components/editor/propertyPanelFlatStyleSections.tsx@@ -1,3 +1,4 @@+import { LAYER_OPACITY_PROPERTY, layerOpacityStyles, layerOpacityValue } from "./layerOpacity";import { useMvpEditor } from "../../motion/StudioHost";import { useI18n } from "../../i18n/I18n";// fallow-ignore-file code-duplication@@ -435,17 +436,22 @@ function FlatOverflowMaskRows({/* Flat Opacity slider *//* ------------------------------------------------------------------ */-function FlatOpacitySlider({+export function FlatOpacitySlider({styles,+ inlineStyles = {},+ preserveOpacityAnimation = false,disabled,onSetStyle,}: {styles: Record<string, string>;+ inlineStyles?: Record<string, string>;+ preserveOpacityAnimation?: boolean;disabled: boolean;- onSetStyle: (prop: string, value: string) => void | Promise<unknown>;+ onSetStyle: (prop: string | Record<string, string>, value?: string) => void | Promise<unknown>;}) {const { t } = useI18n();- const opacityValue = Math.round((parseNumericValue(styles.opacity) ?? 1) * 100);+ const independent = preserveOpacityAnimation || LAYER_OPACITY_PROPERTY in inlineStyles;+ const opacityValue = Math.round((independent ? layerOpacityValue(inlineStyles) : parseNumericValue(styles.opacity) ?? 1) * 100);return (<FlatSlider@@ -456,12 +462,16 @@ function FlatOpacitySlider({tier="explicitCustom"displayValue={`${opacityValue}%`}disabled={disabled}- onCommit={(next) => void onSetStyle("opacity", formatNumericValue(next / 100))}+ onCommit={(next) => {+ if (independent) void onSetStyle(layerOpacityStyles(next / 100, inlineStyles, styles));+ else void onSetStyle("opacity", formatNumericValue(next / 100));+ }}/>);}export function FlatStyleSection({+ preserveOpacityAnimation = false,projectId,element,styles,@@ -472,6 +482,7 @@ export function FlatStyleSection({onImportAssets,gsapBorderRadius,}: {+ preserveOpacityAnimation?: boolean;projectId: string;element: DomEditSelection;styles: Record<string, string>;@@ -489,7 +500,7 @@ export function FlatStyleSection({<ColorField flat label={t("Fill color")} value={styles["background-color"] ?? "transparent"}disabled={styleEditingDisabled} onPreview={next => onPreviewStyle?.("background-color", next)}onCommit={next => onSetStyle({ "background-color": next, "background-image": "none" })} />- <FlatOpacitySlider styles={styles} disabled={styleEditingDisabled} onSetStyle={onSetStyle} />+ <FlatOpacitySlider styles={styles} inlineStyles={element.inlineStyles} preserveOpacityAnimation={preserveOpacityAnimation} disabled={styleEditingDisabled} onSetStyle={onSetStyle} /></div>;return (<div className="space-y-1.5">diff --git a/studio/src/components/editor/propertyPanelFlatTextSection.test.tsx b/studio/src/components/editor/propertyPanelFlatTextSection.test.tsxindex b9d9fe66..c3d3fa2c 100644--- a/studio/src/components/editor/propertyPanelFlatTextSection.test.tsx+++ b/studio/src/components/editor/propertyPanelFlatTextSection.test.tsx@@ -535,11 +535,11 @@ it("MVP keeps text, font, size, color and three alignments without changing adva</StudioHostContext.Provider>,);for (const label of ["Font", "Size", "Color"]) expect(host.textContent).toContain(label);- for (const label of ["Weight", "Case · Style", "Tracking", "Leading"]) expect(host.textContent).not.toContain(label);+ for (const label of ["Weight", "Case · Style", "Tracking", "Leading", "Add text field"]) expect(host.textContent).not.toContain(label);const align = segmentedRowButtons(host, "Align");expect(align).toHaveLength(3);expect(onSetTextFieldStyle).not.toHaveBeenCalled();- act(() => align.find(button => button.textContent === "C")!.click());+ act(() => align.find(button => button.getAttribute("aria-label") === "Align center")!.click());expect(onSetTextFieldStyle).toHaveBeenCalledWith("a", "text-align", "center");expect(JSON.stringify(element.textFields)).toBe(before);act(() => root.unmount());diff --git a/studio/src/components/editor/propertyPanelFlatTextSection.tsx b/studio/src/components/editor/propertyPanelFlatTextSection.tsxindex 66008192..8dcf5477 100644--- a/studio/src/components/editor/propertyPanelFlatTextSection.tsx+++ b/studio/src/components/editor/propertyPanelFlatTextSection.tsx@@ -177,8 +177,12 @@ function FlatTextFieldEditor({label={t("Align")}options={ALIGN_OPTIONS.filter(option => !mvp || option.key !== "justify").map((option) => ({key: option.key,- node: option.node,- label: option.label,+ node: mvp ? (+ <span className="flex h-4 w-4 items-center justify-center">+ <RemixIcon name={`align-${option.key}`} size={14} />+ </span>+ ) : option.node,+ label: mvp ? `Align ${option.key}` : option.label,active:align === option.key ||(option.key === "left" && align === "start") ||@@ -261,6 +265,7 @@ export function FlatTextSection({| "onRemoveTextField">) {const { t } = useI18n();+ const mvp = useMvpEditor();const track = useTrackDesignInput();const [activeFieldKey, setActiveFieldKey] = useState<string | null>(element.textFields[0]?.key ?? null,@@ -333,7 +338,7 @@ export function FlatTextSection({onSetTextFieldStyle={onSetTextFieldStyle}onPreviewTextFieldStyle={onPreviewTextFieldStyle}/>- <button+ {!mvp && <buttontype="button"onClick={() => {track("button", "Add text field");@@ -346,7 +351,7 @@ export function FlatTextSection({className="mt-0.5 flex items-center gap-[5px] text-[10px] text-panel-text-4 hover:text-panel-text-2"><Plus size={10} />- {t("Add text field")}</button>+ {t("Add text field")}</button>}</div>);}@@ -375,6 +380,7 @@ export function FlatTextLayerList({onRemove: (fieldKey: string) => void;}) {const { t } = useI18n();+ const mvp = useMvpEditor();const track = useTrackDesignInput();return (<div className="mb-2 border-l-2 border-panel-border-input py-0.5 pl-[10px]">@@ -422,7 +428,7 @@ export function FlatTextLayerList({);})}</div>- <button+ {!mvp && <buttontype="button"data-flat-text-layer-add="true"onClick={() => {@@ -432,7 +438,7 @@ export function FlatTextLayerList({className="mt-1 flex items-center gap-[5px] text-[10px] text-panel-text-4 hover:text-panel-text-2"><Plus size={10} />- {t("Add text field")}</button>+ {t("Add text field")}</button>}</div>);}diff --git a/studio/src/components/editor/propertyPanelSections.tsx b/studio/src/components/editor/propertyPanelSections.tsxindex aafa2c60..33e671f3 100644--- a/studio/src/components/editor/propertyPanelSections.tsx+++ b/studio/src/components/editor/propertyPanelSections.tsx@@ -142,18 +142,20 @@ export function TextAreaField({<div className={boxed? "rounded-md bg-panel-bg-inset px-3 py-2 focus-within:ring-1 focus-within:ring-panel-accent/30": "border-l-2 border-panel-border-input py-0.5 pl-[10px]"}>- <div className="mb-[3px] text-[9px] font-semibold uppercase tracking-[0.12em] text-panel-text-5">+ {!boxed && <div className="mb-[3px] text-[9px] font-semibold uppercase tracking-[0.12em] text-panel-text-5">{t(label)}- </div>+ </div>}<textarearef={textareaRef}value={draft}disabled={disabled}rows={2}+ aria-label={t(label)}+ style={boxed ? { outline: "none" } : undefined}onFocus={handleFocus}onChange={handleChange}onBlur={handleBlur}- className="field-sizing-content max-h-[40vh] min-h-12 w-full resize-y overflow-x-hidden overflow-y-auto bg-transparent font-mono text-[11px] leading-normal text-panel-text-0 outline-hidden disabled:cursor-not-allowed disabled:text-panel-text-4"+ className={`field-sizing-content max-h-[40vh] min-h-12 w-full ${boxed ? "resize-none" : "resize-y"} overflow-x-hidden overflow-y-auto bg-transparent font-mono text-[11px] leading-normal text-panel-text-0 outline-hidden disabled:cursor-not-allowed disabled:text-panel-text-4`}/></div>);diff --git a/studio/src/components/nle/AssetPreviewDialog.tsx b/studio/src/components/nle/AssetPreviewDialog.tsxnew file mode 100644index 00000000..78c02d12--- /dev/null+++ b/studio/src/components/nle/AssetPreviewDialog.tsx@@ -0,0 +1,88 @@+import { Dialog } from "@base-ui/react/dialog";+import { useEffect, useRef, useState, type CSSProperties } from "react";+import { useI18n } from "../../i18n/I18n";+import { RemixIcon } from "../../icons/RemixIcons";+import { IconButton, Tooltip } from "../ui";+import { VolumeControl } from "../../player/components/VolumeControl";+import { SpeedMenu } from "../../player/components/SpeedMenu";+import { formatTime } from "../../player/lib/time";+import { usePlayerStore } from "../../player/store/playerStore";++/** Independent media playback: never writes the composition's playhead or settings. */+export function AssetPreviewDialog({ url, kind, name, onClose }: {+ url: string; kind: "video" | "audio" | "image"; name: string; onClose: () => void;+}) {+ const { t } = useI18n();+ const [open, setOpen] = useState(true);+ return <Dialog.Root open={open} onOpenChange={setOpen} onOpenChangeComplete={next => { if (!next) onClose(); }}>+ <Dialog.Portal>+ <Dialog.Backdrop forceRender className="hf-overlay-backdrop fixed inset-0 z-140 bg-media-preview-scrim" />+ <Dialog.Popup aria-label={t("Preview: {name}", { name })} aria-describedby={undefined}+ className="fixed top-1/2 left-1/2 z-150 flex h-[min(600px,85dvh)] w-[min(800px,90vw)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-surface text-text-1 shadow-menu outline-none"+ onKeyDown={event => event.stopPropagation()}>+ <div className="flex shrink-0 items-center justify-between gap-3 px-3 py-2">+ <Dialog.Title className="min-w-0 truncate text-step-14 font-semibold" title={name}>{name}</Dialog.Title>+ <Dialog.Close render={<IconButton className="shrink-0" aria-label={t("Close preview")} icon={<RemixIcon name="close-line" size={16} />} />} />+ </div>+ <DialogMedia key={url} url={url} kind={kind} name={name} />+ </Dialog.Popup>+ </Dialog.Portal>+ </Dialog.Root>;+}++function DialogMedia({ url, kind, name }: { url: string; kind: "video" | "audio" | "image"; name: string }) {+ const { t } = useI18n();+ const media = useRef<HTMLMediaElement | null>(null);+ const [time, setTime] = useState(0);+ const [duration, setDuration] = useState(0);+ const [playing, setPlaying] = useState(false);+ const [failed, setFailed] = useState(false);+ const [volume, setVolume] = useState(() => usePlayerStore.getState().audioVolume);+ const [muted, setMuted] = useState(() => usePlayerStore.getState().audioMuted);+ const [rate, setRate] = useState(1);+ const [loop, setLoop] = useState(false);+ useEffect(() => {+ if (!media.current) return;+ media.current.volume = volume;+ media.current.muted = muted;+ media.current.playbackRate = rate;+ }, [volume, muted, rate]);+ const toggle = () => {+ if (!media.current) return;+ if (media.current.paused) void media.current.play().catch(() => setPlaying(false));+ else media.current.pause();+ };+ const events = {+ onLoadedMetadata: () => setDuration(Number.isFinite(media.current?.duration) ? media.current!.duration : 0),+ onTimeUpdate: () => setTime(media.current?.currentTime ?? 0),+ onPlay: () => setPlaying(true),+ onPause: () => setPlaying(false),+ onEnded: () => setPlaying(false),+ onError: () => setFailed(true),+ };+ return <>+ <div className="mx-3 flex min-h-0 flex-1 items-center justify-center overflow-hidden rounded-md bg-[var(--motion-inset)]">+ {failed ? <p role="alert" className="text-step-12 text-text-2">{t("Preview failed to load")}</p>+ : kind === "image" ? <img src={url} alt={name} onError={() => setFailed(true)} className="h-full w-full object-contain" />+ : kind === "video" ? <video ref={node => { media.current = node; }} src={url} autoPlay playsInline muted={muted} loop={loop} disablePictureInPicture aria-label={name} className="h-full w-full object-contain" {...events} />+ : <><RemixIcon name="music-2-line" size={48} /><audio ref={node => { media.current = node; }} src={url} autoPlay muted={muted} loop={loop} {...events} /></>}+ </div>+ {kind !== "image" ? <div className="motion-player-controls motion-player-responsive shrink-0 px-3 pb-2">+ <input type="range" min={0} max={duration} step="any" value={Math.min(time, duration)} disabled={!duration || failed}+ aria-label={t("Seek preview")} data-studio-control="seek-preview" className="w-full"+ style={{ "--preview-progress": `${duration ? time / duration * 100 : 0}%` } as CSSProperties}+ onChange={event => { if (media.current) { media.current.currentTime = event.currentTarget.valueAsNumber; setTime(media.current.currentTime); } }} />+ <div className="motion-player-control-row">+ <span className="whitespace-nowrap font-mono text-[11px] tabular-nums text-text-2">{formatTime(time)} / {formatTime(duration)}</span>+ <Tooltip label={t(playing ? "Pause" : "Play")}><button type="button" aria-label={t(playing ? "Pause" : "Play")} onClick={toggle} disabled={failed}+ className="flex h-7 w-8 items-center justify-center justify-self-center rounded-md hover:bg-hover disabled:opacity-30"><RemixIcon name={playing ? "pause-fill" : "play-fill"} size={20} /></button></Tooltip>+ <div className="motion-player-secondary flex min-w-0 items-center justify-self-end">+ <VolumeControl audioVolume={volume} audioMuted={muted} setAudioVolume={setVolume} setAudioMuted={setMuted} disabled={failed} />+ <SpeedMenu playbackRate={rate} setPlaybackRate={setRate} disabled={failed} />+ <Tooltip label={t(loop ? "Disable loop playback" : "Enable loop playback")}><button type="button" aria-label={t(loop ? "Disable loop playback" : "Enable loop playback")} aria-pressed={loop} onClick={() => setLoop(!loop)} disabled={failed}+ className="flex h-7 w-7 items-center justify-center rounded-md hover:bg-hover"><RemixIcon name="repeat-line" size={16} /></button></Tooltip>+ </div>+ </div>+ </div> : <div className="h-3 shrink-0" />}+ </>;+}diff --git a/studio/src/components/nle/AssetPreviewOverlay.test.tsx b/studio/src/components/nle/AssetPreviewOverlay.test.tsxindex b4859bfb..c65a6823 100644--- a/studio/src/components/nle/AssetPreviewOverlay.test.tsx+++ b/studio/src/components/nle/AssetPreviewOverlay.test.tsx@@ -2,7 +2,7 @@import React, { act } from "react";import { createRoot, type Root } from "react-dom/client";-import { afterEach, describe, expect, it } from "vitest";+import { afterEach, describe, expect, it, vi } from "vitest";import { usePlayerStore } from "../../player/store/playerStore";import { useAssetPreviewStore } from "../../utils/assetPreviewStore";import { AssetPreviewOverlay } from "./AssetPreviewOverlay";@@ -104,3 +104,27 @@ describe("AssetPreviewOverlay playback dismissal", () => {expect(useAssetPreviewStore.getState().previewAsset).toBeNull();});});+++describe("modal shared media preview", () => {+ it("pauses the composition, replaces sources, and returns without moving its playhead", async () => {+ const host = document.createElement("div");+ document.body.append(host);+ root = createRoot(host);+ usePlayerStore.setState({ currentTime: 2, isPlaying: true });+ const pause = vi.fn(() => usePlayerStore.getState().setIsPlaying(false));+ act(() => root!.render(<AssetPreviewOverlay modal onOpen={pause} />));+ act(() => useAssetPreviewStore.getState().setCatalogPreview({ title: "Caption", videoUrl: "/caption.mp4" }));+ expect(pause).toHaveBeenCalledOnce();+ expect(document.querySelector('[role="dialog"] video')?.getAttribute("src")).toBe("/caption.mp4");+ expect(document.querySelector('[role="dialog"] video')?.hasAttribute("controls")).toBe(false);+ expect(document.querySelector('[role="dialog"]')).not.toBeNull();+ act(() => useAssetPreviewStore.getState().setPreviewAsset("assets/photo.png", "p1"));+ expect(document.querySelector('[role="dialog"] video')).toBeNull();+ expect(document.querySelector('[role="dialog"] img')?.getAttribute("alt")).toBe("photo.png");+ act(() => document.querySelector<HTMLButtonElement>('[role="dialog"] button[aria-label="Close preview"]')!.click());+ await act(async () => { await new Promise(resolve => setTimeout(resolve, 0)); });+ expect(useAssetPreviewStore.getState().previewAsset).toBeNull();+ expect(usePlayerStore.getState().currentTime).toBe(2);+ });+});diff --git a/studio/src/components/nle/AssetPreviewOverlay.tsx b/studio/src/components/nle/AssetPreviewOverlay.tsxindex b3104e79..2cb7e9ae 100644--- a/studio/src/components/nle/AssetPreviewOverlay.tsx+++ b/studio/src/components/nle/AssetPreviewOverlay.tsx@@ -1,17 +1,11 @@+import { AssetPreviewDialog } from "./AssetPreviewDialog";import { RemixIcon } from "../../icons/RemixIcons";import { useI18n } from "../../i18n/I18n";/**- * CapCut-style asset preview overlay rendered inside PreviewPane.- *- * Shown when the user clicks an asset card that has NOT yet been added to the- * timeline. Displays the media (image / video / audio) as a compact floating- * card over the canvas — the canvas stays visible behind a barely-tinted- * click-catcher — without modifying the composition (no undo entry, no file- * mutation).- *- * Dismiss: X button, Escape key, click outside the card, or any playhead- * activity (starting playback / seeking) — the canvas refocuses.- * Switching to another not-added asset replaces the current preview.+ * Shared asset/catalog preview in an independent MVP dialog.+ * The composition remains mounted and pauses on entry; seeking its timeline+ * returns to it. Legacy callers retain the floating-card presentation.+ * Previewing never changes project source or adds a timeline clip.*/import { useEffect, useCallback } from "react";import { VIDEO_EXT, IMAGE_EXT } from "../../utils/mediaTypes";@@ -59,6 +53,7 @@ function AssetPreviewMedia({autoPlaymutedplaysInline+ aria-label={name}className="max-w-full max-h-[40vh] rounded-sm"/>);@@ -71,11 +66,13 @@ function AssetPreviewMedia({);}-export function AssetPreviewOverlay() {+export function AssetPreviewOverlay({ modal = false, onOpen }: { modal?: boolean; onOpen?: () => void }) {const { t } = useI18n();const previewAsset = useAssetPreviewStore((s) => s.previewAsset);const previewProjectId = useAssetPreviewStore((s) => s.previewProjectId);const clearPreviewAsset = useAssetPreviewStore((s) => s.clearPreviewAsset);+ const catalogPreview = useAssetPreviewStore((s) => s.catalogPreview);+ const previewKey = previewAsset ?? (modal ? catalogPreview : null);const handleKeyDown = useCallback((e: KeyboardEvent) => {@@ -85,17 +82,18 @@ export function AssetPreviewOverlay() {);useEffect(() => {- if (!previewAsset) return;+ if (!previewKey || modal) return;window.addEventListener("keydown", handleKeyDown);return () => window.removeEventListener("keydown", handleKeyDown);- }, [previewAsset, handleKeyDown]);+ }, [previewKey, handleKeyDown, modal]);// The canvas refocuses on any playhead activity: starting playback or a// seek/scrub away from where the playhead sat when the preview opened// dismisses it. openedTime is captured per preview open (previewAsset dep),// so a stale render can never dismiss against the wrong reference time.useEffect(() => {- if (!previewAsset) return;+ if (!previewKey) return;+ if (modal) onOpen?.();const opened = usePlayerStore.getState();const openedTime = opened.currentTime;// Level-triggered, not edge-triggered: a preview opened while playback is@@ -112,7 +110,16 @@ export function AssetPreviewOverlay() {return usePlayerStore.subscribe((state) => {if (shouldDismissAssetPreview(openedTime, state)) clearPreviewAsset();});- }, [previewAsset, clearPreviewAsset]);+ }, [previewKey, clearPreviewAsset, modal, onOpen]);++ if (modal && previewKey) {+ const name = catalogPreview?.title ?? basename(previewAsset!);+ const url = catalogPreview+ ? catalogPreview.videoUrl ?? catalogPreview.posterUrl+ : previewProjectId ? resolveMediaPreviewUrl(previewAsset!, previewProjectId) : undefined;+ const kind = catalogPreview ? (catalogPreview.videoUrl ? "video" : "image") : resolveAssetKind(previewAsset!);+ return url ? <AssetPreviewDialog url={url} kind={kind} name={name} onClose={clearPreviewAsset} /> : null;+ }if (!previewAsset || !previewProjectId) return null;diff --git a/studio/src/components/nle/PreviewEmptyState.test.tsx b/studio/src/components/nle/PreviewEmptyState.test.tsxnew file mode 100644index 00000000..9b51a20d--- /dev/null+++ b/studio/src/components/nle/PreviewEmptyState.test.tsx@@ -0,0 +1,20 @@+// @vitest-environment happy-dom+import { act } from 'react';+import { createRoot } from 'react-dom/client';+import { expect, it, vi } from 'vitest';+import { PreviewEmptyState } from './PreviewEmptyState';+import { PreviewReadOnlyProvider } from '../editor/previewReadOnlyContext';+const gateway = vi.hoisted(() => ({ importFiles: vi.fn() }));+vi.mock('../../motion/MediaGatewayContext', () => ({ useMediaGateway: () => gateway }));+globalThis.IS_REACT_ACT_ENVIRONMENT = true;+it('opens the existing importer, omits decorative media icons and respects write protection', () => {+ const host = document.createElement('div'); const root = createRoot(host);+ act(() => root.render(<PreviewEmptyState />));+ expect(host.textContent).toContain('Drop video, audio or images here');+ expect(host.querySelector('svg')).toBeNull();+ act(() => host.querySelector('button')!.click()); expect(gateway.importFiles).toHaveBeenCalledOnce();+ act(() => root.render(<PreviewReadOnlyProvider readOnly><PreviewEmptyState /></PreviewReadOnlyProvider>));+ expect(host.querySelector('button')!.disabled).toBe(true);+ act(() => host.querySelector('button')!.click()); expect(gateway.importFiles).toHaveBeenCalledOnce();+ act(() => root.unmount());+});diff --git a/studio/src/components/nle/PreviewEmptyState.tsx b/studio/src/components/nle/PreviewEmptyState.tsxnew file mode 100644index 00000000..e5cad9f0--- /dev/null+++ b/studio/src/components/nle/PreviewEmptyState.tsx@@ -0,0 +1,15 @@+import { useI18n } from "../../i18n/I18n";+import { useMediaGateway } from "../../motion/MediaGatewayContext";+import { usePreviewReadOnly } from "../editor/previewReadOnlyContext";++export function PreviewEmptyState() {+ const { t } = useI18n();+ const gateway = useMediaGateway();+ const readOnly = usePreviewReadOnly();+ return <div className="motion-preview-empty" data-preview-empty>+ <div className="motion-preview-empty-content">+ <p>{t("Drop video, audio or images here")}</p>+ {gateway && <button className="motion-button" disabled={readOnly} onClick={gateway.importFiles}>{t("Import files")}</button>}+ </div>+ </div>;+}diff --git a/studio/src/components/nle/PreviewPane.test.tsx b/studio/src/components/nle/PreviewPane.test.tsxindex 30b766ef..b225a19e 100644--- a/studio/src/components/nle/PreviewPane.test.tsx+++ b/studio/src/components/nle/PreviewPane.test.tsx@@ -9,8 +9,10 @@ import { StudioHostContext } from "../../motion/StudioHost";(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;vi.mock("../editor/PreviewGuides", () => ({ PreviewGuides: () => <i data-testid="guides" /> }));-vi.mock("../../player", () => ({ PlayerControls: () => null }));-vi.mock("./NLEPreview", () => ({ NLEPreview: () => null }));+const emptyState = vi.hoisted(() => ({ empty: false }));+vi.mock("./useEmptyPreview", () => ({ useEmptyPreview: () => emptyState.empty }));+vi.mock("../../player", () => ({ PlayerControls: () => <i data-testid="transport" /> }));+vi.mock("./NLEPreview", () => ({ NLEPreview: () => <i data-testid="preview" /> }));vi.mock("./CompositionBreadcrumb", () => ({ CompositionBreadcrumb: () => <nav data-testid="breadcrumb" /> }));vi.mock("./AssetPreviewOverlay", () => ({ AssetPreviewOverlay: () => null }));vi.mock("./usePreviewBlockDrop", () => ({@@ -58,8 +60,27 @@ it("omits duplicate preview navigation only in the MVP", () => {const root = createRoot(host);act(() => root.render(<PreviewPane />));expect(host.querySelector('[data-testid="breadcrumb"]')).not.toBeNull();+ expect(host.querySelector('[data-studio-fullscreen-target]')).not.toBeNull();act(() => root.render(<StudioHostContext.Provider value={{ mvpEditor: true }}><PreviewPane /></StudioHostContext.Provider>));expect(host.querySelector('[data-testid="breadcrumb"]')).toBeNull();+ expect(host.querySelector('[data-studio-fullscreen-target]')).toBeNull();expect(host.querySelector('[data-testid="guides"]')).not.toBeNull();act(() => root.unmount());});++it("hides placeholder transport while empty and restores controls when content arrives without unmounting preview", () => {+ const host = document.createElement("div"); const root = createRoot(host);+ const render = () => act(() => root.render(<StudioHostContext.Provider value={{ mvpEditor: true }}><PreviewPane /></StudioHostContext.Provider>));+ emptyState.empty = false; render();+ const preview = host.querySelector('[data-testid="preview"]');+ expect(host.querySelector('[data-testid="transport"]')).not.toBeNull();+ emptyState.empty = true; render();+ expect(host.querySelector('[data-preview-empty]')).not.toBeNull();+ expect(host.querySelector('[data-testid="transport"]')).toBeNull();+ expect(host.querySelector('[data-testid="preview"]')).toBe(preview);+ emptyState.empty = false; render();+ expect(host.querySelector('[data-preview-empty]')).toBeNull();+ expect(host.querySelector('[data-testid="transport"]')).not.toBeNull();+ expect(host.querySelector('[data-testid="preview"]')).toBe(preview);+ act(() => root.unmount());+});diff --git a/studio/src/components/nle/PreviewPane.tsx b/studio/src/components/nle/PreviewPane.tsxindex db826dba..759fb36b 100644--- a/studio/src/components/nle/PreviewPane.tsx+++ b/studio/src/components/nle/PreviewPane.tsx@@ -3,6 +3,8 @@ import { PlayerControls } from "../../player";import { useMvpEditor } from "../../motion/StudioHost";import type { TimelineElement } from "../../player";import { useDockHeaderSlot } from "../dock/DockHeaderSlots";+import { PreviewEmptyState } from "./PreviewEmptyState";+import { useEmptyPreview } from "./useEmptyPreview";import { NLEPreview } from "./NLEPreview";import { CompositionBreadcrumb } from "./CompositionBreadcrumb";import { usePreviewBlockDrop } from "./usePreviewBlockDrop";@@ -63,6 +65,7 @@ export function PreviewPane({projectId,iframeRef,togglePlay,+ pause,seek,onIframeLoad,previewSlots,@@ -75,6 +78,7 @@ export function PreviewPane({handleNavigateComposition,setCompositionLoading,timelineDisabled,+ compositionLoading,hasLoadedOnceRef,previewCompositionSize,setPreviewCompositionSize,@@ -115,19 +119,20 @@ export function PreviewPane({const currentLevel = compositionStack[compositionStack.length - 1];const directUrl = compositionStack.length > 1 ? currentLevel.previewUrl : undefined;+ const empty = useEmptyPreview(projectId, mvp && !compositionLoading && compositionStack.length === 1);return (<divref={containerRef}- // MVP keeps the inset spacing without a second frame inside the dock panel.+ // MVP insets only the canvas; the transport background reaches the panel edges.// Fullscreen removes the inset so the preview fills the screen.- className={`scheme-dark flex-1 min-h-0 flex flex-col overflow-hidden bg-[var(--studio-preview-bg,var(--color-neutral-950))] ${- isFullscreen ? "" : mvp ? "m-3" : "m-3 rounded-md border border-border"+ className={`relative scheme-dark flex-1 min-h-0 flex flex-col overflow-hidden ${mvp ? "bg-transparent" : "bg-[var(--studio-preview-bg,var(--color-neutral-950))]"} ${+ isFullscreen ? "" : mvp ? (empty ? "my-3" : "mt-3") : "m-3 rounded-md border border-border"}`}- data-studio-fullscreen-target=""+ data-studio-fullscreen-target={mvp ? undefined : ""}><div- className="flex-1 min-h-0 relative overflow-hidden"+ className={`flex-1 min-h-0 relative overflow-hidden ${mvp && !isFullscreen ? "mx-3" : ""}`}data-preview-pan-surface="true"onPointerDown={(e) =>deselectIfPointerOutsideFrame(e, iframeRef.current, onSelectTimelineElement)@@ -159,16 +164,16 @@ export function PreviewPane({{previewDragOver && (<div className="absolute inset-2 z-40 rounded-lg border-2 border-dashed border-studio-accent/50 bg-studio-accent/4 pointer-events-none" />)}- <AssetPreviewOverlay />+ {!mvp && <AssetPreviewOverlay />}</div>- <PreviewOverlayProvider>+ {!empty && <PreviewOverlayProvider><PreviewGuides />{!isFullscreen && previewOverlay}- </PreviewOverlayProvider>+ </PreviewOverlayProvider>}+ {empty && <PreviewEmptyState />}</div>- {/* Transport row: no own background or border — the controls sit flat on- the preview panel's surface (CapCut-style). */}- <div className="shrink-0" data-preview-transport="">+ {/* The MVP transport fills both side edges and the bottom inset. */}+ {!empty && <div data-preview-transport="" className={`shrink-0 ${mvp ? "bg-[var(--studio-preview-bg,var(--color-neutral-950))] py-1.5" : ""}`}>{!mvp && !isFullscreen && compositionStack.length > 1 && (<CompositionBreadcrumb stack={compositionStack} onNavigate={handleNavigateComposition} />)}@@ -177,9 +182,11 @@ export function PreviewPane({onSeek={seek}disabled={timelineDisabled}isFullscreen={isFullscreen}- onToggleFullscreen={toggleFullscreen}+ onToggleFullscreen={mvp ? undefined : toggleFullscreen}/></div>+ }+ {mvp && <AssetPreviewOverlay modal onOpen={pause} />}</div>);}diff --git a/studio/src/components/nle/PreviewZoomOverlay.tsx b/studio/src/components/nle/PreviewZoomOverlay.tsxindex 84f16650..469b6266 100644--- a/studio/src/components/nle/PreviewZoomOverlay.tsx+++ b/studio/src/components/nle/PreviewZoomOverlay.tsx@@ -81,7 +81,7 @@ export function PreviewZoomOverlay({data-testid="preview-zoom-chip"onPointerDown={(event) => event.stopPropagation()}>- <span className="tabular-nums">{controlsTarget ? `${Math.round(zoom.zoomPercent)}%` : !atFit && isFitZoom(zoom.zoomPercent) ? t("Panned") : t("Zoomed {percent}%", { percent: Math.round(zoom.zoomPercent) })}</span>+ <span className={controlsTarget ? "tabular-nums text-[11px]" : "tabular-nums"}>{controlsTarget ? `${Math.round(zoom.zoomPercent)}%` : !atFit && isFitZoom(zoom.zoomPercent) ? t("Panned") : t("Zoomed {percent}%", { percent: Math.round(zoom.zoomPercent) })}</span>{!atFit && <buttontype="button"className={controlsTargetdiff --git a/studio/src/components/nle/useEmptyPreview.test.tsx b/studio/src/components/nle/useEmptyPreview.test.tsxnew file mode 100644index 00000000..4a1ce6a9--- /dev/null+++ b/studio/src/components/nle/useEmptyPreview.test.tsx@@ -0,0 +1,35 @@+// @vitest-environment happy-dom+import { act } from 'react';+import { createRoot } from 'react-dom/client';+import { afterEach, expect, it } from 'vitest';+import { isEmptyPreviewDocument, useEmptyPreview } from './useEmptyPreview';+import { usePlayerStore } from '../../player/store/playerStore';+import { usePreviewIframeStore } from '../../player/store/previewIframeStore';+globalThis.IS_REACT_ACT_ENVIRONMENT = true;+afterEach(() => { usePlayerStore.getState().reset(); usePreviewIframeStore.getState().setIframe(null); document.body.replaceChildren(); });+it('recognizes blank roots without hiding static content, media or unloaded previews', () => {+ const doc = new DOMParser().parseFromString('<body><div data-composition-id="main"></div><script>init()</script></body>', 'text/html');+ expect(isEmptyPreviewDocument(doc)).toBe(true);+ const root = doc.querySelector('div')!;+ for (const content of ['Hello', '<h1>Title</h1>', '<img src="a.png">', '<audio src="a.wav"></audio>', '<canvas></canvas>']) {+ root.innerHTML = content;+ expect(isEmptyPreviewDocument(doc)).toBe(false);+ }+ expect(isEmptyPreviewDocument(null)).toBe(false);+ expect(isEmptyPreviewDocument(new DOMParser().parseFromString('<body>Loading</body>', 'text/html'))).toBe(false);+});+it('only enables empty UI for a loaded matching session and updates after content insertion', async () => {+ const iframe = document.createElement('iframe'); document.body.append(iframe);+ iframe.contentDocument!.body.innerHTML = '<div data-composition-id="main"></div>';+ usePreviewIframeStore.getState().setIframe(iframe);+ usePlayerStore.setState({ timelineReady: false, timelineProjectId: 'p', elements: [] });+ const host = document.createElement('div'); document.body.append(host); const root = createRoot(host);+ function Harness({ enabled = true, project = 'p' }) { return <span>{String(useEmptyPreview(project, enabled))}</span>; }+ await act(async () => root.render(<Harness />)); expect(host.textContent).toBe('false');+ await act(async () => usePlayerStore.setState({ timelineReady: true })); expect(host.textContent).toBe('true');+ await act(async () => { iframe.contentDocument!.querySelector('div')!.textContent = 'Static title'; }); expect(host.textContent).toBe('false');+ await act(async () => { iframe.contentDocument!.querySelector('div')!.textContent = ''; }); expect(host.textContent).toBe('true');+ await act(async () => root.render(<Harness enabled={false} />)); expect(host.textContent).toBe('false');+ await act(async () => root.render(<Harness project="other" />)); expect(host.textContent).toBe('false');+ act(() => root.unmount());+});diff --git a/studio/src/components/nle/useEmptyPreview.ts b/studio/src/components/nle/useEmptyPreview.tsnew file mode 100644index 00000000..09de3fb9--- /dev/null+++ b/studio/src/components/nle/useEmptyPreview.ts@@ -0,0 +1,44 @@+import { useEffect, useState } from "react";+import { usePlayerStore } from "../../player/store/playerStore";+import { useLivePreviewIframe } from "../../player/store/previewIframeStore";++/** No tracks alone is insufficient: static text and artwork are real content. */+export function isEmptyPreviewDocument(doc: Document | null): boolean {+ const composition = doc?.querySelector("[data-composition-id]");+ if (!composition) return false;+ const hasContent = (nodes: NodeListOf<ChildNode>) => Array.from(nodes).some(node =>+ node.nodeType === 3 ? !!node.textContent?.trim() :+ node.nodeType === 1 && !["SCRIPT", "STYLE", "LINK", "META"].includes((node as Element).tagName),+ );+ if (hasContent(composition.childNodes)) return false;+ return !Array.from(doc!.body.children).some(node =>+ node !== composition && !node.contains(composition) && !["SCRIPT", "STYLE", "LINK", "META"].includes(node.tagName),+ );+}++export function useEmptyPreview(projectId: string, enabled: boolean): boolean {+ const iframe = useLivePreviewIframe();+ const ready = usePlayerStore(s => s.timelineReady && s.timelineProjectId === projectId);+ const trackCount = usePlayerStore(s => s.elements.length);+ const [emptyDocument, setEmptyDocument] = useState(false);+ useEffect(() => {+ setEmptyDocument(false);+ if (!enabled || !ready || trackCount || !iframe) return;+ let observer: MutationObserver | undefined;+ const inspect = () => {+ observer?.disconnect();+ try {+ const doc = iframe.contentDocument;+ setEmptyDocument(isEmptyPreviewDocument(doc));+ if (doc?.body) {+ observer = new MutationObserver(() => setEmptyDocument(isEmptyPreviewDocument(doc)));+ observer.observe(doc.body, { childList: true, subtree: true, characterData: true });+ }+ } catch { setEmptyDocument(false); }+ };+ inspect();+ iframe.addEventListener("load", inspect);+ return () => { observer?.disconnect(); iframe.removeEventListener("load", inspect); };+ }, [iframe, enabled, ready, trackCount]);+ return enabled && ready && trackCount === 0 && emptyDocument;+}diff --git a/studio/src/components/renders/ExportDialog.tsx b/studio/src/components/renders/ExportDialog.tsxnew file mode 100644index 00000000..156bd2b1--- /dev/null+++ b/studio/src/components/renders/ExportDialog.tsx@@ -0,0 +1,31 @@+import { Popover } from "@base-ui/react/popover";+import type { RefObject } from "react";+import { useI18n } from "../../i18n/I18n";+import { RemixIcon } from "../../icons/RemixIcons";+import { IconButton } from "../ui/IconButton";+import { RenderQueuePanel } from "./RenderQueuePanel";++/** Export settings and history share the native queue; closing does not cancel jobs. */+export function ExportDialog({ open, onOpenChange, triggerRef }: {+ open: boolean;+ onOpenChange: (open: boolean) => void;+ triggerRef: RefObject<HTMLButtonElement | null>;+}) {+ const { t } = useI18n();+ return <Popover.Root modal open={open} onOpenChange={onOpenChange}>+ <Popover.Portal>+ <Popover.Backdrop className="fixed inset-0 z-140" />+ <Popover.Positioner anchor={triggerRef} side="bottom" align="end" sideOffset={8} collisionPadding={12}+ collisionAvoidance={{ side: "none", align: "shift" }} positionMethod="fixed" className="z-150">+ <Popover.Popup data-testid="export-dialog" finalFocus={triggerRef} aria-describedby={undefined}+ className="hf-floating-motion flex max-h-[var(--available-height)] w-[min(320px,calc(100vw-24px))] flex-col overflow-hidden rounded-xl border border-border bg-surface text-text-1 shadow-menu outline-none">+ <div className="flex shrink-0 items-center justify-between px-3 py-2">+ <Popover.Title className="text-step-14 font-semibold">{t("Export")}</Popover.Title>+ <Popover.Close render={<IconButton aria-label={t("Close")} icon={<RemixIcon name="close-line" size={16} />} />} />+ </div>+ <div className="flex min-h-0 flex-col overflow-y-auto"><RenderQueuePanel /></div>+ </Popover.Popup>+ </Popover.Positioner>+ </Popover.Portal>+ </Popover.Root>;+}diff --git a/studio/src/components/renders/RenderQueue.test.tsx b/studio/src/components/renders/RenderQueue.test.tsxindex 1e5d6ed3..4159fc00 100644--- a/studio/src/components/renders/RenderQueue.test.tsx+++ b/studio/src/components/renders/RenderQueue.test.tsx@@ -40,6 +40,7 @@ function mountRenderQueue(compositionDimensions = { width: 1920, height: 1080 },mvpEditor = false,jobs: RenderJob[] = [],+ emptyComposition = false,) {const host = document.createElement("div");document.body.append(host);@@ -48,6 +49,7 @@ function mountRenderQueue(root?.render(<StudioHostContext.Provider value={{ mvpEditor }}><RenderQueuejobs={jobs}+ emptyComposition={emptyComposition}projectId="demo"onDelete={vi.fn()}onClearCompleted={vi.fn()}@@ -149,9 +151,9 @@ describe("RenderQueue controls", () => {expect(onStartRender).toHaveBeenCalledWith("mp4", "standard", "landscape-4k", 30, false);});- it("refuses a resolution the composition cannot reach, and says why", async () => {+ it("keeps unavailable resolutions disabled with a concise label", async () => {// 1080p on a 1280x720 comp is a 1.5x scale, which the producer rejects; the- // option stays listed (its label explains why) but the keyboard skips it.+ // option stays listed with its dimensions, but the keyboard skips it.const onStartRender: Mock<StartRenderHandler> = vi.fn();const host = mountRenderQueue(onStartRender, { width: 1280, height: 720 });const trigger = triggerFor(host, "Resolution");@@ -164,7 +166,7 @@ describe("RenderQueue controls", () => {option.hasAttribute("data-disabled"),);expect(blocked).toHaveLength(1);- expect(blocked[0]?.textContent).toContain("not an integer scale of 1280×720");+ expect(blocked[0]?.textContent).toBe("1080p · 1920×1080");fire(document.activeElement ?? document.body, "keydown", "ArrowDown");await settle();@@ -357,15 +359,31 @@ describe("GIF frame-rate controls", () => {});});-it("MVP exports keep quality and frame rate while ignoring hidden GIF/GPU preferences", async () => {+it("MVP offers native GIF and a disabled WebP placeholder", async () => {+ const host = mountRenderQueue(vi.fn(), undefined, true);+ act(() => triggerFor(host, "Format").click());+ await settle();+ const options = Array.from(document.querySelectorAll('[role="option"]'));+ const gif = options.find(option => option.textContent === "GIF");+ const webp = options.find(option => option.textContent?.startsWith("WebP"));+ expect(webp?.textContent).toBe("WebP");+ expect(options.some(option => option.textContent === "MOV")).toBe(true);+ expect(gif).toBeDefined();+ expect(gif?.getAttribute("aria-disabled")).not.toBe("true");+ expect(webp?.getAttribute("aria-disabled")).toBe("true");+});++it("MVP restores GIF preferences with the native frame-rate cap and ignores hidden GPU preferences", async () => {localStorage.setItem("hf-studio-render-settings", JSON.stringify({ format: "gif", gpu: true, quality: "high", fps: 60 }));const start = vi.fn();const host = mountRenderQueue(start, undefined, true);- expect(triggerFor(host, "Format").textContent).toContain("MP4");+ expect(triggerFor(host, "Format").textContent).toContain("GIF");+ expect(triggerFor(host, "Frame rate").textContent).toContain("30 fps");+ expect(host.querySelector<HTMLInputElement>('input[type="number"]')?.value).toBe("0");expect(host.textContent).not.toContain("GPU");fire(exportButtonIn(host), "click");await settle();- expect(start).toHaveBeenCalledWith("mp4", "high", "auto", 60, false);+ expect(start).toHaveBeenCalledWith("gif", "high", "auto", 30, false, 0);});@@ -386,3 +404,13 @@ describe("RenderQueue history", () => {expect(jobs.map((job) => job.id)).toEqual(["older", "newest", "middle"]);});});++ it("blocks an empty MVP export without starting a job", () => {+ const start = vi.fn<StartRenderHandler>();+ const host = mountRenderQueue(start, undefined, true, [], true);+ const button = exportButtonIn(host);+ expect(button.disabled).toBe(true);+ expect(host.textContent).toContain("No content to export. Add media first.");+ act(() => button.click());+ expect(start).not.toHaveBeenCalled();+});diff --git a/studio/src/components/renders/RenderQueue.tsx b/studio/src/components/renders/RenderQueue.tsxindex 2d7c4283..fe6ee3bf 100644--- a/studio/src/components/renders/RenderQueue.tsx+++ b/studio/src/components/renders/RenderQueue.tsx@@ -1,3 +1,4 @@+import { ErrorNotice } from "../ui/ErrorNotice";import { RemixIcon } from "../../icons/RemixIcons";import { useMvpEditor } from "../../motion/StudioHost";import { useI18n, type Translate } from "../../i18n/I18n";@@ -50,6 +51,7 @@ export interface RenderQueueProps {onClearCompleted: () => void;onStartRender: StartRenderHandler;isRendering: boolean;+ emptyComposition?: boolean;/** History fetch failure (null when the last load succeeded). */loadError?: string | null;/** Retry a failed history load. */@@ -139,16 +141,13 @@ function scaleOptionLabel(scale: RenderScale,dims: CompositionDimensions | null | undefined,t: Translate,+ mvp = false,): string {const resolved = resolvedDimensions(scale, dims);+ if (mvp && scale === "auto" && resolved) return `${resolved.width}×${resolved.height}`;const base = resolved? `${t(SCALE_LABEL[scale])} · ${resolved.width}×${resolved.height}`: t(SCALE_LABEL[scale]);- // Explain *why* an option is disabled instead of greying it silently:- // the preset must be an exact integer upscale of the authored size.- if (dims && !scaleApplies(scale, dims)) {- return t("{base} (not an integer scale of {width}×{height})", { base, width: dims.width, height: dims.height });- }return base;}@@ -162,7 +161,7 @@ const FORMAT_PANEL_SIZE = { width: 264, height: 176 };// for the one-line ui/Tooltip primitive, so this stays a local popover.// It renders in a portal because the right panel is overflow-hidden: an// in-flow absolute panel gets clipped at the panel edge.-function FormatInfoTooltip({ mvp }: { mvp: boolean }) {+function FormatInfoTooltip() {const { t } = useI18n();const [open, setOpen] = useState(false);const [position, setPosition] = useState<FloatingPosition | null>(null);@@ -230,10 +229,9 @@ function FormatInfoTooltip({ mvp }: { mvp: boolean }) {style={{ left: position?.left ?? -9999, top: position?.top ?? -9999 }}>{(["mp4", "mov", "webm", "gif"] as const)- .filter((f) => !mvp || f !== "gif").map((f) => (<p key={f} className="text-text-3">- <span className="text-text-1 font-semibold">{f === "webm" ? "WebM" : f.toUpperCase()}</span>+ <span className="text-text-1 font-semibold">{f === "webm" ? "WebM" : f === "mov" ? "MOV · ProRes" : f.toUpperCase()}</span>{" · "}{t(FORMAT_INFO[f].desc)}</p>))}@@ -260,6 +258,7 @@ const QUALITY_OPTIONS: SelectOption[] = [function FormatExportButton({onStartRender,isRendering,+ emptyComposition = false,compositionDimensions,lastRenderDurationMs,ffmpeg,@@ -268,6 +267,7 @@ function FormatExportButton({}: {onStartRender: StartRenderHandler;isRendering: boolean;+ emptyComposition?: boolean;compositionDimensions?: CompositionDimensions | null;lastRenderDurationMs?: number;ffmpeg: FfmpegStatus | null;@@ -277,7 +277,7 @@ function FormatExportButton({const { t } = useI18n();const persisted = getPersistedRenderSettings();const mvp = useMvpEditor();- const [format, setFormat] = useState<"mp4" | "webm" | "mov" | "gif">(mvp && persisted.format === "gif" ? "mp4" : persisted.format);+ const [format, setFormat] = useState<"mp4" | "webm" | "mov" | "gif">(persisted.format);const [quality, setQuality] = useState<"draft" | "standard" | "high">(persisted.quality);const [resolution, setResolution] = useState<RenderScale>("auto");const [requestedFps, setFps] = useState<24 | 30 | 60>(persisted.fps);@@ -292,7 +292,7 @@ function FormatExportButton({// setups that are perfectly fine. Holding the narrowed value rather than a// boolean keeps the notice from re-testing what this line already decided.const missingFfmpeg = ffmpeg && !ffmpeg.ok ? ffmpeg : null;- const exportBlocked = isRenderExportBlocked(isRendering, missingFfmpeg !== null, invalidGifLoop);+ const exportBlocked = emptyComposition || isRenderExportBlocked(isRendering, missingFfmpeg !== null, invalidGifLoop);// MOV (ProRes) is a fixed-quality codec — quality selector has no effect.const showQuality = format !== "mov";@@ -310,12 +310,12 @@ function FormatExportButton({<div className="flex flex-col gap-1"><div className="flex items-center gap-1"><span className="text-step-10 text-text-4">{t("Format")}</span>- <FormatInfoTooltip mvp={mvp} />+ <FormatInfoTooltip /></div><Selectlabel={t("Format")}value={format}- options={mvp ? FORMAT_OPTIONS.filter(option => option.value !== "gif") : FORMAT_OPTIONS}+ options={mvp ? [...FORMAT_OPTIONS.map(option => option.value === "mov" ? { ...option, label: "MOV" } : option), { value: "webp", label: "WebP", disabled: true }] : FORMAT_OPTIONS}disabled={isRendering}onCommit={(next) => {const v = resolveRenderFormat(next);@@ -331,7 +331,7 @@ function FormatExportButton({value={resolution}options={SCALE_OPTION_ORDER.map((value) => ({value,- label: scaleOptionLabel(value, compositionDimensions, t),+ label: scaleOptionLabel(value, compositionDimensions, t, mvp),disabled: !scaleApplies(value, compositionDimensions),}))}disabled={isRendering}@@ -416,6 +416,7 @@ function FormatExportButton({>{isRendering ? t("Rendering…") : t("Export")}</Button>+ {emptyComposition && <p className="text-step-10 text-text-5 text-center">{t("No content to export. Add media first.")}</p>}{!mvp && <RenderDurationNote durationMs={lastRenderDurationMs} isRendering={isRendering} />}</div>);@@ -429,6 +430,7 @@ export const RenderQueue = memo(function RenderQueue({onClearCompleted,onStartRender,isRendering,+ emptyComposition = false,loadError,onRetryLoad,actionError,@@ -458,9 +460,10 @@ export const RenderQueue = memo(function RenderQueue({.find((j) => j.status === "complete" && j.durationMs !== undefined)?.durationMs;return (- <div className="flex flex-col h-full">- <div className="px-3 py-3 border-b border-border shrink-0">+ <div className={mvp ? "flex min-h-0 flex-col" : "flex flex-col h-full"}>+ <div className={`px-3 pb-3 border-b border-border shrink-0 ${mvp ? "pt-1" : "pt-3"}`}><FormatExportButton+ emptyComposition={emptyComposition}onStartRender={onStartRender}isRendering={isRendering}compositionDimensions={compositionDimensions}@@ -471,38 +474,16 @@ export const RenderQueue = memo(function RenderQueue({/></div>- {actionError && (- <div- role="alert"- className="flex items-start justify-between gap-2 px-3 py-2 border-b border-border bg-danger/10"- >- <span className="text-step-10 text-danger-ink">{t(actionError)}</span>- {onDismissActionError && (- <IconButton- size="sm"- onClick={onDismissActionError}- aria-label={t("Dismiss error")}- className="shrink-0"- icon={- <RemixIcon name="close-line" size={14} />- }- />- )}- </div>- )}+ {actionError && <ErrorNotice key={actionError} message={actionError} onDismiss={onDismissActionError} />}{/* Job list */}- <div ref={listRef} className="flex-1 overflow-y-auto">+ {/* MVP history fits its content up to the count header and about 3.5 standard rows. */}+ <div ref={listRef} className={mvp ? "min-h-0 max-h-[259px] overflow-y-auto" : "flex-1 overflow-y-auto"}>{loadError && jobs.length === 0 ? (- <div className="flex flex-col items-center justify-center h-full px-4 gap-2" role="alert">- <p className="text-step-10 text-danger-ink text-center">{loadError}</p>- {onRetryLoad && (- <Button size="sm" variant="secondary" onClick={onRetryLoad}>- {t("Retry")}</Button>- )}- </div>+ <ErrorNotice key={loadError} message={loadError}+ action={onRetryLoad ? { label: 'Retry', run: onRetryLoad } : undefined} />) : jobs.length === 0 ? (- <div className="flex flex-col items-center justify-center h-full px-4 gap-2">+ <div className={`flex flex-col items-center justify-center px-4 gap-2 ${mvp ? "py-6" : "h-full"}`}><RemixIcon name="film-line" size={24} className="text-text-5" /><p className="text-step-10 text-text-5 text-center">{t("No renders yet")}</p></div>@@ -511,7 +492,7 @@ export const RenderQueue = memo(function RenderQueue({{completedCount > 0 && (<div className="flex items-center justify-between px-3 py-1.5"><span className="text-step-10 text-text-4">- {t("{count} renders", { count: jobs.length })}+ {mvp ? `${t("Export")} ${jobs.length}` : t("{count} renders", { count: jobs.length })}</span>{/* "Hide", not "Clear": files stay on disk (delete is per-rowand confirmed); hidden rows don't resurrect on reload. */}diff --git a/studio/src/components/renders/RenderQueueInfo.tsx b/studio/src/components/renders/RenderQueueInfo.tsxindex f025bf39..aa36e37e 100644--- a/studio/src/components/renders/RenderQueueInfo.tsx+++ b/studio/src/components/renders/RenderQueueInfo.tsx@@ -1,10 +1,13 @@import { useI18n } from "../../i18n/I18n";import type { RenderJob } from "./useRenderQueue";-function formatDuration(ms: number): string {- if (ms < 1000) return `${ms}ms`;- const s = Math.round(ms / 1000);- return s < 60 ? `${s}s` : `${Math.floor(s / 60)}m ${s % 60}s`;+function formatDuration(ms: number, locale: string): string {+ const unit = (value: number, unit: string) => new Intl.NumberFormat(locale, {+ style: 'unit', unit, unitDisplay: 'short', maximumFractionDigits: 0,+ }).format(value);+ if (ms < 1000) return unit(ms, 'millisecond');+ const seconds = Math.round(ms / 1000);+ return seconds < 60 ? unit(seconds, 'second') : `${unit(Math.floor(seconds / 60), 'minute')} ${unit(seconds % 60, 'second')}`;}function formatTimeAgo(timestamp: number, locale: string): string {@@ -46,9 +49,6 @@ export function RenderQueueInfo({ job }: { job: RenderJob }) {</div>)}- {job.status === "failed" && job.error && (- <span className="text-step-9 text-danger-ink mt-0.5 block">{job.error}</span>- )}{job.status === "cancelled" && (<span className="text-step-9 text-text-4 mt-0.5 block">{t("Cancelled")}</span>)}@@ -58,7 +58,7 @@ export function RenderQueueInfo({ job }: { job: RenderJob }) {<span>{formatTimeAgo(job.createdAt, locale)}</span>{job.status === "complete" && job.durationMs !== undefined && (<span className="whitespace-nowrap">- · {t("Took {value0}", { value0: formatDuration(job.durationMs) })}+ · {t("Took {value0}", { value0: formatDuration(job.durationMs, locale) })}</span>)}</div>diff --git a/studio/src/components/renders/RenderQueueItem.tsx b/studio/src/components/renders/RenderQueueItem.tsxindex 94199c5a..7be39d22 100644--- a/studio/src/components/renders/RenderQueueItem.tsx+++ b/studio/src/components/renders/RenderQueueItem.tsx@@ -7,6 +7,7 @@ import { RenderPreview } from "./RenderPreview";import { Button } from "../ui/Button";import { IconButton } from "../ui/IconButton";import { Tooltip } from "../ui/Tooltip";+import { ErrorNotice } from "../ui/ErrorNotice";import type { RenderJob } from "./useRenderQueue";interface RenderQueueItemProps {@@ -170,6 +171,7 @@ export const RenderQueueItem = memo(function RenderQueueItem({)}</div></div>+ {job.status === "failed" && job.error && <div className="mt-2"><ErrorNotice key={job.error} message={job.error} context="export" compact /></div>}</div>);});diff --git a/studio/src/components/renders/RenderQueuePanel.tsx b/studio/src/components/renders/RenderQueuePanel.tsxindex 6e9c1b6a..4aca6dff 100644--- a/studio/src/components/renders/RenderQueuePanel.tsx+++ b/studio/src/components/renders/RenderQueuePanel.tsx@@ -57,6 +57,7 @@ export const RenderQueuePanel = memo(function RenderQueuePanel() {}}compositionDimensions={compositionDimensions}isRendering={renderQueue.isRendering}+ emptyComposition={renderQueue.emptyComposition}/></div></div>diff --git a/studio/src/components/renders/useRenderQueue.ts b/studio/src/components/renders/useRenderQueue.tsindex 7d500938..6d8ce9c9 100644--- a/studio/src/components/renders/useRenderQueue.ts+++ b/studio/src/components/renders/useRenderQueue.ts@@ -1,3 +1,5 @@+import { useEmptyPreview } from "../nle/useEmptyPreview";+import { useMvpEditor } from "../../motion/StudioHost";import { buildProjectApiPath } from "../../utils/projectRouting";import { useState, useEffect, useCallback, useRef, useMemo } from "react";import type { CanvasResolution } from "@hyperframes/parsers";@@ -74,6 +76,7 @@ function writeHiddenIds(projectId: string, ids: Set<string>): void {}}+export function useRenderQueue(projectId: string | null,// A ref, not the value: the render target has to be read at click time, and@@ -81,6 +84,8 @@ export function useRenderQueue(// composition switch.activeCompPathRef: { current: string | null },) {+ const mvp = useMvpEditor();+ const emptyComposition = useEmptyPreview(projectId ?? "", mvp);const [jobs, setJobs] = useState<RenderJob[]>([]);// History fetch failure — distinguished from "no renders yet" so the panel// never shows a false empty state.@@ -177,6 +182,10 @@ export function useRenderQueue(// fallow-ignore-next-line complexityasync (opts: StartRenderOptions = {}) => {if (!projectId) return;+ if (emptyComposition && (!opts.composition || opts.composition === activeCompPathRef.current)) {+ setActionError("No content to export. Add media first.");+ return;+ }// The server would answer this with a 503 anyway. Refusing here keeps// the reason and the fix in the message, and keeps a control that// forgot to disable itself from producing a mystery failure.@@ -379,7 +388,7 @@ export function useRenderQueue(return jobId;},- [projectId, activeCompPathRef, closeActiveEventSource, addSessionJob, ffmpeg, ffmpegMissing, recheckFfmpeg],+ [projectId, activeCompPathRef, closeActiveEventSource, addSessionJob, ffmpeg, ffmpegMissing, recheckFfmpeg, emptyComposition],);// Cancel an in-flight render. The job row stays (as "cancelled") so the@@ -507,6 +516,7 @@ export function useRenderQueue(// itself whether this machine can encode.ffmpeg,ffmpegMissing,+ emptyComposition,ffmpegChecking,recheckFfmpeg,}),@@ -523,6 +533,7 @@ export function useRenderQueue(startRender,ffmpeg,ffmpegMissing,+ emptyComposition,ffmpegChecking,recheckFfmpeg,],diff --git a/studio/src/components/renders/useRenderQueueEmpty.test.tsx b/studio/src/components/renders/useRenderQueueEmpty.test.tsxnew file mode 100644index 00000000..7a89415b--- /dev/null+++ b/studio/src/components/renders/useRenderQueueEmpty.test.tsx@@ -0,0 +1,33 @@+// @vitest-environment happy-dom+import { act } from "react";+import { afterEach, expect, it, vi } from "vitest";+import { mountRenderQueue, renderPosts, stubRenderFetch } from "./renderQueueTestHarness";+import { usePlayerStore } from "../../player/store/playerStore";+import { usePreviewIframeStore } from "../../player/store/previewIframeStore";+vi.mock("../../motion/StudioHost", () => ({ useMvpEditor: () => true }));+vi.mock("./useFfmpegStatus", () => ({ useFfmpegStatus: () => ({ status: { ok: true }, checking: false, recheck: vi.fn() }), ffmpegInstallMessage: () => "" }));+vi.mock("../../telemetry/events", () => ({ trackStudioRenderStart: vi.fn() }));+const { useRenderQueue } = await import("./useRenderQueue");+let queue: ReturnType<typeof mountRenderQueue> | undefined;+afterEach(() => {+ queue?.unmount(); queue = undefined;+ usePlayerStore.getState().reset();+ usePreviewIframeStore.getState().setIframe(null);+ document.body.replaceChildren(); vi.unstubAllGlobals();+});+it("blocks the confirmed empty composition at the shared start handler, then allows real content", async () => {+ const fetchMock = stubRenderFetch();+ const iframe = document.createElement("iframe"); document.body.append(iframe);+ iframe.contentDocument!.body.innerHTML = '<div data-composition-id="main"></div>';+ usePreviewIframeStore.getState().setIframe(iframe);+ usePlayerStore.setState({ timelineReady: true, timelineProjectId: "demo", elements: [] });+ queue = mountRenderQueue(useRenderQueue, "demo", "index.html");+ await act(async () => { await queue!.api().startRender(); });+ expect(queue.api().emptyComposition).toBe(true);+ expect(renderPosts(fetchMock)).toHaveLength(0);+ expect(queue.api().jobs).toHaveLength(0);+ await act(async () => { iframe.contentDocument!.querySelector("div")!.textContent = "Static title"; });+ expect(queue.api().emptyComposition).toBe(false);+ await act(async () => { await queue!.api().startRender(); });+ expect(renderPosts(fetchMock)).toHaveLength(1);+});diff --git a/studio/src/components/sidebar/AssetCard.tsx b/studio/src/components/sidebar/AssetCard.tsxindex 4b31f69e..15772bd8 100644--- a/studio/src/components/sidebar/AssetCard.tsx+++ b/studio/src/components/sidebar/AssetCard.tsx@@ -1,3 +1,5 @@+import { MediaDurationBadge } from "./MediaDurationBadge";+import { useMvpEditor } from "../../motion/StudioHost";import { RemixIcon } from "../../icons/RemixIcons";import { useI18n } from "../../i18n/I18n";/**@@ -15,7 +17,7 @@ import { usePlayerStore } from "../../player/store/playerStore";import { timelineClipFocusId } from "../../player/components/timelineNavigationIdentity";import { useAssetPreviewStore } from "../../utils/assetPreviewStore";import { findClipForAsset, isPointerClick } from "../../utils/assetClickBehavior";-import { basename, ext, formatDuration, type CopyFeedback } from "./assetHelpers";+import { basename, ext, type CopyFeedback } from "./assetHelpers";import { resolveMediaPreviewUrl } from "../../player/components/thumbnailUtils";/** Drag payload writer shared by the asset tile and the font row: copy effect@@ -139,6 +141,7 @@ export function AssetCard({onRename,onAddAssetToTimeline,}: AssetCardProps) {+ const mvp = useMvpEditor();const { t } = useI18n();const [contextMenu, setContextMenu] = useState<{ x: number; y: number } | null>(null);const [hovered, setHovered] = useState(false);@@ -153,7 +156,6 @@ export function AssetCard({const isImage = IMAGE_EXT.test(asset);const probedDuration = useProbedDuration(serveUrl, !isVideo || duration != null);const resolvedDuration = duration ?? probedDuration ?? undefined;- const durationLabel = formatDuration(resolvedDuration ?? 0);// Drag-threshold click gate: track pointer-down position so we can ignore// pointer-up events that followed a real drag gesture.@@ -169,11 +171,11 @@ export function AssetCard({pointerDownRef.current = { x: e.clientX, y: e.clientY };}, []);- // Reveal the clip when the asset is already on the timeline, otherwise open+ // Legacy: reveal an existing clip. MVP: always preview the source. Otherwise open// the preview overlay. Shared by pointer-up and keyboard activation so the// tile does the same thing however it is operated.const activateCard = useCallback(() => {- if (used) {+ if (used && !mvp) {const clip = findClipForAsset(elements, asset);if (clip) {// Dismiss any open preview overlay (from another asset) — the reveal@@ -189,6 +191,7 @@ export function AssetCard({// Not added (or no matching clip found) → preview overlaysetPreviewAsset(asset, projectId);}, [+ mvp,used,elements,asset,@@ -235,7 +238,7 @@ export function AssetCard({}`}>{/* Thumbnail */}- <div className="w-full aspect-video overflow-hidden bg-neutral-900 relative">+ <div className="motion-asset-thumbnail w-full aspect-video overflow-hidden bg-neutral-900 relative">{isImage && !imgError && (<imgsrc={serveUrl}@@ -273,11 +276,7 @@ export function AssetCard({)}{/* Duration badge — top-right, media only */}- {durationLabel && (- <span className="absolute top-1 right-1 text-[9px] font-medium leading-none px-1.5 py-[3px] rounded-sm bg-neutral-950/80 text-panel-text-2 tabular-nums">- {durationLabel}- </span>- )}+ <MediaDurationBadge duration={resolvedDuration} className="absolute top-1 right-1" /></div>{/* Match catalog caption spacing and typography; keep actions beside the name. */}diff --git a/studio/src/components/sidebar/AssetsTab.tsx b/studio/src/components/sidebar/AssetsTab.tsxindex 49a05ac3..be046513 100644--- a/studio/src/components/sidebar/AssetsTab.tsx+++ b/studio/src/components/sidebar/AssetsTab.tsx@@ -154,9 +154,11 @@ function EmptyState({);}return (- <div className="flex flex-col items-center justify-center h-full px-4 gap-2">- <RemixIcon name="upload-2-line" size={24} className="text-text-off" />- <p className="text-[10px] text-neutral-600 text-center">{t("Drop media files here")}</p>+ <div className="flex items-center justify-center h-full px-4">+ <div className="motion-panel-empty-content motion-assets-empty-drop">+ <RemixIcon name="upload-2-line" size={18} className="text-text-off" />+ <p className="text-[10px] text-neutral-600 text-center">{t("Drop media files here")}</p>+ </div></div>);}@@ -301,7 +303,7 @@ export const AssetsTab = memo(function AssetsTab({onDragLeave={() => setDragOver(false)}onDrop={handleDrop}>- <div className="shrink-0 space-y-1.5 border-b border-panel-border px-2 py-2" data-assets-toolbar>+ <div className={`shrink-0 space-y-1.5 border-b ${mvp ? "border-transparent" : "border-panel-border"} px-2 py-2`} data-assets-toolbar><div className="flex items-center gap-1.5"><SearchInputvalue={searchQuery}diff --git a/studio/src/components/sidebar/AudioRow.tsx b/studio/src/components/sidebar/AudioRow.tsxindex f7441487..335f0a38 100644--- a/studio/src/components/sidebar/AudioRow.tsx+++ b/studio/src/components/sidebar/AudioRow.tsx@@ -1,4 +1,5 @@import { RemixIcon } from "../../icons/RemixIcons";+import { useMvpEditor } from "../../motion/StudioHost";import { useI18n } from "../../i18n/I18n";import { useState, useRef, useEffect, useCallback } from "react";import { classifyWebAudioMediaRoute } from "@hyperframes/core/runtime/web-audio-route";@@ -37,6 +38,7 @@ export function AudioRow({onAddAssetToTimeline?: (path: string) => void;}) {const { t } = useI18n();+ const mvp = useMvpEditor();const [contextMenu, setContextMenu] = useState<{ x: number; y: number } | null>(null);const [renaming, setRenaming] = useState(false);const [playing, setPlaying] = useState(false);@@ -66,11 +68,11 @@ export function AudioRow({const setPreviewAsset = useAssetPreviewStore((s) => s.setPreviewAsset);const clearPreviewAsset = useAssetPreviewStore((s) => s.clearPreviewAsset);- // Reveal the clip when the asset is already on the timeline, otherwise open+ // Legacy: reveal an existing clip. MVP: always preview the source. Otherwise open// the preview overlay. Shared by pointer-up and keyboard activation so the// row does the same thing however it is operated.const activateRow = useCallback(() => {- if (used) {+ if (used && !mvp) {const clip = findClipForAsset(elements, asset);if (clip) {// Dismiss any open preview overlay (from another asset) — the reveal@@ -86,6 +88,7 @@ export function AudioRow({// Not added → preview overlay (audio player)setPreviewAsset(asset, projectId);}, [+ mvp,used,elements,asset,@@ -232,7 +235,7 @@ export function AudioRow({e.preventDefault();setContextMenu({ x: e.clientX, y: e.clientY });}}- className={`group w-full mb-1 rounded-md border border-panel-border text-left px-3 py-2 flex items-center gap-2.5 transition-colors cursor-pointer outline-hidden focus-visible:ring-1 focus-visible:ring-panel-border ${+ className={`motion-audio-row group w-full mb-1 rounded-md border border-panel-border text-left px-3 py-2 flex items-center gap-2.5 transition-colors cursor-pointer outline-hidden focus-visible:ring-1 focus-visible:ring-panel-border ${isCopied? "bg-panel-accent/10": "bg-panel-surface hover:bg-panel-hover"diff --git a/studio/src/components/sidebar/BlocksTab.preview.test.tsx b/studio/src/components/sidebar/BlocksTab.preview.test.tsxnew file mode 100644index 00000000..e2350ecc--- /dev/null+++ b/studio/src/components/sidebar/BlocksTab.preview.test.tsx@@ -0,0 +1,38 @@+// @vitest-environment happy-dom+import React, { act } from "react";+import { createRoot } from "react-dom/client";+import { expect, it, vi } from "vitest";+import { BlocksTab } from "./BlocksTab";+import { StudioHostContext } from "../../motion/StudioHost";+import { useAssetPreviewStore } from "../../utils/assetPreviewStore";++vi.mock("../../contexts/StudioContext", () => ({ useStudioShellContext: () => ({ activeCompPath: "index.html" }) }));+vi.mock("../../hooks/useBlockCatalog", () => ({ useBlockCatalog: () => ({+ loading: false, search: "", setSearch: vi.fn(), category: null, setCategory: vi.fn(),+ filteredBlocks: [{ name: "caption", title: "Caption", category: "captions", type: "component", description: "", preview: { video: "/caption.mp4" } }],+}) }));+(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;++it("keeps hover playback in the card and persists a clicked preview after pointer leave", () => {+ vi.useFakeTimers();+ const host = document.createElement("div");+ document.body.append(host);+ const root = createRoot(host);+ const legacyPreview = vi.fn();+ try {+ act(() => root.render(<StudioHostContext.Provider value={{ mvpEditor: true }}><BlocksTab onPreviewBlock={legacyPreview} /></StudioHostContext.Provider>));+ const card = host.querySelector<HTMLElement>('[role="button"]')!;+ act(() => { card.dispatchEvent(new PointerEvent("pointerover", { bubbles: true })); vi.advanceTimersByTime(301); });+ expect(card.querySelector("video")?.autoplay).toBe(true);+ expect(legacyPreview).not.toHaveBeenCalled();+ expect(useAssetPreviewStore.getState().catalogPreview).toBeNull();+ act(() => card.click());+ act(() => card.dispatchEvent(new PointerEvent("pointerout", { bubbles: true })));+ expect(useAssetPreviewStore.getState().catalogPreview?.videoUrl).toBe("/caption.mp4");+ } finally {+ act(() => root.unmount());+ host.remove();+ useAssetPreviewStore.getState().clearPreviewAsset();+ vi.useRealTimers();+ }+});diff --git a/studio/src/components/sidebar/BlocksTab.tsx b/studio/src/components/sidebar/BlocksTab.tsxindex 143eed5e..0b44e5b9 100644--- a/studio/src/components/sidebar/BlocksTab.tsx+++ b/studio/src/components/sidebar/BlocksTab.tsx@@ -1,3 +1,5 @@+import { MediaDurationBadge } from "./MediaDurationBadge";+import { useMvpEditor } from "../../motion/StudioHost";import { RemixIcon } from "../../icons/RemixIcons";import { useI18n } from "../../i18n/I18n";// fallow-ignore-file code-duplication@@ -7,6 +9,7 @@ import { SearchInput } from "../ui/SearchInput";import { Tooltip } from "../ui/Tooltip";import { FilterChip } from "../ui/FilterChip";import { PromptPreviewModal } from "./PromptPreviewModal";+import { useAssetPreviewStore } from "../../utils/assetPreviewStore";import { useBlockCatalog } from "../../hooks/useBlockCatalog";import {BLOCK_CATEGORIES,@@ -34,6 +37,7 @@ interface BlocksTabProps {// fallow-ignore-next-line complexityexport const BlocksTab = memo(function BlocksTab({ onAddBlock, onPreviewBlock }: BlocksTabProps) {const { t } = useI18n();+ const mvp = useMvpEditor();const { loading, error, search, setSearch, category, setCategory, filteredBlocks } =useBlockCatalog();const [promptModal, setPromptModal] = useState<{ title: string; prompt: string } | null>(null);@@ -107,7 +111,7 @@ export const BlocksTab = memo(function BlocksTab({ onAddBlock, onPreviewBlock }:posterUrl={block.name === "blur-in" ? blurInPosterUrl : block.preview?.poster}videoUrl={block.preview?.video}onPreview={onPreviewBlock}- onShowPrompt={setPromptModal}+ onShowPrompt={mvp ? undefined : setPromptModal}onAdd={block.category === "vfx" ||block.category === "social" ||@@ -278,6 +282,10 @@ function BlockCard({}) {const { t } = useI18n();const [hovered, setHovered] = useState(false);+ const mvp = useMvpEditor();+ const preview = () => {+ if (mvp && (videoUrl || posterUrl)) useAssetPreviewStore.getState().setCatalogPreview({ videoUrl, posterUrl, title });+ };const [failedPoster, setFailedPoster] = useState<string>();const [failedVideo, setFailedVideo] = useState<string>();const [addState, setAddState] = useState<"idle" | "adding" | "added" | "failed">("idle");@@ -292,7 +300,7 @@ function BlockCard({}, []);useEffect(() => {- if (!hovered || (!video && !poster) || !onPreview) return;+ if (mvp || !hovered || (!video && !poster) || !onPreview) return;onPreview({videoUrl: video,posterUrl: poster,@@ -301,7 +309,7 @@ function BlockCard({title,});return () => onPreview(null);- }, [hovered, onPreview, video, poster, title]);+ }, [mvp, hovered, onPreview, video, poster, title]);const handleLeave = useCallback(() => {if (hoverTimer.current) {@@ -371,6 +379,16 @@ function BlockCard({return (<divclassName="group/card rounded-md overflow-hidden cursor-pointer transition-colors bg-neutral-900 hover:bg-neutral-800"+ role={mvp ? "button" : undefined}+ tabIndex={mvp ? 0 : undefined}+ aria-label={mvp ? t("Preview: {name}", { name: title }) : undefined}+ onClick={preview}+ onKeyDown={event => {+ if (event.target === event.currentTarget && (event.key === "Enter" || event.key === " ")) {+ event.preventDefault();+ preview();+ }+ }}draggableonDragStart={(e) => {e.dataTransfer.effectAllowed = "copy";@@ -404,7 +422,7 @@ function BlockCard({)}{/* Action overlay — also revealed when a button inside receives focus */}- <div className="absolute inset-0 flex flex-col items-center justify-center gap-1.5 bg-black/60 opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100 transition-opacity">+ {(onAdd || onShowPrompt) && <div className="absolute inset-0 flex flex-col items-center justify-center gap-1.5 bg-black/60 opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100 transition-opacity">{onAdd && (<Tooltip label={t("Add")} description={t("Add to composition at current time")}><button@@ -427,7 +445,7 @@ function BlockCard({</button></Tooltip>)}- <Tooltip label={t("Ask agent")} description={t("Generate a prompt to paste into your AI agent")}>+ {onShowPrompt && <Tooltip label={t("Ask agent")} description={t("Generate a prompt to paste into your AI agent")}><buttontype="button"onClick={handleShowPrompt}@@ -439,8 +457,8 @@ function BlockCard({><RemixIcon name="file-copy-line" size={14} />{t("Ask agent")}</button>- </Tooltip>- </div>+ </Tooltip>}+ </div>}{/* Badges */}<div className="absolute top-1 right-1 flex items-center gap-0.5 pointer-events-none">@@ -449,11 +467,7 @@ function BlockCard({WebGL</span>)}- {duration != null && (- <span className="px-1 py-px rounded-sm text-[8px] font-medium text-white/80 bg-black/50">- {duration}s- </span>- )}+ <MediaDurationBadge duration={duration} /></div></div>@@ -463,7 +477,6 @@ function BlockCard({{title}</div><div className="flex items-center gap-1 mt-0.5">- <span className={`w-1.5 h-1.5 rounded-full shrink-0 ${colors.dot}`} /><span className={`text-[8px] ${colors.text}`}>{t(BLOCK_CATEGORIES.find((c) => c.id === category)?.label ?? category)}</span>diff --git a/studio/src/components/sidebar/CompositionsPanel.masterComposition.test.tsx b/studio/src/components/sidebar/CompositionsPanel.masterComposition.test.tsxindex 22cf0e33..4663a419 100644--- a/studio/src/components/sidebar/CompositionsPanel.masterComposition.test.tsx+++ b/studio/src/components/sidebar/CompositionsPanel.masterComposition.test.tsx@@ -4,6 +4,8 @@ import { act } from "react";import { createRoot, type Root } from "react-dom/client";import { afterEach, describe, expect, it, vi } from "vitest";import { usePlayerStore } from "../../player/store/playerStore";+import { StudioHostContext } from "../../motion/StudioHost";+import { usePreviewIframeStore } from "../../player/store/previewIframeStore";import { CompositionsPanel } from "./CompositionsPanel";Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });@@ -21,7 +23,8 @@ afterEach(() => {root = null;preview.compositionStack = [{ id: "master" }];document.body.innerHTML = "";- usePlayerStore.setState({ thumbnailRevisions: {} });+ usePlayerStore.getState().reset();+ usePreviewIframeStore.getState().setIframe(null);});describe("CompositionsPanel root badge source", () => {@@ -76,3 +79,32 @@ it("marks only the live preview target when switching between clips and the fullrender();expect(selectedLabel()).toBe("Open composition index");});++it("hides the empty root and restores its card when authored content arrives", async () => {+ const iframe = document.createElement("iframe");+ Object.defineProperty(iframe, "contentDocument", { value: new DOMParser().parseFromString('<body><div data-composition-id="main"></div></body>', "text/html") });+ usePreviewIframeStore.getState().setIframe(iframe);+ usePlayerStore.setState({ timelineReady: true, timelineProjectId: "demo", elements: [] });+ const host = document.createElement("div"); document.body.append(host); root = createRoot(host);+ await act(async () => root?.render(<StudioHostContext.Provider value={{ mvpEditor: true }}>+ <CompositionsPanel projectId="demo" compositions={["index.html"]} onSelect={vi.fn()} />+ </StudioHostContext.Provider>));+ expect(host.textContent).toContain("No clips yet");+ expect(host.querySelector('[draggable="true"]')).toBeNull();+ await act(async () => { iframe.contentDocument!.querySelector("div")!.textContent = "Static title"; });+ expect(host.textContent).not.toContain("No clips yet");+ expect(host.querySelector('[aria-label="Open composition index"]')).not.toBeNull();+});++it("keeps other compositions available when the root is empty", async () => {+ const iframe = document.createElement("iframe");+ Object.defineProperty(iframe, "contentDocument", { value: new DOMParser().parseFromString('<body><div data-composition-id="main"></div></body>', "text/html") });+ usePreviewIframeStore.getState().setIframe(iframe);+ usePlayerStore.setState({ timelineReady: true, timelineProjectId: "demo", elements: [] });+ const host = document.createElement("div"); document.body.append(host); root = createRoot(host);+ await act(async () => root?.render(<StudioHostContext.Provider value={{ mvpEditor: true }}>+ <CompositionsPanel projectId="demo" compositions={["index.html", "scene.html"]} onSelect={vi.fn()} />+ </StudioHostContext.Provider>));+ expect(host.querySelector('[aria-label="Open composition index"]')).toBeNull();+ expect(host.querySelector('[aria-label="Open composition scene"]')).not.toBeNull();+});diff --git a/studio/src/components/sidebar/CompositionsPanel.tsx b/studio/src/components/sidebar/CompositionsPanel.tsxindex 12878dcd..adff0f32 100644--- a/studio/src/components/sidebar/CompositionsPanel.tsx+++ b/studio/src/components/sidebar/CompositionsPanel.tsx@@ -1,3 +1,7 @@+import { PanelEmptyState } from "../ui/PanelEmptyState";+import { useMvpEditor } from "../../motion/StudioHost";+import { useI18n } from "../../i18n/I18n";+import { useEmptyPreview } from "../nle/useEmptyPreview";import type { ComponentProps } from "react";import { resolveMasterCompositionPath } from "../../utils/studioUrlState";import { useNLEContext } from "../nle/NLEContext";@@ -7,13 +11,21 @@ type Props = Omit<ComponentProps<typeof CompositionsTab>, "masterCompositionPath/** The Compositions dock panel body; the root badge comes from the filtered composition list. */export function CompositionsPanel(props: Props) {- const { compositionStack } = useNLEContext();+ const { compositionStack, compositionLoading } = useNLEContext();+ const mvp = useMvpEditor();+ const { t } = useI18n();+ const empty = useEmptyPreview(props.projectId, mvp && !compositionLoading && compositionStack.length === 1);const masterCompositionPath = resolveMasterCompositionPath(props.compositions);const previewId = compositionStack[compositionStack.length - 1]?.id;const activeComposition = previewId === "master" ? masterCompositionPath : previewId ?? null;+ const compositions = empty ? props.compositions.filter(path => path !== masterCompositionPath) : props.compositions;+ if (mvp && compositions.length === 0) return (+ <PanelEmptyState icon="film-line" message={t("No clips yet")} />+ );return (<CompositionsTab{...props}+ compositions={compositions}masterCompositionPath={masterCompositionPath}activeComposition={activeComposition}/>diff --git a/studio/src/components/sidebar/CompositionsTab.rootBadge.test.tsx b/studio/src/components/sidebar/CompositionsTab.rootBadge.test.tsxindex fd8fdd87..860d5281 100644--- a/studio/src/components/sidebar/CompositionsTab.rootBadge.test.tsx+++ b/studio/src/components/sidebar/CompositionsTab.rootBadge.test.tsx@@ -9,10 +9,13 @@ const mount = (compositions: string[], masterCompositionPath: string | null) =>describe("CompositionsTab root badge", () => {it("marks the composition matching masterCompositionPath as root", () => {- const compositions = ["index.html", "compositions/headline.html"];+ const compositions = ["compositions/headline.html", "compositions/outro.html", "index.html"];const host = mount(compositions, resolveMasterCompositionPath(compositions));const cards = host.querySelectorAll<HTMLElement>('[draggable="true"]');- expect(cards).toHaveLength(2);+ expect(cards).toHaveLength(3);+ expect(cards[1]?.textContent).toContain("headline");+ expect(cards[2]?.textContent).toContain("outro");+ expect(compositions[0]).toBe("compositions/headline.html");expect(cards[0]?.textContent).toContain("Root");expect(cards[1]?.textContent).not.toContain("Root");});diff --git a/studio/src/components/sidebar/CompositionsTab.tsx b/studio/src/components/sidebar/CompositionsTab.tsxindex f68be51d..28f159a3 100644--- a/studio/src/components/sidebar/CompositionsTab.tsx+++ b/studio/src/components/sidebar/CompositionsTab.tsx@@ -451,7 +451,7 @@ export const CompositionsTab = memo(function CompositionsTab({return (<div className="flex-1 overflow-y-auto" data-composition-list>- {compositions.map((comp) => (+ {[...compositions].sort((a, b) => Number(b === masterCompositionPath) - Number(a === masterCompositionPath)).map((comp) => (<CompCardkey={`${projectId}:${comp}`}projectId={projectId}diff --git a/studio/src/components/sidebar/MediaDurationBadge.tsx b/studio/src/components/sidebar/MediaDurationBadge.tsxnew file mode 100644index 00000000..ff0bfc7d--- /dev/null+++ b/studio/src/components/sidebar/MediaDurationBadge.tsx@@ -0,0 +1,15 @@+import { formatDuration } from "./assetHelpers";++/** Shared duration treatment for project assets and catalog cards. */+export function MediaDurationBadge({ duration, className = "" }: {+ duration?: number | null;+ className?: string;+}) {+ const label = formatDuration(duration ?? 0);+ if (!label) return null;+ return (+ <span className={`text-[9px] font-medium leading-none px-1.5 py-[3px] rounded-sm bg-neutral-950/80 text-panel-text-2 tabular-nums ${className}`}>+ {label}+ </span>+ );+}diff --git a/studio/src/components/ui/ErrorNotice.test.tsx b/studio/src/components/ui/ErrorNotice.test.tsxnew file mode 100644index 00000000..400460b6--- /dev/null+++ b/studio/src/components/ui/ErrorNotice.test.tsx@@ -0,0 +1,67 @@+// @vitest-environment happy-dom+import { act } from 'react';+import { createRoot, type Root } from 'react-dom/client';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { ErrorNotice } from './ErrorNotice';+import { errorNoticeMessage } from './errorNoticeMessage';+import { I18nProvider } from '../../i18n/I18n';+import { languages, translate } from '../../i18n/messages';+import errorUi from '../../i18n/error-ui.json';++let host: HTMLDivElement;+let root: Root;+globalThis.IS_REACT_ACT_ENVIRONMENT = true;+beforeEach(() => { host = document.createElement('div'); document.body.append(host); root = createRoot(host); });+afterEach(() => { act(() => root.unmount()); host.remove(); vi.restoreAllMocks(); });+const button = (label: string) => [...host.querySelectorAll('button')].find(node => node.textContent === label)!;++it('hides raw diagnostics until expanded and preserves them for copy', async () => {+ const message = 'ENOENT /assets/' + 'long-name'.repeat(100) + '\n<script>example</script>';+ const copy = vi.spyOn(navigator.clipboard, 'writeText').mockResolvedValue();+ act(() => root.render(<I18nProvider initialLocale="zh-CN"><ErrorNotice message={message} /></I18nProvider>));+ expect(host.textContent).toContain('所需文件已丢失');+ expect(host.textContent).not.toContain('/assets/');+ expect(host.querySelector('pre')).toBeNull();+ expect(button('重试')).toBeUndefined();+ act(() => button('错误详情').click());+ expect(host.querySelector('pre')?.textContent).toBe(message);+ expect(host.querySelector('script')).toBeNull();+ await act(async () => button('复制错误信息').click());+ expect(copy).toHaveBeenCalledWith(message);+ expect(host.querySelector('[role=status]')?.textContent).toBe('已复制');+});++it('only runs an explicitly provided action and prevents repeat clicks while busy', () => {+ const retry = vi.fn();+ const render = (busy: boolean) => act(() => root.render(<ErrorNotice message="Failed to fetch" action={{ label: 'Reconnect', run: retry, busy }} />));+ render(false);+ act(() => button('Reconnect').click());+ expect(retry).toHaveBeenCalledOnce();+ render(true);+ expect(button('Checking…').disabled).toBe(true);+ act(() => button('Checking…').click());+ expect(retry).toHaveBeenCalledOnce();+});++it('keeps details selectable when clipboard permission is denied', async () => {+ vi.spyOn(navigator.clipboard, 'writeText').mockRejectedValue(new Error('denied'));+ act(() => root.render(<ErrorNotice message="unknown diagnostic" />));+ act(() => button('Error details').click());+ await act(async () => button('Copy error information').click());+ expect(host.querySelector('[role=status]')?.textContent).toContain('Select the details');+ expect(host.querySelector('pre')?.tabIndex).toBe(0);+});++it('does not invent a diagnosis for unknown errors and distinguishes media failures', () => {+ expect(errorNoticeMessage('InternalError: private/path/code')).toBe('The operation could not be completed. See error details.');+ expect(errorNoticeMessage('Invalid data while decoding media', 'export')).toContain('Check or replace');+ expect(errorNoticeMessage('unsupported codec', 'export')).toBe('This file format is not supported.');+ expect(errorNoticeMessage('Save paused: this file changed elsewhere.')).toContain('Resolve the changes');+});++it('localizes every new error message in all supported non-English languages', () => {+ for (const { locale } of languages) {+ if (locale === 'en') continue;+ for (const key of Object.keys(errorUi['zh-CN'])) expect(translate(locale, key)).not.toBe(key);+ }+});diff --git a/studio/src/components/ui/ErrorNotice.tsx b/studio/src/components/ui/ErrorNotice.tsxnew file mode 100644index 00000000..a7ebdc3d--- /dev/null+++ b/studio/src/components/ui/ErrorNotice.tsx@@ -0,0 +1,37 @@+import { useId, useState } from 'react';+import { useI18n } from '../../i18n/I18n';+import { RemixIcon } from '../../icons/RemixIcons';+import { errorNoticeMessage, type ErrorContext } from './errorNoticeMessage';+import './errorNotice.css';++export function ErrorNotice({ message, context = 'operation', compact = false, action, onDismiss }: {+ message: string;+ context?: ErrorContext;+ compact?: boolean;+ action?: { label: string; run: () => void; busy?: boolean };+ onDismiss?: () => void;+}) {+ const { t } = useI18n();+ const id = useId();+ const [expanded, setExpanded] = useState(false);+ const [copyState, setCopyState] = useState<'idle' | 'copied' | 'failed'>('idle');+ const copy = async () => {+ try { await navigator.clipboard.writeText(message); setCopyState('copied'); }+ catch { setCopyState('failed'); }+ };+ return <div className={`motion-error-notice${compact ? ' motion-error-notice-compact' : ''}`}>+ <div className="motion-error-notice-row">+ <p className="motion-error-notice-summary" role="alert">{t(errorNoticeMessage(message, context))}</p>+ {onDismiss && <button type="button" className="motion-error-notice-close" aria-label={t('Dismiss error')} onClick={onDismiss}><RemixIcon name="close-line" size={14} /></button>}+ </div>+ <div className="motion-error-notice-actions">+ {action && <button type="button" className="motion-error-notice-action" onClick={action.run} disabled={action.busy}>{t(action.busy ? 'Checking…' : action.label)}</button>}+ <button type="button" aria-expanded={expanded} aria-controls={id} onClick={() => setExpanded(value => !value)}>{t(expanded ? 'Hide error details' : 'Error details')}</button>+ </div>+ {expanded && <div id={id} className="motion-error-notice-details">+ <pre tabIndex={0} aria-label={t('Error details')}>{message}</pre>+ <button type="button" onClick={() => void copy()}>{t(copyState === 'copied' ? 'Copied!' : 'Copy error information')}</button>+ <span role="status">{copyState === 'failed' ? t('Copy failed. Select the details to copy them.') : copyState === 'copied' ? t('Copied!') : ''}</span>+ </div>}+ </div>;+}diff --git a/studio/src/components/ui/Menu.tsx b/studio/src/components/ui/Menu.tsxindex 9e4ad80c..ce4382fa 100644--- a/studio/src/components/ui/Menu.tsx+++ b/studio/src/components/ui/Menu.tsx@@ -45,15 +45,7 @@ const VIEWPORT_MARGIN = 8;* `data-starting-style`/`data-ending-style` are Base UI's transition attributes.*/export function floatingMotion(openDuration: "duration-open" | "duration-tooltip") {- return cn(- "origin-[var(--transform-origin)] outline-hidden",- "transition-[opacity,transform] ease-out-quint",- openDuration,- "data-[ending-style]:duration-close data-[ending-style]:ease-in",- "data-[starting-style]:[opacity:var(--popup-enter-opacity)]",- "data-[starting-style]:[scale:var(--popup-enter-scale)]",- "data-[ending-style]:opacity-0",- );+ return cn("hf-floating-motion outline-hidden", openDuration, openDuration === "duration-tooltip" && "hf-tooltip-motion");}/**diff --git a/studio/src/components/ui/PanelEmptyState.tsx b/studio/src/components/ui/PanelEmptyState.tsxnew file mode 100644index 00000000..35e8a263--- /dev/null+++ b/studio/src/components/ui/PanelEmptyState.tsx@@ -0,0 +1,16 @@+import { RemixIcon } from "../../icons/RemixIcons";++/** Quiet empty-state content shared by the MVP's small side panels. */+export function PanelEmptyState({ icon, message, description }: {+ icon: string;+ message: string;+ description?: string;+}) {+ return <div className="flex h-full flex-1 items-center justify-center px-4 text-center">+ <div className="motion-panel-empty-content">+ <RemixIcon name={icon} size={18} />+ <p>{message}</p>+ {description && <p>{description}</p>}+ </div>+ </div>;+}diff --git a/studio/src/components/ui/Tooltip.tsx b/studio/src/components/ui/Tooltip.tsxindex b92b3542..367543de 100644--- a/studio/src/components/ui/Tooltip.tsx+++ b/studio/src/components/ui/Tooltip.tsx@@ -37,7 +37,7 @@ export function Tooltip({label,description,children,- delay = 400,+ delay = 200,side = "top",disabled = false,lines,diff --git a/studio/src/components/ui/errorNotice.css b/studio/src/components/ui/errorNotice.cssnew file mode 100644index 00000000..2fa8cb03--- /dev/null+++ b/studio/src/components/ui/errorNotice.css@@ -0,0 +1,14 @@+.motion-error-notice { flex-shrink: 0; min-width: 0; max-width: 100%; padding: 10px 16px; color: var(--color-danger-ink); background: var(--motion-danger-soft, var(--color-bg-2)); border-bottom: 1px solid var(--color-border); font-size: 12px; line-height: 1.6; }+.motion-error-notice-row { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }+.motion-error-notice-summary { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }+.motion-error-notice button { font: inherit; color: inherit; cursor: pointer; }+.motion-error-notice-close { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; margin-top: -2px; padding: 0; border: 0; border-radius: 4px; background: transparent; }+.motion-error-notice-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }+.motion-error-notice-actions button, .motion-error-notice-details button { min-width: 0; padding: 2px 0; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; text-align: left; }+.motion-error-notice-actions .motion-error-notice-action { padding: 3px 9px; border: 1px solid currentColor; border-radius: 5px; text-decoration: none; }+.motion-error-notice button:disabled { opacity: .5; cursor: wait; }+.motion-error-notice-close:hover { background: var(--color-hover); }+.motion-error-notice-details { min-width: 0; margin-top: 8px; }+.motion-error-notice-details pre { box-sizing: border-box; width: 100%; max-height: min(160px, 30dvh); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 6px; padding: 8px; background: var(--color-bg-2); color: var(--color-text-2); border-radius: 5px; font: 11px/1.6 var(--font-mono); user-select: text; }+.motion-error-notice-details [role=status] { display: block; font-size: 11px; overflow-wrap: anywhere; }+.motion-error-notice-compact { padding: 0; border: 0; background: transparent; font-size: 11px; }diff --git a/studio/src/components/ui/errorNoticeMessage.ts b/studio/src/components/ui/errorNoticeMessage.tsnew file mode 100644index 00000000..8f904971--- /dev/null+++ b/studio/src/components/ui/errorNoticeMessage.ts@@ -0,0 +1,37 @@+import { isKnownMessage, sourceMessage } from '../../i18n/messages';++export type ErrorContext = 'operation' | 'export';++/** Raw diagnostics stay in details; only recognized causes reach the summary. */+export function errorNoticeMessage(message: string, context: ErrorContext = 'operation'): string {+ if (/external change|changed elsewhere|revision.*(?:changed|mismatch)|version mismatch|conflict|项目已切换|工程状态.*不匹配/i.test(message)) {+ return 'The project changed elsewhere. Resolve the changes before continuing.';+ }+ if (/couldn.t save|could not save|failed to save|auto-save is paused|unsaved edit|无法保存|保存失败/i.test(message)) {+ return 'Changes could not be saved. Check the connection and project before continuing.';+ }+ if (/ENOENT|no such file|file not found|文件.*(?:丢失|不存在)|找不到.*文件/i.test(message)) {+ return 'A required file is missing. Check or replace it, then try again.';+ }+ if (/EACCES|EPERM|permission denied|access denied|权限不足|拒绝访问/i.test(message)) {+ return 'Access to the file was denied. Check its permissions.';+ }+ if (/unsupported.*(?:format|codec)|(?:format|codec).*not supported|不支持.*格式/i.test(message)) {+ return 'This file format is not supported.';+ }+ if (context !== 'export' && /failed to fetch|network error|networkerror|fetch failed|ECONNREFUSED|connection.*(?:lost|refused|failed)|连接.*(?:失败|中断)/i.test(message)) {+ return 'Cannot connect to the local studio. Check that it is running.';+ }+ if (context === 'export' && /media|decode|invalid data|读取.*(?:素材|媒体)|素材.*损坏/i.test(message)) {+ return 'Media could not be read. Check or replace it before exporting again.';+ }+ // Preserve short, authored product guidance, never an arbitrary server string.+ if (isKnownMessage(message) && message.length <= 180 && !message.includes('\n')) return sourceMessage(message);+ return context === 'export'+ ? 'Export failed. Check the project before exporting again.'+ : 'The operation could not be completed. See error details.';+}++export function isConnectionFailure(message: string): boolean {+ return errorNoticeMessage(message) === 'Cannot connect to the local studio. Check that it is running.';+}diff --git a/studio/src/components/ui/menuStyle.ts b/studio/src/components/ui/menuStyle.tsindex 2ab1f607..c26bb330 100644--- a/studio/src/components/ui/menuStyle.ts+++ b/studio/src/components/ui/menuStyle.ts@@ -1,6 +1,6 @@/** The one owner of context menu spacing: rows touch the panel, which clips to its rounded corners. */export const menuClasses = {- panel: "overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg",+ panel: "hf-floating-motion overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg",group: "empty:hidden border-b border-neutral-700/60",divider: "border-t border-neutral-700/60",row: "w-full px-3 py-1.5 text-left text-xs outline-hidden",diff --git a/studio/src/contexts/StudioContext.tsx b/studio/src/contexts/StudioContext.tsxindex 29121983..0916d5c2 100644--- a/studio/src/contexts/StudioContext.tsx+++ b/studio/src/contexts/StudioContext.tsx@@ -40,6 +40,7 @@ export interface StudioShellValue {ffmpeg: FfmpegStatus | null;/** True only when the server positively reported no usable FFmpeg. */ffmpegMissing: boolean;+ emptyComposition?: boolean;ffmpegChecking: boolean;recheckFfmpeg: () => void;};diff --git a/studio/src/hooks/domEditTextCommitPlan.ts b/studio/src/hooks/domEditTextCommitPlan.tsindex c233be86..34a0c57c 100644--- a/studio/src/hooks/domEditTextCommitPlan.ts+++ b/studio/src/hooks/domEditTextCommitPlan.ts@@ -4,6 +4,7 @@ import {serializeDomEditTextFields,type DomEditTextField,} from "../components/editor/domEditing";+import { serializeDomEditTextFieldValue } from "../components/editor/domEditingLayers";import type { PatchOperation } from "../utils/sourcePatcher";import { buildTextFieldChildOperations } from "./domEditTextFieldCommitOps";@@ -27,9 +28,13 @@ export function planDomTextCommit(nextTextFields: DomEditTextField[],plainTextContent: string,): DomTextCommitPlan {+ const selfWithBreaks = nextTextFields.length === 1 && nextTextFields[0].source === "self" && nextTextFields[0].preserveLineBreaks;const usesSerializedTextFields =+ selfWithBreaks ||nextTextFields.length > 1 || nextTextFields.some((field) => field.source === "child");- const nextContent = usesSerializedTextFields+ const nextContent = selfWithBreaks+ ? serializeDomEditTextFieldValue({ ...nextTextFields[0], value: plainTextContent })+ : usesSerializedTextFields? serializeDomEditTextFields(nextTextFields): plainTextContent;const childOperations = usesSerializedTextFieldsdiff --git a/studio/src/hooks/domEditTextFieldCommitOps.ts b/studio/src/hooks/domEditTextFieldCommitOps.tsindex 9c93766f..23657437 100644--- a/studio/src/hooks/domEditTextFieldCommitOps.ts+++ b/studio/src/hooks/domEditTextFieldCommitOps.ts@@ -44,6 +44,7 @@ export function buildTextFieldChildOperations(if (!originalField || !locator) return null;if (nextField.value !== originalField.value) {+ if (nextField.preserveLineBreaks) return null;operations.push(buildDomEditTextPatchOperation(nextField.value, locator));}diff --git a/studio/src/hooks/domStyleCommit.propertyNames.test.ts b/studio/src/hooks/domStyleCommit.propertyNames.test.tsindex 9ad83336..70121e51 100644--- a/studio/src/hooks/domStyleCommit.propertyNames.test.ts+++ b/studio/src/hooks/domStyleCommit.propertyNames.test.ts@@ -1,4 +1,5 @@// @vitest-environment jsdom+import { historyEntryLabel } from "../i18n/historyMessages";import { expect, it } from "vitest";import type { DomEditSelection } from "../components/editor/domEditing";import type { PatchOperation } from "../utils/sourcePatcher";@@ -55,7 +56,7 @@ it("saves a map mixing both forms as one patch and one undo step, all under CSSmsTransform: "none",});expect(saves).toHaveLength(1);- expect(saves[0]!.label).toBe("Edit layer style");+ expect(historyEntryLabel(saves[0]!.label!, message => message)).toBe("Target · Radius: 4px / border-color: red / -webkit-text-stroke: 1px black / -ms-transform: none");expect(written(saves[0]!.operations)).toEqual([["border-radius", "4px"],["border-color", "red"],diff --git a/studio/src/hooks/domStyleCommit.ts b/studio/src/hooks/domStyleCommit.tsindex 33158c15..f92dc053 100644--- a/studio/src/hooks/domStyleCommit.ts+++ b/studio/src/hooks/domStyleCommit.ts@@ -1,4 +1,5 @@import type { PatchOperation } from "../utils/sourcePatcher";+import { styleHistoryLabel } from "../i18n/styleHistory";import {cssPropertyName,isImageBackgroundValue,@@ -8,7 +9,7 @@ import {import { injectPreviewGoogleFont, injectPreviewImportedFont } from "../utils/studioFontHelpers";import {buildDomEditStylePatchOperation,- findElementForSelection,+ findElementsForSelection,getDomEditTargetKey,type DomEditSelection,} from "../components/editor/domEditing";@@ -84,20 +85,19 @@ export async function commitDomStyles(}}}- let editedElement: HTMLElement | null = null;- const previousInline = new Map<string, string>();+ const editedElements = new Map<HTMLElement, Map<string, string>>();return runReportedDomEditCommit({capture: () => {- const el = doc ? findElementForSelection(doc, selection, activeCompPath) : null;- if (!el) return;- editedElement = el;- for (const [property] of entries)- previousInline.set(property, el.style.getPropertyValue(property));+ if (!doc) return;+ for (const el of findElementsForSelection(doc, selection, activeCompPath)) {+ editedElements.set(el, new Map(entries.map(([property]) => [property, el.style.getPropertyValue(property)])));+ }},apply: () => {- if (!editedElement) return;- for (const [property, value] of liveStyles) editedElement.style.setProperty(property, value);+ for (const el of editedElements.keys()) {+ for (const [property, value] of liveStyles) el.style.setProperty(property, value);+ }if (fontFamily !== undefined && doc) {injectPreviewGoogleFont(doc, fontFamily);if (importedFont) injectPreviewImportedFont(doc, importedFont);@@ -105,21 +105,21 @@ export async function commitDomStyles(},persist: () =>persistDomEditOperations(selection, operations, {- label: "Edit layer style",+ label: styleHistoryLabel(selection.textContent || selection.label || selection.id || selection.tagName, Object.fromEntries(entries.map(([property, value]) => [property, normalizeDomEditStyleValue(property, value)]))),// Inline styles are already live, so a reload would only blank the preview.skipRefresh: true,importedFont: importedFont ?? undefined,}),shouldRevert: ownsAny,revert: () => {- const el = editedElement;- if (!el) return;// ponytail: background-image fit styles are not reverted here.- for (const { property, isLatest } of owned) {- const previous = previousInline.get(property);- if (previous === undefined || !isLatest()) continue;- if (previous === "") el.style.removeProperty(property);- else el.style.setProperty(property, previous);+ for (const [el, previousInline] of editedElements) {+ for (const { property, isLatest } of owned) {+ const previous = previousInline.get(property);+ if (previous === undefined || !isLatest()) continue;+ if (previous === "") el.style.removeProperty(property);+ else el.style.setProperty(property, previous);+ }}},onError: (error) => reportDomEditPersistFailure(selection, operations, error, showToast),diff --git a/studio/src/hooks/timelineElementsAttribute.test.ts b/studio/src/hooks/timelineElementsAttribute.test.tsindex 781dd105..06df9ec0 100644--- a/studio/src/hooks/timelineElementsAttribute.test.ts+++ b/studio/src/hooks/timelineElementsAttribute.test.ts@@ -53,7 +53,6 @@ describe("useSetElementsAttribute", () => {"data-volume","Audio Gain",);- act(() => root.unmount());expect(showToast).not.toHaveBeenCalled();expect(saved.inputs).toHaveLength(1);const input = saved.inputs[0];@@ -66,6 +65,16 @@ describe("useSetElementsAttribute", () => {const out = typeof build === "function" ? String(build(html)) : "";expect(out).toContain('id="a" data-volume="0.5"');expect(out).toMatch(/id="b"[^>]*data-volume="2"/);+ await write?.([{ element: clip("a"), value: "true" }], "muted", "Mute audio");+ const muteFiles = saved.inputs.at(-1)?.["files"] as Record<string, (source: string) => string>;+ const mutedHtml = muteFiles['index.html']!(html);+ expect(mutedHtml).toMatch(/<audio[^>]*\smuted(?:="")?/);+ expect(mutedHtml).not.toContain('data-muted');+ expect(mutedHtml).toContain('data-volume="1"');+ await write?.([{ element: clip("a"), value: null }], "muted", "Unmute audio");+ const unmuteFiles = saved.inputs.at(-1)?.["files"] as Record<string, (source: string) => string>;+ expect(unmuteFiles['index.html']!(mutedHtml)).not.toContain('muted');+ act(() => root.unmount());});it("refuses while recording, like the single-clip write", async () => {diff --git a/studio/src/hooks/timelineElementsAttribute.ts b/studio/src/hooks/timelineElementsAttribute.tsindex 9254339c..e39bd7fe 100644--- a/studio/src/hooks/timelineElementsAttribute.ts+++ b/studio/src/hooks/timelineElementsAttribute.ts@@ -77,7 +77,7 @@ export function useSetElementsAttribute({(before: string) =>patches.reduce((html, { target, value }) =>- applyPatchByTarget(html, target, { type: "attribute", property: attr, value }),+ applyPatchByTarget(html, target, { type: attr === "muted" ? "html-attribute" : "attribute", property: attr, value }),before,),]),diff --git a/studio/src/hooks/useDomStyleCommit.test.tsx b/studio/src/hooks/useDomStyleCommit.test.tsxindex 5424e9f8..54764675 100644--- a/studio/src/hooks/useDomStyleCommit.test.tsx+++ b/studio/src/hooks/useDomStyleCommit.test.tsx@@ -3,6 +3,7 @@ import { act, createElement, useRef } from "react";import { createRoot } from "react-dom/client";import { afterEach, describe, expect, it, vi } from "vitest";import { useDomStyleCommit, type UseDomStyleCommitOptions } from "../index";+import { historyEntryLabel } from "../i18n/historyMessages";import { makeSelection } from "./domSelectionTestHarness";Reflect.set(globalThis, "IS_REACT_ACT_ENVIRONMENT", true);@@ -91,7 +92,29 @@ describe("useDomStyleCommit, from the package entry", () => {expect(patches).toHaveLength(1);expect((patches[0] as { operations: unknown[] }).operations).toHaveLength(2);expect(recordEdit).toHaveBeenCalledTimes(1);- expect(recordEdit).toHaveBeenCalledWith(expect.objectContaining({ label: "Edit layer style" }));+ expect(historyEntryLabel(recordEdit.mock.calls[0]![0].label, message => message)).toBe("Card · Color: blue / Font size: 40px");+ unmount();+ });++ it.each([false, true])("updates every same-source instance and restores each on failure: %s", async (fail) => {+ const patches = stubServer(fail ? [500] : []);+ const { element, hook, recordEdit, unmount } = renderHost();+ element.parentElement!.setAttribute("data-composition-file", "index.html");+ const clone = element.cloneNode(true) as HTMLElement;+ clone.style.color = "purple";+ element.after(clone);+ const otherHost = element.ownerDocument.createElement("section");+ otherHost.setAttribute("data-composition-file", "other.html");+ const unrelated = element.cloneNode(true) as HTMLElement;+ otherHost.append(unrelated);+ element.parentElement!.append(otherHost);+ const outcome = await hook().commitStyle({...makeSelection("card", element), sourceFile: "index.html"}, {color: "blue"});+ expect(outcome.ok).toBe(!fail);+ expect(element.style.color).toBe(fail ? "red" : "blue");+ expect(clone.style.color).toBe(fail ? "purple" : "blue");+ expect(unrelated.style.color).toBe("red");+ expect(patches).toHaveLength(1);+ expect(recordEdit).toHaveBeenCalledTimes(fail ? 0 : 1);unmount();});diff --git a/studio/src/hooks/usePanelLayout.test.ts b/studio/src/hooks/usePanelLayout.test.tsindex 3931d387..d93b6450 100644--- a/studio/src/hooks/usePanelLayout.test.ts+++ b/studio/src/hooks/usePanelLayout.test.ts@@ -6,6 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { useDockLayoutStore, type DockController } from "../components/dock/dockLayoutStore";import { PANEL_IDS, type PanelId } from "../components/dock/panelRegistry";import { trackStudioEvent } from "../utils/studioTelemetry";+import { StudioHostContext } from "../motion/StudioHost";import { usePanelLayout, type InitialPanelLayoutState } from "./usePanelLayout";(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;@@ -34,7 +35,7 @@ function showDock(visible: PanelId[], controller = fakeController()) {return controller;}-function renderLayout(initial?: InitialPanelLayoutState) {+function renderLayout(initial?: InitialPanelLayoutState, mvp = false) {const host = document.createElement("div");document.body.append(host);const root = createRoot(host);@@ -43,7 +44,7 @@ function renderLayout(initial?: InitialPanelLayoutState) {current = usePanelLayout(initial);return null;}- act(() => root.render(React.createElement(Harness)));+ act(() => root.render(React.createElement(StudioHostContext.Provider, { value: { mvpEditor: mvp } }, React.createElement(Harness))));return {get layout() {if (!current) throw new Error("layout not rendered");@@ -150,3 +151,13 @@ describe("usePanelLayout over the dock", () => {view.unmount();});});+++it("hydrates the MVP URL tab while keeping the initial inspector collapsed", () => {+ const controller = { ...fakeController(), setGroupCollapsed: vi.fn() };+ showDock(["preview", "design"], controller);+ const view = renderLayout({ rightPanelTab: "layers", rightCollapsed: false }, true);+ expect(controller.activate).toHaveBeenCalledWith("layers");+ expect(controller.setGroupCollapsed).toHaveBeenCalledWith("layers", true);+ view.unmount();+});diff --git a/studio/src/hooks/usePanelLayout.ts b/studio/src/hooks/usePanelLayout.tsindex 3e83f0fc..21605382 100644--- a/studio/src/hooks/usePanelLayout.ts+++ b/studio/src/hooks/usePanelLayout.ts@@ -3,6 +3,7 @@ import type { RightPanelTab } from "../utils/studioHelpers";import { trackStudioEvent } from "../utils/studioTelemetry";import { useDockLayoutStore, visiblePanelInZone } from "../components/dock/dockLayoutStore";import { PANEL_DEFINITIONS, type PanelId } from "../components/dock/panelRegistry";+import { useMvpEditor } from "../motion/StudioHost";import { useStableHandlers } from "./useStableHandlers";export interface InitialPanelLayoutState {@@ -21,6 +22,7 @@ function tabForPanel(id: PanelId | null): RightPanelTab {/** The right column as the rest of Studio reads it, backed by the dock's panel state. */export function usePanelLayout(initialState?: InitialPanelLayoutState) {+ const mvp = useMvpEditor();const controller = useDockLayoutStore((state) => state.controller);const lastActive = useDockLayoutStore((state) => state.lastActive);const visiblePanels = useDockLayoutStore((state) => state.visiblePanels);@@ -35,6 +37,8 @@ export function usePanelLayout(initialState?: InitialPanelLayoutState) {let unsubscribe = () => {};if (wanted && store.openPanels.has(wanted)) {store.activatePanel(wanted);+ // Hydrate the last tab without opening the MVP's initially collapsed inspector.+ if (mvp) controller.setGroupCollapsed?.(wanted, true);} else if (wanted === "slideshow") {// The slideshow panel only opens once the composition loads and turns out to be one.unsubscribe = useDockLayoutStore.subscribe((state) => {@@ -45,7 +49,7 @@ export function usePanelLayout(initialState?: InitialPanelLayoutState) {}if (rightCollapsed != null) store.setZoneVisible("right", !rightCollapsed);return () => unsubscribe();- }, [controller]);+ }, [controller, mvp]);const visibleRight = visiblePanelInZone("right", lastActive, visiblePanels);const rightPanelTab = tabForPanel(visibleRight);diff --git a/studio/src/hooks/usePreviewPersistence.failure.test.tsx b/studio/src/hooks/usePreviewPersistence.failure.test.tsxnew file mode 100644index 00000000..0264d061--- /dev/null+++ b/studio/src/hooks/usePreviewPersistence.failure.test.tsx@@ -0,0 +1,58 @@+// @vitest-environment happy-dom+import { act } from 'react';+import { createRoot } from 'react-dom/client';+import { expect, it, vi } from 'vitest';+import { usePreviewPersistence } from './usePreviewPersistence';+import { useToast } from './useToast';+import { saveFailureFeedback } from '../utils/saveFailureFeedback';++globalThis.IS_REACT_ACT_ENVIRONMENT = true;++it('shows one concise pause toast and preserves the failed save guard after it disappears', async () => {+ vi.useFakeTimers();+ const host = document.createElement('div');+ const root = createRoot(host);+ let persistence!: ReturnType<typeof usePreviewPersistence>;+ let toast!: ReturnType<typeof useToast>;+ function Harness() {+ toast = useToast();+ persistence = usePreviewPersistence({+ showToast: toast.showToast,+ readOptionalProjectFile: async () => '',+ writeProjectFile: async () => {},+ recordEdit: async () => {},+ previewIframeRef: { current: null },+ activeCompPathRef: { current: 'index.html' },+ reloadPreview: vi.fn(),+ });+ return null;+ }+ try {+ await act(async () => root.render(<Harness />));+ const error = new Error('Failed to fetch /private/' + 'long-source-path'.repeat(100));+ const save = vi.fn(async () => { throw error; });+ for (let i = 0; i < 5; i++) {+ await act(async () => { await expect(persistence.queueDomEditSave(save)).rejects.toBe(error); });+ }+ expect(toast.toasts).toHaveLength(1);+ expect(toast.toasts[0]).toMatchObject({ message: 'Connection lost. Changes were not saved.', tone: 'error', presentation: 'feedback' });+ act(() => vi.advanceTimersByTime(3000));+ act(() => vi.advanceTimersByTime(160));+ expect(toast.toasts).toHaveLength(0);+ expect(persistence.domEditSaveQueuePaused).toBe('Connection lost. Changes were not saved.');+ await expect(persistence.drainPendingDomEditSaves()).resolves.toMatchObject({ status: 'failed', error });+ await act(async () => { await expect(persistence.queueDomEditSave(save)).rejects.toThrow('Auto-save is paused'); });+ expect(save).toHaveBeenCalledTimes(5);+ expect(toast.toasts).toHaveLength(0);+ } finally {+ act(() => root.unmount());+ vi.useRealTimers();+ }+});++it('uses known causes without echoing diagnostics or inventing a connection failure', () => {+ expect(saveFailureFeedback(409, '/private/conflict.html')).toBe('The project changed elsewhere. Changes were not saved.');+ expect(saveFailureFeedback(403, '/private/secret.html')).toBe('No permission to save changes.');+ expect(saveFailureFeedback(null, 'EPERM /private/secret.html')).toBe('No permission to save changes.');+ expect(saveFailureFeedback(500, 'UnexpectedError at /private/source.ts:80')).toBe('Changes were not saved. Saving is paused.');+});diff --git a/studio/src/hooks/usePreviewPersistence.ts b/studio/src/hooks/usePreviewPersistence.tsindex 4f7a4ac5..731510ce 100644--- a/studio/src/hooks/usePreviewPersistence.ts+++ b/studio/src/hooks/usePreviewPersistence.ts@@ -1,4 +1,5 @@import { useCallback, useRef, useState } from "react";+import { saveFailureFeedback } from "../utils/saveFailureFeedback";import { useMountEffect } from "./useMountEffect";import {installStudioManualEditSeekReapply,@@ -43,7 +44,7 @@ interface RecordEditInput {}export interface UsePreviewPersistenceParams {- showToast: (message: string, tone?: "error" | "info") => void;+ showToast: (message: string, tone?: "error" | "info", presentation?: "feedback") => void;readOptionalProjectFile: (path: string) => Promise<string>;writeProjectFile: (path: string, content: string) => Promise<void>;recordEdit: (entry: RecordEditInput) => Promise<void>;@@ -131,12 +132,9 @@ export function usePreviewPersistence({if (!domEditSaveQueueRef.current) {domEditSaveQueueRef.current = createDomEditSaveQueue({onOpen: (event) => {- const message =- event.statusCode === 409- ? "Save paused: this file changed elsewhere. Reload and review the latest version before reapplying your edit."- : "Auto-save is paused. Check your connection.";+ const message = saveFailureFeedback(event.statusCode, event.errorMessage);setDomEditSaveQueuePaused(message);- showToastRef.current(message, "error");+ showToastRef.current(message, "error", "feedback");trackStudioEvent("save_queue_paused", {source: "dom_edit",error_message: event.errorMessage,diff --git a/studio/src/hooks/useToast.test.tsx b/studio/src/hooks/useToast.test.tsxnew file mode 100644index 00000000..d65b706c--- /dev/null+++ b/studio/src/hooks/useToast.test.tsx@@ -0,0 +1,49 @@+// @vitest-environment happy-dom+import { act } from 'react';+import { createRoot, type Root } from 'react-dom/client';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { useToast } from './useToast';+import { StudioToast } from '../components/StudioToast';++let host: HTMLDivElement;+let root: Root;+let api: ReturnType<typeof useToast>;+globalThis.IS_REACT_ACT_ENVIRONMENT = true;+function Harness() {+ api = useToast();+ return <>{api.toasts.map(toast => <StudioToast key={toast.id} {...toast} onDismiss={() => api.dismissToast(toast.id)} />)}</>;+}+beforeEach(() => { vi.useFakeTimers(); host = document.createElement('div'); document.body.append(host); root = createRoot(host); act(() => root.render(<Harness />)); });+afterEach(() => { act(() => root.unmount()); host.remove(); vi.useRealTimers(); });+it('shows feedback without a close button and starts exiting after exactly 3 seconds', () => {+ act(() => { api.showToast('Copied element', 'info'); });+ expect(host.querySelector('button')).toBeNull();+ act(() => { vi.advanceTimersByTime(2999); });+ expect(api.toasts[0].leaving).toBeUndefined();+ act(() => { vi.advanceTimersByTime(1); });+ expect(api.toasts[0].leaving).toBe(true);+ act(() => { vi.advanceTimersByTime(160); });+ expect(api.toasts).toHaveLength(0);+});+it('keeps actionable error notices visible until dismissed and hides raw diagnostics', () => {+ act(() => { api.showToast('Could not save /private/project/file.html', 'error'); });+ act(() => { vi.advanceTimersByTime(10000); });+ expect(api.toasts).toHaveLength(1);+ expect(host.textContent).not.toContain('/private/');+ const close = host.querySelector<HTMLButtonElement>('[aria-label="Dismiss error"]')!;+ expect(close).not.toBeNull();+ act(() => close.click());+ act(() => { vi.advanceTimersByTime(160); });+ expect(api.toasts).toHaveLength(0);+});++it('announces brief failure feedback without actions and removes it after three seconds', () => {+ act(() => { api.showToast('Connection lost. Changes were not saved.', 'error', 'feedback'); });+ expect(host.querySelector('[role=alert]')?.textContent).toContain('Changes were not saved');+ expect(host.querySelector('button')).toBeNull();+ expect(host.querySelector('pre')).toBeNull();+ act(() => { vi.advanceTimersByTime(2999); });+ expect(api.toasts[0].leaving).toBeUndefined();+ act(() => { vi.advanceTimersByTime(161); });+ expect(api.toasts).toHaveLength(0);+});diff --git a/studio/src/hooks/useToast.ts b/studio/src/hooks/useToast.tsindex 2d967c12..c465c07e 100644--- a/studio/src/hooks/useToast.ts+++ b/studio/src/hooks/useToast.ts@@ -8,15 +8,17 @@ interface ToastItem extends AppToast {leaving?: boolean;}-const AUTO_DISMISS_MS = 4000;+const AUTO_DISMISS_MS = 3000;const EXIT_MS = 160;const MAX_TOASTS = 3;let nextToastId = 1;/**- * Stacked toasts (max 3). Info toasts auto-dismiss after 4s; error toasts- * persist until explicitly dismissed. Identical active errors share one toast.+ * Stacked toasts (max 3). Info toasts auto-dismiss after 3s; error toasts+ * persist until explicitly dismissed, unless explicitly marked brief feedback.+ * Feedback dismissal never changes the underlying operation or save guards.+ * Identical active errors share one toast.*/export function useToast() {const [toasts, setToasts] = useState<ToastItem[]>([]);@@ -50,13 +52,13 @@ export function useToast() {);const showToast = useCallback(- (message: string, tone: AppToast["tone"] = "error"): number => {+ (message: string, tone: AppToast["tone"] = "error", presentation?: AppToast["presentation"]): number => {const id = nextToastId++;setToasts((prev) => {- if (tone === "error" && prev.some((toast) => toast.tone === tone && toast.message === message && !toast.leaving)) {+ if (tone === "error" && prev.some((toast) => toast.tone === tone && toast.message === message && toast.presentation === presentation && !toast.leaving)) {return prev;}- const next = [...prev, { id, message, tone }];+ const next = [...prev, { id, message, tone, presentation }];// Cap the stack; drop the oldest (and its pending timer).while (next.length > MAX_TOASTS) {const dropped = next.shift();@@ -64,7 +66,7 @@ export function useToast() {}return next;});- if (tone !== "error") {+ if (tone !== "error" || presentation === "feedback") {const timer = setTimeout(() => dismissToast(id), AUTO_DISMISS_MS);timersRef.current.set(id, timer);}diff --git a/studio/src/i18n/I18n.test.tsx b/studio/src/i18n/I18n.test.tsxindex f27beae1..f13d0d20 100644--- a/studio/src/i18n/I18n.test.tsx+++ b/studio/src/i18n/I18n.test.tsx@@ -172,15 +172,17 @@ it('updates an already visible toast when the interface language changes', () =>expect(host.querySelector('[role="status"]')?.textContent).toContain('Undid: Edit layer style');});-it('renders a dismissible restore error with localized text and unchanged file paths', () => {+it('renders a dismissible restore error with a localized summary and unchanged diagnostic details', () => {const dismiss = vi.fn();const message = 'VERSION_NOT_RESTORABLE: Historical files are missing, unreadable or corrupt: assets/原始配乐.wav';act(() => root.render(<I18nProvider initialLocale="zh-CN"><StudioToast message={message} tone="error" onDismiss={dismiss} /></I18nProvider>));const alert = host.querySelector('[role="alert"]')!;- expect(alert.textContent).toContain('历史文件缺失、无法读取或已损坏:assets/原始配乐.wav');- expect(alert.textContent).toContain('未恢复此版本,当前工程保持不变');- expect(alert.textContent).not.toContain('VERSION_NOT_RESTORABLE');- act(() => alert.querySelector<HTMLButtonElement>('button')!.click());+ expect(alert.textContent).toBe('操作未能完成,可查看错误详情。');+ expect(host.textContent).not.toContain('assets/原始配乐.wav');+ expect(host.textContent).not.toContain('VERSION_NOT_RESTORABLE');+ act(() => host.querySelector<HTMLButtonElement>('button[aria-expanded]')!.click());+ expect(host.querySelector('pre')?.textContent).toBe(message);+ act(() => host.querySelector<HTMLButtonElement>('.motion-error-notice-close')!.click());expect(dismiss).toHaveBeenCalledOnce();});diff --git a/studio/src/i18n/error-ui.json b/studio/src/i18n/error-ui.jsonnew file mode 100644index 00000000..3e2d350e--- /dev/null+++ b/studio/src/i18n/error-ui.json@@ -0,0 +1,242 @@+{+ "zh-CN": {+ "The project changed elsewhere. Resolve the changes before continuing.": "工程已在其他地方修改,请先处理版本冲突。",+ "Changes could not be saved. Check the connection and project before continuing.": "修改未能保存,请检查连接和工程后再继续。",+ "A required file is missing. Check or replace it, then try again.": "所需文件已丢失,请检查或替换文件后重试。",+ "Access to the file was denied. Check its permissions.": "没有文件访问权限,请检查权限设置。",+ "This file format is not supported.": "暂不支持此文件格式。",+ "Cannot connect to the local studio. Check that it is running.": "无法连接本地工作室,请确认服务已启动。",+ "Media could not be read. Check or replace it before exporting again.": "无法读取素材,请检查或替换素材后重新导出。",+ "Export failed. Check the project before exporting again.": "导出失败,请检查工程后重新导出。",+ "The operation could not be completed. See error details.": "操作未能完成,可查看错误详情。",+ "Error details": "错误详情",+ "Hide error details": "收起详情",+ "Copy error information": "复制错误信息",+ "Copy failed. Select the details to copy them.": "复制失败,请选中详情手动复制。",+ "Reconnect": "重新连接",+ "Changes were not saved. Saving is paused.": "修改未保存,自动保存已暂停。",+ "Connection lost. Changes were not saved.": "连接已断开,刚才的修改没有保存成功。",+ "No permission to save changes.": "没有保存权限,修改未保存。",+ "The project changed elsewhere. Changes were not saved.": "项目已在其他地方修改,本次修改未保存。",+ "Use updated version": "使用最新版本",+ "Keep my changes": "保留我的修改",+ "Use the updated version and discard your unsaved changes?": "使用最新版本,并放弃你尚未保存的修改?",+ "Keep your changes and replace the version updated elsewhere?": "保留你的修改,并替换其他地方更新的版本?"+ },+ "ja": {+ "The project changed elsewhere. Resolve the changes before continuing.": "プロジェクトが別の場所で変更されました。競合を解決してから続行してください。",+ "Changes could not be saved. Check the connection and project before continuing.": "変更を保存できませんでした。接続とプロジェクトを確認してください。",+ "A required file is missing. Check or replace it, then try again.": "必要なファイルが見つかりません。確認または差し替えて再試行してください。",+ "Access to the file was denied. Check its permissions.": "ファイルへのアクセスが拒否されました。権限を確認してください。",+ "This file format is not supported.": "このファイル形式には対応していません。",+ "Cannot connect to the local studio. Check that it is running.": "ローカルスタジオに接続できません。起動しているか確認してください。",+ "Media could not be read. Check or replace it before exporting again.": "素材を読み込めません。確認または差し替えてから再度書き出してください。",+ "Export failed. Check the project before exporting again.": "書き出しに失敗しました。プロジェクトを確認して再試行してください。",+ "The operation could not be completed. See error details.": "操作を完了できませんでした。エラーの詳細を確認してください。",+ "Error details": "エラーの詳細",+ "Hide error details": "詳細を閉じる",+ "Copy error information": "エラー情報をコピー",+ "Copy failed. Select the details to copy them.": "コピーできませんでした。詳細を選択してコピーしてください。",+ "Reconnect": "再接続",+ "Changes were not saved. Saving is paused.": "変更は保存されていません。自動保存は一時停止中です。",+ "Connection lost. Changes were not saved.": "接続が切れました。変更は保存されていません。",+ "No permission to save changes.": "変更を保存する権限がありません。",+ "The project changed elsewhere. Changes were not saved.": "プロジェクトが別の場所で変更されました。変更は保存されていません。",+ "Use updated version": "更新された版を使用",+ "Keep my changes": "自分の変更を保持",+ "Use the updated version and discard your unsaved changes?": "更新された版を使用し、未保存の変更を破棄しますか?",+ "Keep your changes and replace the version updated elsewhere?": "自分の変更を保持し、別の場所で更新された版を置き換えますか?"+ },+ "ko": {+ "The project changed elsewhere. Resolve the changes before continuing.": "프로젝트가 다른 곳에서 변경되었습니다. 충돌을 해결한 후 계속하세요.",+ "Changes could not be saved. Check the connection and project before continuing.": "변경 사항을 저장하지 못했습니다. 연결과 프로젝트를 확인하세요.",+ "A required file is missing. Check or replace it, then try again.": "필요한 파일이 없습니다. 파일을 확인하거나 교체한 후 다시 시도하세요.",+ "Access to the file was denied. Check its permissions.": "파일 접근이 거부되었습니다. 권한을 확인하세요.",+ "This file format is not supported.": "지원하지 않는 파일 형식입니다.",+ "Cannot connect to the local studio. Check that it is running.": "로컬 스튜디오에 연결할 수 없습니다. 실행 중인지 확인하세요.",+ "Media could not be read. Check or replace it before exporting again.": "미디어를 읽을 수 없습니다. 확인하거나 교체한 후 다시 내보내세요.",+ "Export failed. Check the project before exporting again.": "내보내기에 실패했습니다. 프로젝트를 확인한 후 다시 내보내세요.",+ "The operation could not be completed. See error details.": "작업을 완료하지 못했습니다. 오류 세부 정보를 확인하세요.",+ "Error details": "오류 세부 정보",+ "Hide error details": "세부 정보 접기",+ "Copy error information": "오류 정보 복사",+ "Copy failed. Select the details to copy them.": "복사하지 못했습니다. 세부 정보를 선택해 복사하세요.",+ "Reconnect": "다시 연결",+ "Changes were not saved. Saving is paused.": "변경 사항이 저장되지 않았습니다. 자동 저장이 일시 중지되었습니다.",+ "Connection lost. Changes were not saved.": "연결이 끊겨 변경 사항이 저장되지 않았습니다.",+ "No permission to save changes.": "변경 사항을 저장할 권한이 없습니다.",+ "The project changed elsewhere. Changes were not saved.": "프로젝트가 다른 곳에서 변경되어 변경 사항이 저장되지 않았습니다.",+ "Use updated version": "최신 버전 사용",+ "Keep my changes": "내 변경 사항 유지",+ "Use the updated version and discard your unsaved changes?": "최신 버전을 사용하고 저장하지 않은 변경 사항을 버릴까요?",+ "Keep your changes and replace the version updated elsewhere?": "내 변경 사항을 유지하고 다른 곳에서 업데이트된 버전을 바꿀까요?"+ },+ "de": {+ "The project changed elsewhere. Resolve the changes before continuing.": "Das Projekt wurde andernorts geändert. Lösen Sie den Konflikt, bevor Sie fortfahren.",+ "Changes could not be saved. Check the connection and project before continuing.": "Änderungen konnten nicht gespeichert werden. Prüfen Sie Verbindung und Projekt.",+ "A required file is missing. Check or replace it, then try again.": "Eine benötigte Datei fehlt. Prüfen oder ersetzen Sie sie und versuchen Sie es erneut.",+ "Access to the file was denied. Check its permissions.": "Der Dateizugriff wurde verweigert. Prüfen Sie die Berechtigungen.",+ "This file format is not supported.": "Dieses Dateiformat wird nicht unterstützt.",+ "Cannot connect to the local studio. Check that it is running.": "Keine Verbindung zum lokalen Studio. Prüfen Sie, ob es läuft.",+ "Media could not be read. Check or replace it before exporting again.": "Das Medium konnte nicht gelesen werden. Prüfen oder ersetzen Sie es vor dem nächsten Export.",+ "Export failed. Check the project before exporting again.": "Export fehlgeschlagen. Prüfen Sie das Projekt vor dem nächsten Export.",+ "The operation could not be completed. See error details.": "Der Vorgang konnte nicht abgeschlossen werden. Sehen Sie sich die Fehlerdetails an.",+ "Error details": "Fehlerdetails",+ "Hide error details": "Details ausblenden",+ "Copy error information": "Fehlerinformationen kopieren",+ "Copy failed. Select the details to copy them.": "Kopieren fehlgeschlagen. Markieren und kopieren Sie die Details.",+ "Reconnect": "Erneut verbinden",+ "Changes were not saved. Saving is paused.": "Änderungen nicht gespeichert. Automatisches Speichern pausiert.",+ "Connection lost. Changes were not saved.": "Verbindung unterbrochen. Änderungen nicht gespeichert.",+ "No permission to save changes.": "Keine Berechtigung zum Speichern der Änderungen.",+ "The project changed elsewhere. Changes were not saved.": "Projekt andernorts geändert. Änderungen nicht gespeichert.",+ "Use updated version": "Aktualisierte Version verwenden",+ "Keep my changes": "Meine Änderungen behalten",+ "Use the updated version and discard your unsaved changes?": "Aktualisierte Version verwenden und ungespeicherte Änderungen verwerfen?",+ "Keep your changes and replace the version updated elsewhere?": "Eigene Änderungen behalten und die andernorts aktualisierte Version ersetzen?"+ },+ "fr": {+ "The project changed elsewhere. Resolve the changes before continuing.": "Le projet a été modifié ailleurs. Résolvez le conflit avant de continuer.",+ "Changes could not be saved. Check the connection and project before continuing.": "Les modifications n’ont pas pu être enregistrées. Vérifiez la connexion et le projet.",+ "A required file is missing. Check or replace it, then try again.": "Un fichier nécessaire est introuvable. Vérifiez-le ou remplacez-le, puis réessayez.",+ "Access to the file was denied. Check its permissions.": "L’accès au fichier a été refusé. Vérifiez ses autorisations.",+ "This file format is not supported.": "Ce format de fichier n’est pas pris en charge.",+ "Cannot connect to the local studio. Check that it is running.": "Impossible de se connecter au studio local. Vérifiez qu’il est démarré.",+ "Media could not be read. Check or replace it before exporting again.": "Impossible de lire le média. Vérifiez-le ou remplacez-le avant de réexporter.",+ "Export failed. Check the project before exporting again.": "L’export a échoué. Vérifiez le projet avant de réexporter.",+ "The operation could not be completed. See error details.": "L’opération n’a pas pu être terminée. Consultez les détails de l’erreur.",+ "Error details": "Détails de l’erreur",+ "Hide error details": "Masquer les détails",+ "Copy error information": "Copier les informations d’erreur",+ "Copy failed. Select the details to copy them.": "Échec de la copie. Sélectionnez les détails pour les copier.",+ "Reconnect": "Reconnecter",+ "Changes were not saved. Saving is paused.": "Modifications non enregistrées. Enregistrement automatique en pause.",+ "Connection lost. Changes were not saved.": "Connexion perdue. Modifications non enregistrées.",+ "No permission to save changes.": "Vous n’avez pas l’autorisation d’enregistrer les modifications.",+ "The project changed elsewhere. Changes were not saved.": "Projet modifié ailleurs. Modifications non enregistrées.",+ "Use updated version": "Utiliser la version à jour",+ "Keep my changes": "Garder mes modifications",+ "Use the updated version and discard your unsaved changes?": "Utiliser la version à jour et abandonner vos modifications non enregistrées ?",+ "Keep your changes and replace the version updated elsewhere?": "Garder vos modifications et remplacer la version mise à jour ailleurs ?"+ },+ "es": {+ "The project changed elsewhere. Resolve the changes before continuing.": "El proyecto se modificó en otro lugar. Resuelve el conflicto antes de continuar.",+ "Changes could not be saved. Check the connection and project before continuing.": "No se pudieron guardar los cambios. Revisa la conexión y el proyecto.",+ "A required file is missing. Check or replace it, then try again.": "Falta un archivo necesario. Revísalo o reemplázalo y vuelve a intentarlo.",+ "Access to the file was denied. Check its permissions.": "Se denegó el acceso al archivo. Revisa sus permisos.",+ "This file format is not supported.": "Este formato de archivo no es compatible.",+ "Cannot connect to the local studio. Check that it is running.": "No se puede conectar al estudio local. Comprueba que esté en ejecución.",+ "Media could not be read. Check or replace it before exporting again.": "No se pudo leer el medio. Revísalo o reemplázalo antes de exportar de nuevo.",+ "Export failed. Check the project before exporting again.": "La exportación falló. Revisa el proyecto antes de exportar de nuevo.",+ "The operation could not be completed. See error details.": "No se pudo completar la operación. Consulta los detalles del error.",+ "Error details": "Detalles del error",+ "Hide error details": "Ocultar detalles",+ "Copy error information": "Copiar información del error",+ "Copy failed. Select the details to copy them.": "La copia falló. Selecciona los detalles para copiarlos.",+ "Reconnect": "Reconectar",+ "Changes were not saved. Saving is paused.": "Cambios sin guardar. Guardado automático en pausa.",+ "Connection lost. Changes were not saved.": "Conexión perdida. Cambios sin guardar.",+ "No permission to save changes.": "No tienes permiso para guardar los cambios.",+ "The project changed elsewhere. Changes were not saved.": "El proyecto cambió en otro lugar. Cambios sin guardar.",+ "Use updated version": "Usar versión actualizada",+ "Keep my changes": "Conservar mis cambios",+ "Use the updated version and discard your unsaved changes?": "¿Usar la versión actualizada y descartar tus cambios sin guardar?",+ "Keep your changes and replace the version updated elsewhere?": "¿Conservar tus cambios y reemplazar la versión actualizada en otro lugar?"+ },+ "pt-BR": {+ "The project changed elsewhere. Resolve the changes before continuing.": "O projeto foi alterado em outro local. Resolva o conflito antes de continuar.",+ "Changes could not be saved. Check the connection and project before continuing.": "Não foi possível salvar as alterações. Verifique a conexão e o projeto.",+ "A required file is missing. Check or replace it, then try again.": "Um arquivo necessário está ausente. Verifique ou substitua o arquivo e tente novamente.",+ "Access to the file was denied. Check its permissions.": "O acesso ao arquivo foi negado. Verifique as permissões.",+ "This file format is not supported.": "Este formato de arquivo não é compatível.",+ "Cannot connect to the local studio. Check that it is running.": "Não foi possível conectar ao estúdio local. Verifique se ele está em execução.",+ "Media could not be read. Check or replace it before exporting again.": "Não foi possível ler a mídia. Verifique ou substitua o arquivo antes de exportar novamente.",+ "Export failed. Check the project before exporting again.": "A exportação falhou. Verifique o projeto antes de exportar novamente.",+ "The operation could not be completed. See error details.": "Não foi possível concluir a operação. Consulte os detalhes do erro.",+ "Error details": "Detalhes do erro",+ "Hide error details": "Ocultar detalhes",+ "Copy error information": "Copiar informações do erro",+ "Copy failed. Select the details to copy them.": "Falha ao copiar. Selecione os detalhes para copiá-los.",+ "Reconnect": "Reconectar",+ "Changes were not saved. Saving is paused.": "Alterações não salvas. Salvamento automático pausado.",+ "Connection lost. Changes were not saved.": "Conexão perdida. Alterações não salvas.",+ "No permission to save changes.": "Sem permissão para salvar as alterações.",+ "The project changed elsewhere. Changes were not saved.": "O projeto foi alterado em outro local. Alterações não salvas.",+ "Use updated version": "Usar versão atualizada",+ "Keep my changes": "Manter minhas alterações",+ "Use the updated version and discard your unsaved changes?": "Usar a versão atualizada e descartar suas alterações não salvas?",+ "Keep your changes and replace the version updated elsewhere?": "Manter suas alterações e substituir a versão atualizada em outro local?"+ },+ "it": {+ "The project changed elsewhere. Resolve the changes before continuing.": "Il progetto è stato modificato altrove. Risolvi il conflitto prima di continuare.",+ "Changes could not be saved. Check the connection and project before continuing.": "Impossibile salvare le modifiche. Controlla la connessione e il progetto.",+ "A required file is missing. Check or replace it, then try again.": "Manca un file necessario. Controllalo o sostituiscilo e riprova.",+ "Access to the file was denied. Check its permissions.": "Accesso al file negato. Controlla le autorizzazioni.",+ "This file format is not supported.": "Questo formato di file non è supportato.",+ "Cannot connect to the local studio. Check that it is running.": "Impossibile connettersi allo studio locale. Verifica che sia in esecuzione.",+ "Media could not be read. Check or replace it before exporting again.": "Impossibile leggere il contenuto multimediale. Controllalo o sostituiscilo prima di esportare di nuovo.",+ "Export failed. Check the project before exporting again.": "Esportazione non riuscita. Controlla il progetto prima di esportare di nuovo.",+ "The operation could not be completed. See error details.": "Impossibile completare l’operazione. Consulta i dettagli dell’errore.",+ "Error details": "Dettagli dell’errore",+ "Hide error details": "Nascondi dettagli",+ "Copy error information": "Copia informazioni errore",+ "Copy failed. Select the details to copy them.": "Copia non riuscita. Seleziona i dettagli per copiarli.",+ "Reconnect": "Riconnetti",+ "Changes were not saved. Saving is paused.": "Modifiche non salvate. Salvataggio automatico in pausa.",+ "Connection lost. Changes were not saved.": "Connessione interrotta. Modifiche non salvate.",+ "No permission to save changes.": "Non hai il permesso di salvare le modifiche.",+ "The project changed elsewhere. Changes were not saved.": "Progetto modificato altrove. Modifiche non salvate.",+ "Use updated version": "Usa versione aggiornata",+ "Keep my changes": "Mantieni le mie modifiche",+ "Use the updated version and discard your unsaved changes?": "Usare la versione aggiornata e scartare le modifiche non salvate?",+ "Keep your changes and replace the version updated elsewhere?": "Mantenere le tue modifiche e sostituire la versione aggiornata altrove?"+ },+ "ru": {+ "The project changed elsewhere. Resolve the changes before continuing.": "Проект изменён в другом месте. Разрешите конфликт, прежде чем продолжить.",+ "Changes could not be saved. Check the connection and project before continuing.": "Не удалось сохранить изменения. Проверьте соединение и проект.",+ "A required file is missing. Check or replace it, then try again.": "Нужный файл отсутствует. Проверьте или замените его и повторите попытку.",+ "Access to the file was denied. Check its permissions.": "Доступ к файлу запрещён. Проверьте права доступа.",+ "This file format is not supported.": "Этот формат файла не поддерживается.",+ "Cannot connect to the local studio. Check that it is running.": "Нет соединения с локальной студией. Убедитесь, что она запущена.",+ "Media could not be read. Check or replace it before exporting again.": "Не удалось прочитать медиафайл. Проверьте или замените его перед повторным экспортом.",+ "Export failed. Check the project before exporting again.": "Ошибка экспорта. Проверьте проект перед повторным экспортом.",+ "The operation could not be completed. See error details.": "Не удалось завершить операцию. Посмотрите сведения об ошибке.",+ "Error details": "Сведения об ошибке",+ "Hide error details": "Скрыть сведения",+ "Copy error information": "Скопировать сведения об ошибке",+ "Copy failed. Select the details to copy them.": "Не удалось скопировать. Выделите сведения и скопируйте их вручную.",+ "Reconnect": "Подключиться снова",+ "Changes were not saved. Saving is paused.": "Изменения не сохранены. Автосохранение приостановлено.",+ "Connection lost. Changes were not saved.": "Соединение потеряно. Изменения не сохранены.",+ "No permission to save changes.": "Нет разрешения на сохранение изменений.",+ "The project changed elsewhere. Changes were not saved.": "Проект изменён в другом месте. Изменения не сохранены.",+ "Use updated version": "Использовать новую версию",+ "Keep my changes": "Сохранить мои изменения",+ "Use the updated version and discard your unsaved changes?": "Использовать новую версию и отменить ваши несохранённые изменения?",+ "Keep your changes and replace the version updated elsewhere?": "Сохранить ваши изменения и заменить версию, обновлённую в другом месте?"+ },+ "tr": {+ "The project changed elsewhere. Resolve the changes before continuing.": "Proje başka bir yerde değiştirildi. Devam etmeden önce çakışmayı giderin.",+ "Changes could not be saved. Check the connection and project before continuing.": "Değişiklikler kaydedilemedi. Bağlantıyı ve projeyi kontrol edin.",+ "A required file is missing. Check or replace it, then try again.": "Gerekli bir dosya eksik. Dosyayı kontrol edin veya değiştirip tekrar deneyin.",+ "Access to the file was denied. Check its permissions.": "Dosyaya erişim reddedildi. İzinleri kontrol edin.",+ "This file format is not supported.": "Bu dosya biçimi desteklenmiyor.",+ "Cannot connect to the local studio. Check that it is running.": "Yerel stüdyoya bağlanılamıyor. Çalıştığından emin olun.",+ "Media could not be read. Check or replace it before exporting again.": "Medya okunamadı. Yeniden dışa aktarmadan önce kontrol edin veya değiştirin.",+ "Export failed. Check the project before exporting again.": "Dışa aktarma başarısız oldu. Yeniden dışa aktarmadan önce projeyi kontrol edin.",+ "The operation could not be completed. See error details.": "İşlem tamamlanamadı. Hata ayrıntılarına bakın.",+ "Error details": "Hata ayrıntıları",+ "Hide error details": "Ayrıntıları gizle",+ "Copy error information": "Hata bilgilerini kopyala",+ "Copy failed. Select the details to copy them.": "Kopyalanamadı. Kopyalamak için ayrıntıları seçin.",+ "Reconnect": "Yeniden bağlan",+ "Changes were not saved. Saving is paused.": "Değişiklikler kaydedilmedi. Otomatik kayıt duraklatıldı.",+ "Connection lost. Changes were not saved.": "Bağlantı kesildi. Değişiklikler kaydedilmedi.",+ "No permission to save changes.": "Değişiklikleri kaydetme izniniz yok.",+ "The project changed elsewhere. Changes were not saved.": "Proje başka bir yerde değiştirildi. Değişiklikler kaydedilmedi.",+ "Use updated version": "Güncel sürümü kullan",+ "Keep my changes": "Değişikliklerimi koru",+ "Use the updated version and discard your unsaved changes?": "Güncel sürüm kullanılıp kaydedilmemiş değişiklikleriniz silinsin mi?",+ "Keep your changes and replace the version updated elsewhere?": "Değişiklikleriniz korunup başka yerde güncellenen sürüm değiştirilsin mi?"+ }+}diff --git a/studio/src/i18n/historyMessages.ts b/studio/src/i18n/historyMessages.tsindex 7a6bd0de..5e628d8b 100644--- a/studio/src/i18n/historyMessages.ts+++ b/studio/src/i18n/historyMessages.ts@@ -1,12 +1,17 @@import type { Translate } from './I18n';+import { formatStyleHistoryLabel } from './styleHistory';// Translate system descriptions without changing persisted history or file paths.export function historyEntryLabel(label: string, t: Translate): string {if (label === 'Changed outside the app') return t('External change');if (label.startsWith('Undid: ')) return t('Undo: {label}', { label: historyEntryLabel(label.slice(7), t) });if (label.startsWith('Redid: ')) return t('Redo: {label}', { label: historyEntryLabel(label.slice(7), t) });+ const style = formatStyleHistoryLabel(label, t);+ if (style) return style;const addedBlock = /^Add (block|component): (.+)$/s.exec(label);if (addedBlock) return t(addedBlock[1] === 'block' ? 'Add block: {name}' : 'Add component: {name}', { name: addedBlock[2] });+ const track = /^(Show|Hide) track (\d+)$/.exec(label);+ if (track) return t(track[1] === 'Show' ? 'Show track {number}' : 'Hide track {number}', { number: track[2] });const split = /^Split (\d+) clips at ([\d.]+)s$/.exec(label);if (split) return t('Split {count} clips at {time}s', { count: Number(split[1]), time: split[2] });const property = /^Edit (muted|volume|opacity|color|font-size|text|width|height|position)$/.exec(label)?.[1];diff --git a/studio/src/i18n/messages.test.ts b/studio/src/i18n/messages.test.tsindex 0a97ab5c..2ecefe9c 100644--- a/studio/src/i18n/messages.test.ts+++ b/studio/src/i18n/messages.test.ts@@ -1,5 +1,7 @@import { describe, expect, it } from 'vitest';import { dictionaries, languages, translate, mvpMessages, isKnownMessage } from './messages';+import mvpUi from './mvp-ui.json';+import { historyEntryLabel } from './historyMessages';describe('editor language resources', () => {it('offers the eleven requested languages and a complete vocabulary in each dictionary', () => {@@ -44,18 +46,44 @@ describe('editor language resources', () => {});});-// The audit adds Chinese/English messages without claiming new translations for-// the other nine locales; their existing shared vocabulary must stay complete.-it('keeps MVP additions separate, interpolated and safe to fall back to English', () => {+it('keeps Chinese additions interpolated and preserves fallback for unexposed advanced controls', () => {for (const [source, translated] of Object.entries(mvpMessages['zh-CN']!)) {- expect(dictionaries['zh-CN'][source]).toBeUndefined();expect(isKnownMessage(source)).toBe(true);expect(typeof translated).toBe('string');const values = Object.fromEntries([...source.matchAll(/\{(\w+)\}/g)].map(match => [match[1], 'sample']));expect(translate('zh-CN', source, values)).not.toMatch(/\{\w+\}/);- expect(translate('zh-CN', source, values)).not.toBe(source);for (const { locale } of languages.filter(language => language.locale !== 'zh-CN')) {- expect(translate(locale, source, values)).toBe(translate('en', source, values));+ if (!mvpMessages[locale]?.[source] && (locale === 'en' || !dictionaries[locale]?.[source])) expect(translate(locale, source, values)).toBe(translate('en', source, values));}}});++it('covers phase-one additions in all nine other languages without losing placeholders', () => {+ const keys = Object.keys(mvpUi.de).sort();+ expect(Object.keys(mvpUi).sort()).toEqual(languages.map(l => l.locale).filter(l => l !== 'en' && l !== 'zh-CN').sort());+ for (const [locale, messages] of Object.entries(mvpUi)) {+ expect(Object.keys(messages).sort(), locale).toEqual(keys);+ for (const [source, value] of Object.entries(messages)) {+ expect(value.trim(), `${locale}: ${source}`).toBeTruthy();+ const placeholders = (text: string) => [...text.matchAll(/\{\w+\}/g)].map(match => match[0]).sort();+ expect(placeholders(value), `${locale}: ${source}`).toEqual(placeholders(source));+ }+ }+});++it('localizes audited controls and history without translating authored names', () => {+ expect(translate('de', 'Undo')).toBe('Rückgängig');+ expect(translate('ru', 'Align left')).toBe('По левому краю');+ expect(translate('ja', 'Expand')).toBe('展開');+ for (const { locale } of languages.filter(l => l.locale !== 'en')) {+ const t = (message: string, values?: Record<string, string | number>) => translate(locale, message, values);+ for (const key of ['Expand left panel', 'Split', 'Import files', 'Took {value0}', 'Edit layer style', 'Move timeline clips']) {+ expect(t(key), `${locale}: ${key}`).not.toBe(key);+ }+ expect(historyEntryLabel('Hide track 2', t)).toContain('2');+ expect(historyEntryLabel('Hide track 2', t)).not.toBe('Hide track 2');+ expect(historyEntryLabel('Undid: Move timeline clips', t)).toContain(t('Move timeline clips'));+ expect(historyEntryLabel('Add block: My Custom Title', t)).toContain('My Custom Title');+ expect(historyEntryLabel('My authored version name', t)).toBe('My authored version name');+ }+});diff --git a/studio/src/i18n/messages.ts b/studio/src/i18n/messages.tsindex 90318918..7de4e837 100644--- a/studio/src/i18n/messages.ts+++ b/studio/src/i18n/messages.ts@@ -1,5 +1,7 @@import zhCN from './zh-CN.json';import mvpZhCN from './mvp-zh-CN.json';+import mvpUi from './mvp-ui.json';+import errorUi from './error-ui.json';import ja from './ja.json';import ko from './ko.json';import de from './de.json';@@ -26,12 +28,11 @@ export const dictionaries: Record<Exclude<Locale, 'en'>, Record<string, Message>'zh-CN': zhCN, ja, ko, de, fr, ru, es, 'pt-BR': ptBR, it, tr,};export const isLocale = (value: unknown): value is Locale => languages.some(language => language.locale === value);-// The MVP interaction audit adds Chinese/English terminology independently of-// the shared eleven-language vocabulary. Other locales retain English fallback-// for these additions until their translations are reviewed.-export const mvpMessages: Partial<Record<Locale, Record<string, Message>>> = { 'zh-CN': mvpZhCN };-const effectiveDictionaries = Object.fromEntries(Object.entries(dictionaries).map(([locale, messages]) =>- [locale, { ...messages, ...mvpMessages[locale as Locale] }],+// Phase-one UI additions and terminology corrections are localized in every+// supported language. Retained, unexposed advanced-editor strings still fall back.+export const mvpMessages: Partial<Record<Locale, Record<string, Message>>> = { 'zh-CN': mvpZhCN, ...mvpUi };+const effectiveDictionaries: Record<string, Record<string, Message>> = Object.fromEntries(Object.entries(dictionaries).map(([locale, messages]) =>+ [locale, { ...messages, ...mvpMessages[locale as Locale], ...errorUi[locale as keyof typeof errorUi] }],));const reverse = Object.fromEntries(Object.entries(effectiveDictionaries).map(([locale, messages]) => [locale,new Map(Object.entries(messages).flatMap(([source, value]) => (typeof value === 'string' ? [value] : Object.values(value)).map(text => [text, source]))),diff --git a/studio/src/i18n/mvp-ui.json b/studio/src/i18n/mvp-ui.jsonnew file mode 100644index 00000000..186f3c75--- /dev/null+++ b/studio/src/i18n/mvp-ui.json@@ -0,0 +1,1703 @@+{+ "ja": {+ "Expand": "展開",+ "Collapse": "折りたたむ",+ "Expand left panel": "左パネルを展開",+ "Collapse left panel": "左パネルを折りたたむ",+ "Expand right panel": "右パネルを展開",+ "Collapse right panel": "右パネルを折りたたむ",+ "Left panels": "左パネル",+ "Right panels": "右パネル",+ "Expand preview": "プレビューを拡大",+ "Restore preview": "プレビューを元に戻す",+ "Align left": "左揃え",+ "Align center": "中央揃え",+ "Align right": "右揃え",+ "Increase": "増やす",+ "Decrease": "減らす",+ "Split": "分割",+ "Import files": "ファイルを読み込む",+ "Projects": "プロジェクト",+ "Project list": "プロジェクト一覧",+ "Open active project": "現在のプロジェクトを開く",+ "System": "システム",+ "Imported": "読み込み済み",+ "Document": "ドキュメント",+ "Current": "現在",+ "Took {value0}": "所要時間 {value0}",+ "Change volume": "音量を変更",+ "Fade in": "フェードイン",+ "Fade out": "フェードアウト",+ "Timeline track view": "タイムライントラック表示",+ "Project assets": "プロジェクト素材",+ "Code Animations": "コードアニメーション",+ "VFX": "視覚効果",+ "Transitions": "トランジション",+ "Text Effects": "テキスト効果",+ "Social": "SNS",+ "Data": "データ",+ "Scenes": "シーン",+ "Fill: {fill} · {opacity}%": "塗り: {fill} · {opacity}%",+ "Image/gradient": "画像/グラデーション",+ "Choose…": "選択…",+ "Canvas": "キャンバス",+ "Panels": "パネル",+ "File on disk": "ディスク上のファイル",+ "Unsaved Studio version": "Studio の未保存バージョン",+ "Row": "行",+ "Column": "列",+ "Bring to front": "最前面へ移動",+ "Bring forward": "前面へ移動",+ "Send backward": "背面へ移動",+ "Send to back": "最背面へ移動",+ "Top": "上",+ "Right": "右",+ "Bottom": "下",+ "Left": "左",+ "playhead": "再生ヘッド",+ "clip edge": "クリップの端",+ "beat": "ビート",+ "grid line": "グリッド線",+ "Zoomed {percent}%": "表示倍率 {percent}%",+ "Panned": "表示位置を移動",+ "Undo": "元に戻す",+ "Redo": "やり直す",+ "Undo: {label}": "元に戻す: {label}",+ "Redo: {label}": "やり直す: {label}",+ "Composition canvas": "コンポジションのキャンバス",+ "Version history": "バージョン履歴",+ "Undone": "取り消し済み",+ "track": "トラック",+ "this track": "このトラック",+ "Click any element on the canvas to edit it.": "キャンバス上の要素をクリックして編集します。",+ "Create a project with your Agent to start editing.": "Agent でプロジェクトを作成すると、編集を開始できます。",+ "Import files or describe your video to your Agent.": "ファイルを読み込むか、作りたい動画を Agent に伝えてください。",+ "Everyday video, widely compatible.": "幅広い環境で再生できる標準的な動画形式です。",+ "Transparent video for editing. Larger files.": "透明背景に対応した編集向け動画です。ファイルサイズは大きくなります。",+ "Transparent video for web. Limited editor support.": "Web 向けの透明背景動画です。一部の編集ソフトでは非対応です。",+ "Animated image, no audio. Up to 30 fps.": "音声なしのアニメーション画像です。最大 30 fps。",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "クリップの分割したい位置をクリックします。移動や選択をするには選択ツールに戻してください。",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "有効にすると、ドラッグ中のクリップが近くのクリップ端や再生ヘッドに吸着し、位置を合わせやすくなります。",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "選択したクリップが表示範囲に収まるようタイムラインを調整し、細かい編集をしやすくします。",+ "First select one or more clips in the timeline, then use this to fit them into view.": "まずタイムラインでクリップを選択し、このボタンで選択範囲を画面に合わせます。",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "タイムライン全体を表示幅に合わせます。表示のみが変わり、動画の長さは変わりません。",+ "Return to the editor layout. You can also press Esc.": "編集画面のレイアウトに戻ります。Esc キーでも戻れます。",+ "Enlarge the preview within this workspace, keeping your chat visible.": "チャットを表示したまま、ワークスペース内でプレビューを広げます。",+ "Split (move playhead inside clip)": "分割(再生ヘッドをクリップ内に移動)",+ "Edit layer style": "レイヤースタイルを編集",+ "Move layer": "レイヤーを移動",+ "Rotate layer": "レイヤーを回転",+ "Resize layer": "レイヤーのサイズを変更",+ "Resize layer box": "レイヤー枠のサイズを変更",+ "Reset layer edits": "レイヤーの編集をリセット",+ "Reorder layers": "レイヤーを並べ替え",+ "Edit text": "テキストを編集",+ "Edit timing": "タイミングを編集",+ "Edit source": "ソースを編集",+ "Delete element": "要素を削除",+ "Add timeline asset": "素材をタイムラインに追加",+ "Add composition to timeline": "コンポジションをタイムラインに追加",+ "Move timeline clip": "タイムラインのクリップを移動",+ "Move timeline clips": "タイムラインのクリップを移動",+ "Resize timeline clip": "タイムラインのクリップ長を変更",+ "Resize timeline clips": "タイムラインのクリップ長を変更",+ "Split timeline clip": "タイムラインのクリップを分割",+ "Duplicate clip": "クリップを複製",+ "Duplicate clips": "クリップを複製",+ "Paste clip": "クリップを貼り付け",+ "Paste clips": "クリップを貼り付け",+ "Move clip": "クリップを移動",+ "Trim clip": "クリップをトリミング",+ "Split clip": "クリップを分割",+ "Resize": "サイズ変更",+ "Unlink clips": "クリップのリンクを解除",+ "Link clips": "クリップをリンク",+ "Detach audio": "音声を分離",+ "Merge audio back into video": "音声を動画に戻す",+ "Delete this clip only": "このクリップだけ削除",+ "Copied clip": "クリップをコピーしました",+ "Copied {count} clips": "{count} 個のクリップをコピーしました",+ "Copied element": "要素をコピーしました",+ "Pasted clip": "クリップを貼り付けました",+ "Pasted {count} clips": "{count} 個のクリップを貼り付けました",+ "Pasted element": "要素を貼り付けました",+ "Duplicated clip": "クリップを複製しました",+ "Duplicated {count} clips": "{count} 個のクリップを複製しました",+ "Failed to copy": "コピーできませんでした",+ "Failed to paste": "貼り付けできませんでした",+ "Failed to duplicate": "複製できませんでした",+ "Failed to split timeline clip": "クリップを分割できませんでした",+ "Failed to split clips": "クリップを分割できませんでした",+ "Undid: {label}": "取り消しました: {label}",+ "Redid: {label}": "やり直しました: {label}",+ "Undid {label}": "取り消しました: {label}",+ "Redid {label}": "やり直しました: {label}",+ "undo": "元に戻す",+ "redo": "やり直す",+ "Split {name} at {time}s": "{name} を {time} 秒で分割",+ "Split {count} clips at {time}s": "{count} 個のクリップを {time} 秒で分割",+ "Add block: {name}": "ブロックを追加: {name}",+ "Add component: {name}": "コンポーネントを追加: {name}",+ "Adding {name}…": "{name} を追加中…",+ "Failed to install block": "ブロックをインストールできませんでした",+ "Install failed": "インストールできませんでした",+ "Failed to add block": "ブロックを追加できませんでした",+ "{title} opened": "{title} を開きました",+ "{title} closed": "{title} を閉じました",+ "{title} maximized": "{title} を最大化しました",+ "{title} restored": "{title} を元に戻しました",+ "No playable video found. Export a video file and try again.": "再生可能な動画が見つかりません。動画ファイルを書き出して再度お試しください。",+ "No playable audio found. Export an audio file and try again.": "再生可能な音声が見つかりません。音声ファイルを書き出して再度お試しください。",+ "Cannot read this media file. Check that it is complete or export it again.": "このメディアを読み込めません。ファイルが完全か確認するか、再度書き出してください。",+ "Cannot read the media information. Export the file again and retry.": "メディア情報を読み込めません。ファイルを再度書き出してお試しください。",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "メディア検証を開始できません。ローカルのメディアツール設定を確認して再試行してください。",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "メディア検証は利用できません。ファイルは追加されましたが、再生は未確認です。",+ "Could not validate this media file. Check the file and retry.": "このメディアを検証できませんでした。ファイルを確認して再試行してください。",+ "The project changed. Refresh the editor before trying again.": "プロジェクトが変更されました。編集画面を再読み込みしてから再試行してください。",+ "Cannot connect to the preview service. Check the connection and retry.": "プレビューサービスに接続できません。接続を確認して再試行してください。",+ "The operation could not be completed. Check the project and retry.": "操作を完了できませんでした。プロジェクトを確認して再試行してください。",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "分割を安全に取り消せませんでした。再読み込みし、プロジェクトを確認してから編集を続けてください。",+ "The project changed during splitting. Refresh the editor and retry.": "分割中にプロジェクトが変更されました。編集画面を再読み込みして再試行してください。",+ "Cannot read the latest clip source. Refresh the editor and retry.": "最新のクリップソースを読み込めません。編集画面を再読み込みして再試行してください。",+ "This clip cannot be split. Select a different clip.": "このクリップは分割できません。別のクリップを選択してください。",+ "Could not split the clip. Check the current clip and retry.": "クリップを分割できませんでした。現在のクリップを確認して再試行してください。",+ "Nothing selected to copy.": "コピーする要素が選択されていません。",+ "Nothing to paste.": "貼り付けるものがありません。",+ "Couldn't copy to the clipboard. Check browser permissions": "クリップボードにコピーできませんでした。ブラウザーの権限を確認してください",+ "Preview not ready. Try again": "プレビューの準備ができていません。再試行してください",+ "Select an element first": "まず要素を選択してください",+ "{value0} track{suffix}": "トラック{suffix}を{value0}",+ "{value0} tracks": "{value0} トラック",+ "{value0} {label} tracks": "{value0} 個の {label} トラック",+ "Show track {number}": "トラック {number} を表示",+ "Hide track {number}": "トラック {number} を非表示",+ "Search projects": "プロジェクトを検索",+ "Search projects…": "プロジェクトを検索…",+ "Toggle timeline snapping": "タイムラインのスナップを切り替え",+ "Snapping on ({value0})": "スナップ有効({value0})",+ "Snapping off ({value0})": "スナップ無効({value0})",+ "Fit timeline to width": "タイムライン全体を表示",+ "Zoom to selected clips": "選択クリップに表示を合わせる",+ "Zoom to selected clips ({value0})": "選択クリップに表示を合わせる({value0})",+ "Select a clip to zoom the timeline": "表示を合わせるクリップを選択してください",+ "Delete timeline clip": "タイムラインのクリップを削除",+ "Move animation path": "アニメーションパスを移動",+ "Edit x (whole animation)": "X 座標を変更(アニメーション全体)",+ "Edit y (whole animation)": "Y 座標を変更(アニメーション全体)",+ "No clips yet": "クリップはまだありません",+ "No editable content": "編集できる内容がありません",+ "No content to export. Add media first.": "書き出す内容がありません。先に素材を追加してください。"+ },+ "ko": {+ "Expand": "펼치기",+ "Collapse": "접기",+ "Expand left panel": "왼쪽 패널 펼치기",+ "Collapse left panel": "왼쪽 패널 접기",+ "Expand right panel": "오른쪽 패널 펼치기",+ "Collapse right panel": "오른쪽 패널 접기",+ "Left panels": "왼쪽 패널",+ "Right panels": "오른쪽 패널",+ "Expand preview": "미리보기 확장",+ "Restore preview": "미리보기 복원",+ "Align left": "왼쪽 정렬",+ "Align center": "가운데 정렬",+ "Align right": "오른쪽 정렬",+ "Increase": "늘리기",+ "Decrease": "줄이기",+ "Split": "분할",+ "Import files": "파일 가져오기",+ "Projects": "프로젝트",+ "Project list": "프로젝트 목록",+ "Open active project": "현재 프로젝트 열기",+ "System": "시스템",+ "Imported": "가져옴",+ "Document": "문서",+ "Current": "현재",+ "Took {value0}": "소요 시간 {value0}",+ "Change volume": "음량 변경",+ "Fade in": "페이드 인",+ "Fade out": "페이드 아웃",+ "Timeline track view": "타임라인 트랙 보기",+ "Project assets": "프로젝트 미디어",+ "Code Animations": "코드 애니메이션",+ "VFX": "시각 효과",+ "Transitions": "전환",+ "Text Effects": "텍스트 효과",+ "Social": "소셜",+ "Data": "데이터",+ "Scenes": "장면",+ "Fill: {fill} · {opacity}%": "채우기: {fill} · {opacity}%",+ "Image/gradient": "이미지/그라디언트",+ "Choose…": "선택…",+ "Canvas": "캔버스",+ "Panels": "패널",+ "File on disk": "디스크의 파일",+ "Unsaved Studio version": "Studio의 미저장 버전",+ "Row": "행",+ "Column": "열",+ "Bring to front": "맨 앞으로",+ "Bring forward": "앞으로",+ "Send backward": "뒤로",+ "Send to back": "맨 뒤로",+ "Top": "위",+ "Right": "오른쪽",+ "Bottom": "아래",+ "Left": "왼쪽",+ "playhead": "재생 헤드",+ "clip edge": "클립 가장자리",+ "beat": "비트",+ "grid line": "격자선",+ "Zoomed {percent}%": "확대율 {percent}%",+ "Panned": "보기 이동됨",+ "Undo": "실행 취소",+ "Redo": "다시 실행",+ "Undo: {label}": "실행 취소: {label}",+ "Redo: {label}": "다시 실행: {label}",+ "Composition canvas": "컴포지션 캔버스",+ "Version history": "버전 기록",+ "Undone": "실행 취소됨",+ "track": "트랙",+ "this track": "이 트랙",+ "Click any element on the canvas to edit it.": "캔버스의 요소를 클릭하여 편집하세요.",+ "Create a project with your Agent to start editing.": "Agent와 프로젝트를 만든 후 편집을 시작하세요.",+ "Import files or describe your video to your Agent.": "파일을 가져오거나 원하는 영상을 Agent에게 설명하세요.",+ "Everyday video, widely compatible.": "호환성이 높은 일반 동영상 형식입니다.",+ "Transparent video for editing. Larger files.": "투명 배경을 지원하는 편집용 동영상입니다. 파일 크기가 큽니다.",+ "Transparent video for web. Limited editor support.": "웹용 투명 배경 동영상입니다. 지원하는 편집기가 제한적입니다.",+ "Animated image, no audio. Up to 30 fps.": "오디오가 없는 애니메이션 이미지입니다. 최대 30fps.",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "클립에서 나눌 위치를 클릭하세요. 이동하거나 선택하려면 선택 도구로 돌아가세요.",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "활성화하면 드래그하는 클립이 가까운 클립 가장자리와 재생 헤드에 맞춰져 정렬하기 쉬워집니다.",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "선택한 클립이 표시 영역에 맞도록 타임라인을 조정하여 세밀하게 편집할 수 있습니다.",+ "First select one or more clips in the timeline, then use this to fit them into view.": "먼저 타임라인에서 클립을 선택한 다음 이 버튼으로 표시 영역에 맞추세요.",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "전체 타임라인을 표시 너비에 맞춥니다. 보기만 바뀌며 동영상 길이는 변하지 않습니다.",+ "Return to the editor layout. You can also press Esc.": "편집기 레이아웃으로 돌아갑니다. Esc 키로도 돌아갈 수 있습니다.",+ "Enlarge the preview within this workspace, keeping your chat visible.": "채팅을 유지하면서 작업 공간 안에서 미리보기를 넓힙니다.",+ "Split (move playhead inside clip)": "분할(재생 헤드를 클립 안으로 이동)",+ "Edit layer style": "레이어 스타일 편집",+ "Move layer": "레이어 이동",+ "Rotate layer": "레이어 회전",+ "Resize layer": "레이어 크기 조절",+ "Resize layer box": "레이어 상자 크기 조절",+ "Reset layer edits": "레이어 편집 초기화",+ "Reorder layers": "레이어 순서 변경",+ "Edit text": "텍스트 편집",+ "Edit timing": "타이밍 편집",+ "Edit source": "소스 편집",+ "Delete element": "요소 삭제",+ "Add timeline asset": "타임라인에 미디어 추가",+ "Add composition to timeline": "타임라인에 컴포지션 추가",+ "Move timeline clip": "타임라인 클립 이동",+ "Move timeline clips": "타임라인 클립 이동",+ "Resize timeline clip": "타임라인 클립 길이 조절",+ "Resize timeline clips": "타임라인 클립 길이 조절",+ "Split timeline clip": "타임라인 클립 분할",+ "Duplicate clip": "클립 복제",+ "Duplicate clips": "클립 복제",+ "Paste clip": "클립 붙여넣기",+ "Paste clips": "클립 붙여넣기",+ "Move clip": "클립 이동",+ "Trim clip": "클립 다듬기",+ "Split clip": "클립 분할",+ "Resize": "크기 조절",+ "Unlink clips": "클립 연결 해제",+ "Link clips": "클립 연결",+ "Detach audio": "오디오 분리",+ "Merge audio back into video": "오디오를 동영상에 다시 결합",+ "Delete this clip only": "이 클립만 삭제",+ "Copied clip": "클립 복사됨",+ "Copied {count} clips": "클립 {count}개 복사됨",+ "Copied element": "요소 복사됨",+ "Pasted clip": "클립 붙여넣음",+ "Pasted {count} clips": "클립 {count}개 붙여넣음",+ "Pasted element": "요소 붙여넣음",+ "Duplicated clip": "클립 복제됨",+ "Duplicated {count} clips": "클립 {count}개 복제됨",+ "Failed to copy": "복사 실패",+ "Failed to paste": "붙여넣기 실패",+ "Failed to duplicate": "복제 실패",+ "Failed to split timeline clip": "타임라인 클립 분할 실패",+ "Failed to split clips": "클립 분할 실패",+ "Undid: {label}": "실행 취소됨: {label}",+ "Redid: {label}": "다시 실행됨: {label}",+ "Undid {label}": "실행 취소됨: {label}",+ "Redid {label}": "다시 실행됨: {label}",+ "undo": "실행 취소",+ "redo": "다시 실행",+ "Split {name} at {time}s": "{name}을(를) {time}초에서 분할",+ "Split {count} clips at {time}s": "클립 {count}개를 {time}초에서 분할",+ "Add block: {name}": "블록 추가: {name}",+ "Add component: {name}": "컴포넌트 추가: {name}",+ "Adding {name}…": "{name} 추가 중…",+ "Failed to install block": "블록 설치 실패",+ "Install failed": "설치 실패",+ "Failed to add block": "블록 추가 실패",+ "{title} opened": "{title} 열림",+ "{title} closed": "{title} 닫힘",+ "{title} maximized": "{title} 최대화됨",+ "{title} restored": "{title} 복원됨",+ "No playable video found. Export a video file and try again.": "재생 가능한 동영상이 없습니다. 동영상 파일로 내보낸 후 다시 시도하세요.",+ "No playable audio found. Export an audio file and try again.": "재생 가능한 오디오가 없습니다. 오디오 파일로 내보낸 후 다시 시도하세요.",+ "Cannot read this media file. Check that it is complete or export it again.": "미디어 파일을 읽을 수 없습니다. 파일이 온전한지 확인하거나 다시 내보내세요.",+ "Cannot read the media information. Export the file again and retry.": "미디어 정보를 읽을 수 없습니다. 파일을 다시 내보내고 시도하세요.",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "미디어 검사를 시작할 수 없습니다. 로컬 미디어 도구 설정을 확인하고 다시 시도하세요.",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "미디어 검사를 사용할 수 없습니다. 파일은 추가되었지만 재생 여부는 확인되지 않았습니다.",+ "Could not validate this media file. Check the file and retry.": "미디어 파일을 검증하지 못했습니다. 파일을 확인하고 다시 시도하세요.",+ "The project changed. Refresh the editor before trying again.": "프로젝트가 변경되었습니다. 편집기를 새로고침한 후 다시 시도하세요.",+ "Cannot connect to the preview service. Check the connection and retry.": "미리보기 서비스에 연결할 수 없습니다. 연결을 확인하고 다시 시도하세요.",+ "The operation could not be completed. Check the project and retry.": "작업을 완료하지 못했습니다. 프로젝트를 확인하고 다시 시도하세요.",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "분할을 안전하게 되돌리지 못했습니다. 다시 편집하기 전에 새로고침하고 프로젝트를 확인하세요.",+ "The project changed during splitting. Refresh the editor and retry.": "분할 중 프로젝트가 변경되었습니다. 편집기를 새로고침하고 다시 시도하세요.",+ "Cannot read the latest clip source. Refresh the editor and retry.": "최신 클립 소스를 읽을 수 없습니다. 편집기를 새로고침하고 다시 시도하세요.",+ "This clip cannot be split. Select a different clip.": "이 클립은 분할할 수 없습니다. 다른 클립을 선택하세요.",+ "Could not split the clip. Check the current clip and retry.": "클립을 분할하지 못했습니다. 현재 클립을 확인하고 다시 시도하세요.",+ "Nothing selected to copy.": "복사할 항목이 선택되지 않았습니다.",+ "Nothing to paste.": "붙여넣을 항목이 없습니다.",+ "Couldn't copy to the clipboard. Check browser permissions": "클립보드에 복사하지 못했습니다. 브라우저 권한을 확인하세요",+ "Preview not ready. Try again": "미리보기가 준비되지 않았습니다. 다시 시도하세요",+ "Select an element first": "먼저 요소를 선택하세요",+ "{value0} track{suffix}": "트랙{suffix} {value0}",+ "{value0} tracks": "트랙 {value0}개",+ "{value0} {label} tracks": "{label} 트랙 {value0}개",+ "Show track {number}": "트랙 {number} 표시",+ "Hide track {number}": "트랙 {number} 숨기기",+ "Search projects": "프로젝트 검색",+ "Search projects…": "프로젝트 검색…",+ "Toggle timeline snapping": "타임라인 스냅 전환",+ "Snapping on ({value0})": "스냅 켜짐 ({value0})",+ "Snapping off ({value0})": "스냅 꺼짐 ({value0})",+ "Fit timeline to width": "타임라인을 너비에 맞추기",+ "Zoom to selected clips": "선택한 클립에 맞추기",+ "Zoom to selected clips ({value0})": "선택한 클립에 맞추기 ({value0})",+ "Select a clip to zoom the timeline": "화면에 맞출 클립을 선택하세요",+ "Delete timeline clip": "타임라인 클립 삭제",+ "Move animation path": "애니메이션 경로 이동",+ "Edit x (whole animation)": "X 좌표 편집(전체 애니메이션)",+ "Edit y (whole animation)": "Y 좌표 편집(전체 애니메이션)",+ "No clips yet": "아직 클립이 없습니다",+ "No editable content": "편집할 콘텐츠가 없습니다",+ "No content to export. Add media first.": "내보낼 콘텐츠가 없습니다. 먼저 미디어를 추가하세요."+ },+ "de": {+ "Expand": "Erweitern",+ "Collapse": "Einklappen",+ "Expand left panel": "Linken Bereich öffnen",+ "Collapse left panel": "Linken Bereich schließen",+ "Expand right panel": "Rechten Bereich öffnen",+ "Collapse right panel": "Rechten Bereich schließen",+ "Left panels": "Linke Bereiche",+ "Right panels": "Rechte Bereiche",+ "Expand preview": "Vorschau erweitern",+ "Restore preview": "Vorschau zurücksetzen",+ "Align left": "Linksbündig",+ "Align center": "Zentriert",+ "Align right": "Rechtsbündig",+ "Increase": "Erhöhen",+ "Decrease": "Verringern",+ "Split": "Teilen",+ "Import files": "Dateien importieren",+ "Projects": "Projekte",+ "Project list": "Projektliste",+ "Open active project": "Aktuelles Projekt öffnen",+ "System": "System",+ "Imported": "Importiert",+ "Document": "Dokument",+ "Current": "Aktuell",+ "Took {value0}": "Dauer: {value0}",+ "Change volume": "Lautstärke ändern",+ "Fade in": "Einblenden",+ "Fade out": "Ausblenden",+ "Timeline track view": "Zeitleistenspuren",+ "Project assets": "Projektmedien",+ "Code Animations": "Code-Animationen",+ "VFX": "Visuelle Effekte",+ "Transitions": "Übergänge",+ "Text Effects": "Texteffekte",+ "Social": "Social Media",+ "Data": "Daten",+ "Scenes": "Szenen",+ "Fill: {fill} · {opacity}%": "Füllung: {fill} · {opacity}%",+ "Image/gradient": "Bild/Verlauf",+ "Choose…": "Auswählen…",+ "Canvas": "Arbeitsfläche",+ "Panels": "Bereiche",+ "File on disk": "Datei auf Datenträger",+ "Unsaved Studio version": "Ungespeicherte Studio-Version",+ "Row": "Zeile",+ "Column": "Spalte",+ "Bring to front": "Ganz nach vorne",+ "Bring forward": "Nach vorne",+ "Send backward": "Nach hinten",+ "Send to back": "Ganz nach hinten",+ "Top": "Oben",+ "Right": "Rechts",+ "Bottom": "Unten",+ "Left": "Links",+ "playhead": "Abspielkopf",+ "clip edge": "Clipkante",+ "beat": "Beat",+ "grid line": "Rasterlinie",+ "Zoomed {percent}%": "Zoom: {percent}%",+ "Panned": "Ansicht verschoben",+ "Undo": "Rückgängig",+ "Redo": "Wiederherstellen",+ "Undo: {label}": "Rückgängig: {label}",+ "Redo: {label}": "Wiederherstellen: {label}",+ "Composition canvas": "Kompositionsfläche",+ "Version history": "Versionsverlauf",+ "Undone": "Rückgängig gemacht",+ "track": "Spur",+ "this track": "diese Spur",+ "Click any element on the canvas to edit it.": "Zum Bearbeiten ein Element auf der Arbeitsfläche anklicken.",+ "Create a project with your Agent to start editing.": "Erstelle mit deinem Agent ein Projekt, um mit der Bearbeitung zu beginnen.",+ "Import files or describe your video to your Agent.": "Importiere Dateien oder beschreibe deinem Agent das gewünschte Video.",+ "Everyday video, widely compatible.": "Gängiges Videoformat mit breiter Unterstützung.",+ "Transparent video for editing. Larger files.": "Video mit Transparenz zur Weiterbearbeitung. Größere Dateien.",+ "Transparent video for web. Limited editor support.": "Transparentes Video fürs Web. Begrenzte Unterstützung in Editoren.",+ "Animated image, no audio. Up to 30 fps.": "Animiertes Bild ohne Ton. Bis zu 30 fps.",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "Klicke auf die gewünschte Schnittstelle im Clip. Zum Verschieben oder Auswählen zum Auswahlwerkzeug wechseln.",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "Beim Ziehen rasten Clips an nahen Clipkanten und am Abspielkopf ein, damit sie sich leichter ausrichten lassen.",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "Passt die Zeitleiste an die ausgewählten Clips an und erleichtert präzises Bearbeiten.",+ "First select one or more clips in the timeline, then use this to fit them into view.": "Wähle zuerst einen oder mehrere Clips aus. Mit diesem Knopf werden sie in die Ansicht eingepasst.",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "Zeigt die ganze Zeitleiste in der verfügbaren Breite. Nur die Ansicht ändert sich, nicht die Videodauer.",+ "Return to the editor layout. You can also press Esc.": "Zurück zur Editoransicht. Auch mit Esc möglich.",+ "Enlarge the preview within this workspace, keeping your chat visible.": "Vergrößert die Vorschau im Arbeitsbereich, während der Chat sichtbar bleibt.",+ "Split (move playhead inside clip)": "Teilen (Abspielkopf im Clip platzieren)",+ "Edit layer style": "Ebenenstil ändern",+ "Move layer": "Ebene verschieben",+ "Rotate layer": "Ebene drehen",+ "Resize layer": "Ebenengröße ändern",+ "Resize layer box": "Ebenenrahmen skalieren",+ "Reset layer edits": "Ebenenänderungen zurücksetzen",+ "Reorder layers": "Ebenen neu anordnen",+ "Edit text": "Text bearbeiten",+ "Edit timing": "Zeitpunkte bearbeiten",+ "Edit source": "Quelltext bearbeiten",+ "Delete element": "Element löschen",+ "Add timeline asset": "Medium zur Zeitleiste hinzufügen",+ "Add composition to timeline": "Komposition zur Zeitleiste hinzufügen",+ "Move timeline clip": "Zeitleistenclip verschieben",+ "Move timeline clips": "Zeitleistenclips verschieben",+ "Resize timeline clip": "Zeitleistenclip verlängern/kürzen",+ "Resize timeline clips": "Zeitleistenclips verlängern/kürzen",+ "Split timeline clip": "Zeitleistenclip teilen",+ "Duplicate clip": "Clip duplizieren",+ "Duplicate clips": "Clips duplizieren",+ "Paste clip": "Clip einfügen",+ "Paste clips": "Clips einfügen",+ "Move clip": "Clip verschieben",+ "Trim clip": "Clip trimmen",+ "Split clip": "Clip teilen",+ "Resize": "Größe ändern",+ "Unlink clips": "Clips entkoppeln",+ "Link clips": "Clips verknüpfen",+ "Detach audio": "Audio abtrennen",+ "Merge audio back into video": "Audio wieder mit Video verbinden",+ "Delete this clip only": "Nur diesen Clip löschen",+ "Copied clip": "Clip kopiert",+ "Copied {count} clips": "Clips kopiert: {count}",+ "Copied element": "Element kopiert",+ "Pasted clip": "Clip eingefügt",+ "Pasted {count} clips": "Clips eingefügt: {count}",+ "Pasted element": "Element eingefügt",+ "Duplicated clip": "Clip dupliziert",+ "Duplicated {count} clips": "Clips dupliziert: {count}",+ "Failed to copy": "Kopieren fehlgeschlagen",+ "Failed to paste": "Einfügen fehlgeschlagen",+ "Failed to duplicate": "Duplizieren fehlgeschlagen",+ "Failed to split timeline clip": "Clip konnte nicht geteilt werden",+ "Failed to split clips": "Clips konnten nicht geteilt werden",+ "Undid: {label}": "Rückgängig gemacht: {label}",+ "Redid: {label}": "Wiederhergestellt: {label}",+ "Undid {label}": "Rückgängig gemacht: {label}",+ "Redid {label}": "Wiederhergestellt: {label}",+ "undo": "rückgängig machen",+ "redo": "wiederherstellen",+ "Split {name} at {time}s": "{name} bei {time}s teilen",+ "Split {count} clips at {time}s": "{count} Clips bei {time}s teilen",+ "Add block: {name}": "Baustein hinzufügen: {name}",+ "Add component: {name}": "Komponente hinzufügen: {name}",+ "Adding {name}…": "{name} wird hinzugefügt…",+ "Failed to install block": "Baustein konnte nicht installiert werden",+ "Install failed": "Installation fehlgeschlagen",+ "Failed to add block": "Baustein konnte nicht hinzugefügt werden",+ "{title} opened": "{title} geöffnet",+ "{title} closed": "{title} geschlossen",+ "{title} maximized": "{title} maximiert",+ "{title} restored": "{title} wiederhergestellt",+ "No playable video found. Export a video file and try again.": "Kein abspielbares Video gefunden. Exportiere eine Videodatei und versuche es erneut.",+ "No playable audio found. Export an audio file and try again.": "Kein abspielbares Audio gefunden. Exportiere eine Audiodatei und versuche es erneut.",+ "Cannot read this media file. Check that it is complete or export it again.": "Die Mediendatei kann nicht gelesen werden. Prüfe sie auf Vollständigkeit oder exportiere sie erneut.",+ "Cannot read the media information. Export the file again and retry.": "Medieninformationen können nicht gelesen werden. Exportiere die Datei erneut und versuche es noch einmal.",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "Die Medienprüfung startet nicht. Prüfe die lokale Medientool-Konfiguration und versuche es erneut.",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "Medienprüfung nicht verfügbar. Die Datei wurde hinzugefügt, ihre Wiedergabe aber nicht geprüft.",+ "Could not validate this media file. Check the file and retry.": "Die Mediendatei konnte nicht geprüft werden. Prüfe die Datei und versuche es erneut.",+ "The project changed. Refresh the editor before trying again.": "Das Projekt wurde geändert. Lade den Editor neu und versuche es erneut.",+ "Cannot connect to the preview service. Check the connection and retry.": "Keine Verbindung zum Vorschaudienst. Prüfe die Verbindung und versuche es erneut.",+ "The operation could not be completed. Check the project and retry.": "Der Vorgang konnte nicht abgeschlossen werden. Prüfe das Projekt und versuche es erneut.",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "Der Schnitt konnte nicht sicher rückgängig gemacht werden. Lade das Projekt neu und prüfe es vor weiteren Änderungen.",+ "The project changed during splitting. Refresh the editor and retry.": "Das Projekt wurde während des Teilens geändert. Lade den Editor neu und versuche es erneut.",+ "Cannot read the latest clip source. Refresh the editor and retry.": "Die aktuelle Clipquelle kann nicht gelesen werden. Lade den Editor neu und versuche es erneut.",+ "This clip cannot be split. Select a different clip.": "Dieser Clip kann nicht geteilt werden. Wähle einen anderen Clip.",+ "Could not split the clip. Check the current clip and retry.": "Der Clip konnte nicht geteilt werden. Prüfe den Clip und versuche es erneut.",+ "Nothing selected to copy.": "Nichts zum Kopieren ausgewählt.",+ "Nothing to paste.": "Nichts zum Einfügen.",+ "Couldn't copy to the clipboard. Check browser permissions": "Kopieren in die Zwischenablage fehlgeschlagen. Prüfe die Browserberechtigungen",+ "Preview not ready. Try again": "Vorschau noch nicht bereit. Erneut versuchen",+ "Select an element first": "Zuerst ein Element auswählen",+ "{value0} track{suffix}": "Spur{suffix}: {value0}",+ "{value0} tracks": "{value0} Spuren",+ "{value0} {label} tracks": "{value0} {label}-Spuren",+ "Show track {number}": "Spur {number} einblenden",+ "Hide track {number}": "Spur {number} ausblenden",+ "Search projects": "Projekte suchen",+ "Search projects…": "Projekte suchen…",+ "Toggle timeline snapping": "Einrasten umschalten",+ "Snapping on ({value0})": "Einrasten an ({value0})",+ "Snapping off ({value0})": "Einrasten aus ({value0})",+ "Fit timeline to width": "Zeitleiste einpassen",+ "Zoom to selected clips": "Auswahl einpassen",+ "Zoom to selected clips ({value0})": "Auswahl einpassen ({value0})",+ "Select a clip to zoom the timeline": "Zuerst einen Clip auswählen",+ "Delete timeline clip": "Zeitleistenclip löschen",+ "Move animation path": "Animationspfad verschieben",+ "Edit x (whole animation)": "X-Position ändern (gesamte Animation)",+ "Edit y (whole animation)": "Y-Position ändern (gesamte Animation)",+ "No clips yet": "Noch keine Clips",+ "No editable content": "Keine bearbeitbaren Inhalte",+ "No content to export. Add media first.": "Keine Inhalte zum Exportieren. Füge zuerst Medien hinzu."+ },+ "fr": {+ "Expand": "Développer",+ "Collapse": "Réduire",+ "Expand left panel": "Ouvrir le panneau gauche",+ "Collapse left panel": "Fermer le panneau gauche",+ "Expand right panel": "Ouvrir le panneau droit",+ "Collapse right panel": "Fermer le panneau droit",+ "Left panels": "Panneaux de gauche",+ "Right panels": "Panneaux de droite",+ "Expand preview": "Agrandir l’aperçu",+ "Restore preview": "Rétablir l’aperçu",+ "Align left": "Aligner à gauche",+ "Align center": "Centrer",+ "Align right": "Aligner à droite",+ "Increase": "Augmenter",+ "Decrease": "Diminuer",+ "Split": "Scinder",+ "Import files": "Importer des fichiers",+ "Projects": "Projets",+ "Project list": "Liste des projets",+ "Open active project": "Ouvrir le projet actif",+ "System": "Système",+ "Imported": "Importé",+ "Document": "Document",+ "Current": "Actuel",+ "Took {value0}": "Durée : {value0}",+ "Change volume": "Modifier le volume",+ "Fade in": "Fondu entrant",+ "Fade out": "Fondu sortant",+ "Timeline track view": "Pistes de la timeline",+ "Project assets": "Médias du projet",+ "Code Animations": "Animations par code",+ "VFX": "Effets visuels",+ "Transitions": "Transitions",+ "Text Effects": "Effets de texte",+ "Social": "Réseaux sociaux",+ "Data": "Données",+ "Scenes": "Scènes",+ "Fill: {fill} · {opacity}%": "Fond : {fill} · {opacity}%",+ "Image/gradient": "Image/dégradé",+ "Choose…": "Choisir…",+ "Canvas": "Zone de travail",+ "Panels": "Panneaux",+ "File on disk": "Fichier sur disque",+ "Unsaved Studio version": "Version Studio non enregistrée",+ "Row": "Ligne",+ "Column": "Colonne",+ "Bring to front": "Mettre au premier plan",+ "Bring forward": "Avancer",+ "Send backward": "Reculer",+ "Send to back": "Mettre à l’arrière-plan",+ "Top": "Haut",+ "Right": "Droite",+ "Bottom": "Bas",+ "Left": "Gauche",+ "playhead": "Tête de lecture",+ "clip edge": "Bord du clip",+ "beat": "Temps",+ "grid line": "Ligne de grille",+ "Zoomed {percent}%": "Zoom : {percent}%",+ "Panned": "Vue déplacée",+ "Undo": "Annuler",+ "Redo": "Rétablir",+ "Undo: {label}": "Annuler : {label}",+ "Redo: {label}": "Rétablir : {label}",+ "Composition canvas": "Zone de composition",+ "Version history": "Historique des versions",+ "Undone": "Annulé",+ "track": "piste",+ "this track": "cette piste",+ "Click any element on the canvas to edit it.": "Cliquez sur un élément de la zone de travail pour le modifier.",+ "Create a project with your Agent to start editing.": "Créez un projet avec votre Agent pour commencer à le modifier.",+ "Import files or describe your video to your Agent.": "Importez des fichiers ou décrivez votre vidéo à votre Agent.",+ "Everyday video, widely compatible.": "Format vidéo courant, largement compatible.",+ "Transparent video for editing. Larger files.": "Vidéo transparente pour le montage. Fichiers plus volumineux.",+ "Transparent video for web. Limited editor support.": "Vidéo transparente pour le Web. Prise en charge limitée par les logiciels de montage.",+ "Animated image, no audio. Up to 30 fps.": "Image animée sans audio. Jusqu’à 30 i/s.",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "Cliquez à l’endroit où scinder le clip. Revenez à l’outil de sélection pour déplacer ou sélectionner des clips.",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "Une fois activé, les clips déplacés s’alignent sur les bords voisins et la tête de lecture.",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "Ajuste la timeline aux clips sélectionnés pour faciliter les retouches précises.",+ "First select one or more clips in the timeline, then use this to fit them into view.": "Sélectionnez un ou plusieurs clips dans la timeline, puis utilisez ce bouton pour les afficher dans la vue.",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "Affiche toute la timeline dans la largeur disponible. Seule la vue change, pas la durée de la vidéo.",+ "Return to the editor layout. You can also press Esc.": "Revenir à la disposition de l’éditeur. Vous pouvez aussi appuyer sur Échap.",+ "Enlarge the preview within this workspace, keeping your chat visible.": "Agrandit l’aperçu dans l’espace de travail tout en gardant la discussion visible.",+ "Split (move playhead inside clip)": "Scinder (placer la tête de lecture dans le clip)",+ "Edit layer style": "Modifier le style du calque",+ "Move layer": "Déplacer le calque",+ "Rotate layer": "Faire pivoter le calque",+ "Resize layer": "Redimensionner le calque",+ "Resize layer box": "Redimensionner le cadre du calque",+ "Reset layer edits": "Réinitialiser les modifications du calque",+ "Reorder layers": "Réorganiser les calques",+ "Edit text": "Modifier le texte",+ "Edit timing": "Modifier le minutage",+ "Edit source": "Modifier la source",+ "Delete element": "Supprimer l’élément",+ "Add timeline asset": "Ajouter un média à la timeline",+ "Add composition to timeline": "Ajouter une composition à la timeline",+ "Move timeline clip": "Déplacer le clip dans la timeline",+ "Move timeline clips": "Déplacer les clips dans la timeline",+ "Resize timeline clip": "Modifier la durée du clip",+ "Resize timeline clips": "Modifier la durée des clips",+ "Split timeline clip": "Scinder le clip de la timeline",+ "Duplicate clip": "Dupliquer le clip",+ "Duplicate clips": "Dupliquer les clips",+ "Paste clip": "Coller le clip",+ "Paste clips": "Coller les clips",+ "Move clip": "Déplacer le clip",+ "Trim clip": "Rogner le clip",+ "Split clip": "Scinder le clip",+ "Resize": "Redimensionner",+ "Unlink clips": "Dissocier les clips",+ "Link clips": "Lier les clips",+ "Detach audio": "Détacher l’audio",+ "Merge audio back into video": "Réintégrer l’audio à la vidéo",+ "Delete this clip only": "Supprimer ce clip uniquement",+ "Copied clip": "Clip copié",+ "Copied {count} clips": "Clips copiés : {count}",+ "Copied element": "Élément copié",+ "Pasted clip": "Clip collé",+ "Pasted {count} clips": "Clips collés : {count}",+ "Pasted element": "Élément collé",+ "Duplicated clip": "Clip dupliqué",+ "Duplicated {count} clips": "Clips dupliqués : {count}",+ "Failed to copy": "Échec de la copie",+ "Failed to paste": "Échec du collage",+ "Failed to duplicate": "Échec de la duplication",+ "Failed to split timeline clip": "Impossible de scinder le clip",+ "Failed to split clips": "Impossible de scinder les clips",+ "Undid: {label}": "Annulé : {label}",+ "Redid: {label}": "Rétabli : {label}",+ "Undid {label}": "Annulé : {label}",+ "Redid {label}": "Rétabli : {label}",+ "undo": "annuler",+ "redo": "rétablir",+ "Split {name} at {time}s": "Scinder {name} à {time}s",+ "Split {count} clips at {time}s": "Scinder {count} clips à {time}s",+ "Add block: {name}": "Ajouter un bloc : {name}",+ "Add component: {name}": "Ajouter un composant : {name}",+ "Adding {name}…": "Ajout de {name}…",+ "Failed to install block": "Impossible d’installer le bloc",+ "Install failed": "Échec de l’installation",+ "Failed to add block": "Impossible d’ajouter le bloc",+ "{title} opened": "{title} ouvert",+ "{title} closed": "{title} fermé",+ "{title} maximized": "{title} agrandi",+ "{title} restored": "{title} rétabli",+ "No playable video found. Export a video file and try again.": "Aucune vidéo lisible trouvée. Exportez un fichier vidéo et réessayez.",+ "No playable audio found. Export an audio file and try again.": "Aucun audio lisible trouvé. Exportez un fichier audio et réessayez.",+ "Cannot read this media file. Check that it is complete or export it again.": "Impossible de lire ce média. Vérifiez qu’il est complet ou exportez-le à nouveau.",+ "Cannot read the media information. Export the file again and retry.": "Impossible de lire les informations du média. Exportez à nouveau le fichier et réessayez.",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "La vérification du média ne démarre pas. Vérifiez la configuration des outils multimédias locaux et réessayez.",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "La vérification est indisponible. Le fichier a été ajouté, mais sa lecture n’a pas été vérifiée.",+ "Could not validate this media file. Check the file and retry.": "Impossible de valider ce média. Vérifiez le fichier et réessayez.",+ "The project changed. Refresh the editor before trying again.": "Le projet a changé. Actualisez l’éditeur avant de réessayer.",+ "Cannot connect to the preview service. Check the connection and retry.": "Impossible de se connecter au service d’aperçu. Vérifiez la connexion et réessayez.",+ "The operation could not be completed. Check the project and retry.": "L’opération n’a pas pu être terminée. Vérifiez le projet et réessayez.",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "La division n’a pas pu être annulée en toute sécurité. Rechargez et vérifiez le projet avant de poursuivre.",+ "The project changed during splitting. Refresh the editor and retry.": "Le projet a changé pendant la division. Actualisez l’éditeur et réessayez.",+ "Cannot read the latest clip source. Refresh the editor and retry.": "Impossible de lire la source actuelle du clip. Actualisez l’éditeur et réessayez.",+ "This clip cannot be split. Select a different clip.": "Ce clip ne peut pas être scindé. Sélectionnez-en un autre.",+ "Could not split the clip. Check the current clip and retry.": "Impossible de scinder le clip. Vérifiez-le et réessayez.",+ "Nothing selected to copy.": "Aucun élément sélectionné à copier.",+ "Nothing to paste.": "Rien à coller.",+ "Couldn't copy to the clipboard. Check browser permissions": "Impossible de copier dans le presse-papiers. Vérifiez les autorisations du navigateur",+ "Preview not ready. Try again": "L’aperçu n’est pas prêt. Réessayez",+ "Select an element first": "Sélectionnez d’abord un élément",+ "{value0} track{suffix}": "Piste{suffix} : {value0}",+ "{value0} tracks": "{value0} pistes",+ "{value0} {label} tracks": "{value0} pistes {label}",+ "Show track {number}": "Afficher la piste {number}",+ "Hide track {number}": "Masquer la piste {number}",+ "Search projects": "Rechercher des projets",+ "Search projects…": "Rechercher des projets…",+ "Toggle timeline snapping": "Activer/désactiver le magnétisme",+ "Snapping on ({value0})": "Magnétisme activé ({value0})",+ "Snapping off ({value0})": "Magnétisme désactivé ({value0})",+ "Fit timeline to width": "Ajuster la timeline à la largeur",+ "Zoom to selected clips": "Ajuster aux clips sélectionnés",+ "Zoom to selected clips ({value0})": "Ajuster à la sélection ({value0})",+ "Select a clip to zoom the timeline": "Sélectionnez un clip à afficher",+ "Delete timeline clip": "Supprimer le clip de la timeline",+ "Move animation path": "Déplacer la trajectoire d’animation",+ "Edit x (whole animation)": "Modifier la position X (animation entière)",+ "Edit y (whole animation)": "Modifier la position Y (animation entière)",+ "No clips yet": "Aucun clip pour le moment",+ "No editable content": "Aucun contenu à modifier",+ "No content to export. Add media first.": "Aucun contenu à exporter. Ajoutez d’abord des médias."+ },+ "ru": {+ "Expand": "Развернуть",+ "Collapse": "Свернуть",+ "Expand left panel": "Развернуть левую панель",+ "Collapse left panel": "Свернуть левую панель",+ "Expand right panel": "Развернуть правую панель",+ "Collapse right panel": "Свернуть правую панель",+ "Left panels": "Левые панели",+ "Right panels": "Правые панели",+ "Expand preview": "Развернуть предпросмотр",+ "Restore preview": "Свернуть предпросмотр",+ "Align left": "По левому краю",+ "Align center": "По центру",+ "Align right": "По правому краю",+ "Increase": "Увеличить",+ "Decrease": "Уменьшить",+ "Split": "Разделить",+ "Import files": "Импорт файлов",+ "Projects": "Проекты",+ "Project list": "Список проектов",+ "Open active project": "Открыть текущий проект",+ "System": "Система",+ "Imported": "Импортировано",+ "Document": "Документ",+ "Current": "Текущий",+ "Took {value0}": "Затрачено: {value0}",+ "Change volume": "Изменить громкость",+ "Fade in": "Нарастание",+ "Fade out": "Затухание",+ "Timeline track view": "Дорожки таймлайна",+ "Project assets": "Медиа проекта",+ "Code Animations": "Кодовые анимации",+ "VFX": "Визуальные эффекты",+ "Transitions": "Переходы",+ "Text Effects": "Текстовые эффекты",+ "Social": "Соцсети",+ "Data": "Данные",+ "Scenes": "Сцены",+ "Fill: {fill} · {opacity}%": "Заливка: {fill} · {opacity}%",+ "Image/gradient": "Изображение/градиент",+ "Choose…": "Выбрать…",+ "Canvas": "Холст",+ "Panels": "Панели",+ "File on disk": "Файл на диске",+ "Unsaved Studio version": "Несохранённая версия Studio",+ "Row": "Строка",+ "Column": "Столбец",+ "Bring to front": "На передний план",+ "Bring forward": "Вперёд",+ "Send backward": "Назад",+ "Send to back": "На задний план",+ "Top": "Сверху",+ "Right": "Справа",+ "Bottom": "Снизу",+ "Left": "Слева",+ "playhead": "Курсор воспроизведения",+ "clip edge": "Край клипа",+ "beat": "Доля",+ "grid line": "Линия сетки",+ "Zoomed {percent}%": "Масштаб: {percent}%",+ "Panned": "Вид перемещён",+ "Undo": "Отменить",+ "Redo": "Повторить",+ "Undo: {label}": "Отмена: {label}",+ "Redo: {label}": "Повтор: {label}",+ "Composition canvas": "Холст композиции",+ "Version history": "История версий",+ "Undone": "Отменено",+ "track": "дорожка",+ "this track": "эта дорожка",+ "Click any element on the canvas to edit it.": "Нажмите на элемент на холсте, чтобы изменить его.",+ "Create a project with your Agent to start editing.": "Создайте проект с помощью Agent, чтобы начать редактирование.",+ "Import files or describe your video to your Agent.": "Импортируйте файлы или опишите видео своему Agent.",+ "Everyday video, widely compatible.": "Обычное видео с широкой совместимостью.",+ "Transparent video for editing. Larger files.": "Видео с прозрачностью для монтажа. Файлы большего размера.",+ "Transparent video for web. Limited editor support.": "Видео с прозрачностью для веба. Поддерживается не всеми редакторами.",+ "Animated image, no audio. Up to 30 fps.": "Анимированное изображение без звука. До 30 кадров/с.",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "Нажмите в нужном месте клипа, чтобы разделить его. Для перемещения или выбора вернитесь к инструменту выделения.",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "При перетаскивании клипы привязываются к ближайшим краям клипов и курсору воспроизведения для точного выравнивания.",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "Масштабирует таймлайн по выбранным клипам для точного редактирования.",+ "First select one or more clips in the timeline, then use this to fit them into view.": "Сначала выберите один или несколько клипов на таймлайне, затем нажмите здесь, чтобы вписать их в область просмотра.",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "Показывает весь таймлайн в доступной ширине. Меняется только масштаб просмотра, а не длительность видео.",+ "Return to the editor layout. You can also press Esc.": "Вернуться к раскладке редактора. Также можно нажать Esc.",+ "Enlarge the preview within this workspace, keeping your chat visible.": "Расширяет предпросмотр в рабочей области, сохраняя чат видимым.",+ "Split (move playhead inside clip)": "Разделить (переместите курсор внутрь клипа)",+ "Edit layer style": "Изменить стиль слоя",+ "Move layer": "Переместить слой",+ "Rotate layer": "Повернуть слой",+ "Resize layer": "Изменить размер слоя",+ "Resize layer box": "Изменить рамку слоя",+ "Reset layer edits": "Сбросить изменения слоя",+ "Reorder layers": "Изменить порядок слоёв",+ "Edit text": "Изменить текст",+ "Edit timing": "Изменить время",+ "Edit source": "Изменить исходный код",+ "Delete element": "Удалить элемент",+ "Add timeline asset": "Добавить медиа на таймлайн",+ "Add composition to timeline": "Добавить композицию на таймлайн",+ "Move timeline clip": "Переместить клип на таймлайне",+ "Move timeline clips": "Переместить клипы на таймлайне",+ "Resize timeline clip": "Изменить длительность клипа",+ "Resize timeline clips": "Изменить длительность клипов",+ "Split timeline clip": "Разделить клип на таймлайне",+ "Duplicate clip": "Дублировать клип",+ "Duplicate clips": "Дублировать клипы",+ "Paste clip": "Вставить клип",+ "Paste clips": "Вставить клипы",+ "Move clip": "Переместить клип",+ "Trim clip": "Обрезать клип",+ "Split clip": "Разделить клип",+ "Resize": "Изменить размер",+ "Unlink clips": "Разъединить клипы",+ "Link clips": "Связать клипы",+ "Detach audio": "Отделить аудио",+ "Merge audio back into video": "Объединить аудио с видео",+ "Delete this clip only": "Удалить только этот клип",+ "Copied clip": "Клип скопирован",+ "Copied {count} clips": "Скопировано клипов: {count}",+ "Copied element": "Элемент скопирован",+ "Pasted clip": "Клип вставлен",+ "Pasted {count} clips": "Вставлено клипов: {count}",+ "Pasted element": "Элемент вставлен",+ "Duplicated clip": "Клип дублирован",+ "Duplicated {count} clips": "Дублировано клипов: {count}",+ "Failed to copy": "Не удалось скопировать",+ "Failed to paste": "Не удалось вставить",+ "Failed to duplicate": "Не удалось дублировать",+ "Failed to split timeline clip": "Не удалось разделить клип",+ "Failed to split clips": "Не удалось разделить клипы",+ "Undid: {label}": "Отменено: {label}",+ "Redid: {label}": "Повторено: {label}",+ "Undid {label}": "Отменено: {label}",+ "Redid {label}": "Повторено: {label}",+ "undo": "отменить",+ "redo": "повторить",+ "Split {name} at {time}s": "Разделить {name} на {time} с",+ "Split {count} clips at {time}s": "Разделить клипы ({count}) на {time} с",+ "Add block: {name}": "Добавить блок: {name}",+ "Add component: {name}": "Добавить компонент: {name}",+ "Adding {name}…": "Добавление {name}…",+ "Failed to install block": "Не удалось установить блок",+ "Install failed": "Ошибка установки",+ "Failed to add block": "Не удалось добавить блок",+ "{title} opened": "Открыто: {title}",+ "{title} closed": "Закрыто: {title}",+ "{title} maximized": "Развёрнуто: {title}",+ "{title} restored": "Восстановлено: {title}",+ "No playable video found. Export a video file and try again.": "Воспроизводимое видео не найдено. Экспортируйте видеофайл и повторите попытку.",+ "No playable audio found. Export an audio file and try again.": "Воспроизводимое аудио не найдено. Экспортируйте аудиофайл и повторите попытку.",+ "Cannot read this media file. Check that it is complete or export it again.": "Не удаётся прочитать медиафайл. Проверьте его целостность или экспортируйте заново.",+ "Cannot read the media information. Export the file again and retry.": "Не удаётся прочитать сведения о медиа. Экспортируйте файл заново и повторите попытку.",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "Не удаётся запустить проверку медиа. Проверьте настройки локальных медиасредств и повторите попытку.",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "Проверка медиа недоступна. Файл добавлен, но воспроизведение не проверено.",+ "Could not validate this media file. Check the file and retry.": "Не удалось проверить медиафайл. Проверьте файл и повторите попытку.",+ "The project changed. Refresh the editor before trying again.": "Проект изменился. Обновите редактор перед повторной попыткой.",+ "Cannot connect to the preview service. Check the connection and retry.": "Не удаётся подключиться к сервису предпросмотра. Проверьте соединение и повторите попытку.",+ "The operation could not be completed. Check the project and retry.": "Не удалось завершить операцию. Проверьте проект и повторите попытку.",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "Не удалось безопасно отменить разделение. Перезагрузите и проверьте проект перед дальнейшим редактированием.",+ "The project changed during splitting. Refresh the editor and retry.": "Проект изменился во время разделения. Обновите редактор и повторите попытку.",+ "Cannot read the latest clip source. Refresh the editor and retry.": "Не удаётся прочитать актуальный исходник клипа. Обновите редактор и повторите попытку.",+ "This clip cannot be split. Select a different clip.": "Этот клип нельзя разделить. Выберите другой клип.",+ "Could not split the clip. Check the current clip and retry.": "Не удалось разделить клип. Проверьте выбранный клип и повторите попытку.",+ "Nothing selected to copy.": "Ничего не выбрано для копирования.",+ "Nothing to paste.": "Нечего вставлять.",+ "Couldn't copy to the clipboard. Check browser permissions": "Не удалось скопировать в буфер обмена. Проверьте разрешения браузера",+ "Preview not ready. Try again": "Предпросмотр ещё не готов. Повторите попытку",+ "Select an element first": "Сначала выберите элемент",+ "{value0} track{suffix}": "Дорожка{suffix}: {value0}",+ "{value0} tracks": "Дорожек: {value0}",+ "{value0} {label} tracks": "Дорожек ({label}): {value0}",+ "Show track {number}": "Показать дорожку {number}",+ "Hide track {number}": "Скрыть дорожку {number}",+ "Search projects": "Поиск проектов",+ "Search projects…": "Поиск проектов…",+ "Toggle timeline snapping": "Переключить привязку",+ "Snapping on ({value0})": "Привязка включена ({value0})",+ "Snapping off ({value0})": "Привязка выключена ({value0})",+ "Fit timeline to width": "Вписать таймлайн по ширине",+ "Zoom to selected clips": "Показать выбранные клипы",+ "Zoom to selected clips ({value0})": "Показать выбранные клипы ({value0})",+ "Select a clip to zoom the timeline": "Выберите клип для масштабирования",+ "Delete timeline clip": "Удалить клип на шкале времени",+ "Move animation path": "Переместить траекторию анимации",+ "Edit x (whole animation)": "Изменить координату X (вся анимация)",+ "Edit y (whole animation)": "Изменить координату Y (вся анимация)",+ "No clips yet": "Пока нет клипов",+ "No editable content": "Нет содержимого для редактирования",+ "No content to export. Add media first.": "Нет содержимого для экспорта. Сначала добавьте медиафайлы."+ },+ "es": {+ "Expand": "Expandir",+ "Collapse": "Contraer",+ "Expand left panel": "Abrir panel izquierdo",+ "Collapse left panel": "Cerrar panel izquierdo",+ "Expand right panel": "Abrir panel derecho",+ "Collapse right panel": "Cerrar panel derecho",+ "Left panels": "Paneles izquierdos",+ "Right panels": "Paneles derechos",+ "Expand preview": "Ampliar vista previa",+ "Restore preview": "Restaurar vista previa",+ "Align left": "Alinear a la izquierda",+ "Align center": "Centrar",+ "Align right": "Alinear a la derecha",+ "Increase": "Aumentar",+ "Decrease": "Reducir",+ "Split": "Dividir",+ "Import files": "Importar archivos",+ "Projects": "Proyectos",+ "Project list": "Lista de proyectos",+ "Open active project": "Abrir proyecto activo",+ "System": "Sistema",+ "Imported": "Importado",+ "Document": "Documento",+ "Current": "Actual",+ "Took {value0}": "Duración: {value0}",+ "Change volume": "Cambiar volumen",+ "Fade in": "Fundido de entrada",+ "Fade out": "Fundido de salida",+ "Timeline track view": "Pistas de la línea de tiempo",+ "Project assets": "Recursos del proyecto",+ "Code Animations": "Animaciones por código",+ "VFX": "Efectos visuales",+ "Transitions": "Transiciones",+ "Text Effects": "Efectos de texto",+ "Social": "Redes sociales",+ "Data": "Datos",+ "Scenes": "Escenas",+ "Fill: {fill} · {opacity}%": "Relleno: {fill} · {opacity}%",+ "Image/gradient": "Imagen/degradado",+ "Choose…": "Elegir…",+ "Canvas": "Lienzo",+ "Panels": "Paneles",+ "File on disk": "Archivo en disco",+ "Unsaved Studio version": "Versión de Studio sin guardar",+ "Row": "Fila",+ "Column": "Columna",+ "Bring to front": "Traer al frente",+ "Bring forward": "Traer adelante",+ "Send backward": "Enviar atrás",+ "Send to back": "Enviar al fondo",+ "Top": "Arriba",+ "Right": "Derecha",+ "Bottom": "Abajo",+ "Left": "Izquierda",+ "playhead": "Cabezal de reproducción",+ "clip edge": "Borde del clip",+ "beat": "Pulso",+ "grid line": "Línea de cuadrícula",+ "Zoomed {percent}%": "Zoom: {percent}%",+ "Panned": "Vista desplazada",+ "Undo": "Deshacer",+ "Redo": "Rehacer",+ "Undo: {label}": "Deshacer: {label}",+ "Redo: {label}": "Rehacer: {label}",+ "Composition canvas": "Lienzo de composición",+ "Version history": "Historial de versiones",+ "Undone": "Deshecho",+ "track": "pista",+ "this track": "esta pista",+ "Click any element on the canvas to edit it.": "Haz clic en un elemento del lienzo para editarlo.",+ "Create a project with your Agent to start editing.": "Crea un proyecto con tu Agent para empezar a editar.",+ "Import files or describe your video to your Agent.": "Importa archivos o describe tu vídeo a tu Agent.",+ "Everyday video, widely compatible.": "Vídeo de uso general con amplia compatibilidad.",+ "Transparent video for editing. Larger files.": "Vídeo con transparencia para edición. Archivos más grandes.",+ "Transparent video for web. Limited editor support.": "Vídeo con transparencia para web. Compatibilidad limitada en editores.",+ "Animated image, no audio. Up to 30 fps.": "Imagen animada sin audio. Hasta 30 fps.",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "Haz clic en el punto donde quieras dividir el clip. Vuelve a Seleccionar para mover o seleccionar clips.",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "Al activarlo, los clips arrastrados se ajustan a los bordes cercanos y al cabezal para facilitar la alineación.",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "Ajusta la vista a los clips seleccionados para facilitar la edición detallada.",+ "First select one or more clips in the timeline, then use this to fit them into view.": "Selecciona uno o varios clips y usa este botón para ajustarlos a la vista.",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "Muestra toda la línea de tiempo en el ancho disponible. Solo cambia la vista, no la duración del vídeo.",+ "Return to the editor layout. You can also press Esc.": "Volver a la distribución del editor. También puedes pulsar Esc.",+ "Enlarge the preview within this workspace, keeping your chat visible.": "Amplía la vista previa dentro del espacio de trabajo sin ocultar el chat.",+ "Split (move playhead inside clip)": "Dividir (mueve el cabezal dentro del clip)",+ "Edit layer style": "Editar estilo de capa",+ "Move layer": "Mover capa",+ "Rotate layer": "Girar capa",+ "Resize layer": "Redimensionar capa",+ "Resize layer box": "Redimensionar marco de capa",+ "Reset layer edits": "Restablecer cambios de capa",+ "Reorder layers": "Reordenar capas",+ "Edit text": "Editar texto",+ "Edit timing": "Editar tiempos",+ "Edit source": "Editar código fuente",+ "Delete element": "Eliminar elemento",+ "Add timeline asset": "Añadir recurso a la línea de tiempo",+ "Add composition to timeline": "Añadir composición a la línea de tiempo",+ "Move timeline clip": "Mover clip en la línea de tiempo",+ "Move timeline clips": "Mover clips en la línea de tiempo",+ "Resize timeline clip": "Cambiar duración del clip",+ "Resize timeline clips": "Cambiar duración de los clips",+ "Split timeline clip": "Dividir clip en la línea de tiempo",+ "Duplicate clip": "Duplicar clip",+ "Duplicate clips": "Duplicar clips",+ "Paste clip": "Pegar clip",+ "Paste clips": "Pegar clips",+ "Move clip": "Mover clip",+ "Trim clip": "Recortar clip",+ "Split clip": "Dividir clip",+ "Resize": "Redimensionar",+ "Unlink clips": "Desvincular clips",+ "Link clips": "Vincular clips",+ "Detach audio": "Separar audio",+ "Merge audio back into video": "Reintegrar audio al vídeo",+ "Delete this clip only": "Eliminar solo este clip",+ "Copied clip": "Clip copiado",+ "Copied {count} clips": "Clips copiados: {count}",+ "Copied element": "Elemento copiado",+ "Pasted clip": "Clip pegado",+ "Pasted {count} clips": "Clips pegados: {count}",+ "Pasted element": "Elemento pegado",+ "Duplicated clip": "Clip duplicado",+ "Duplicated {count} clips": "Clips duplicados: {count}",+ "Failed to copy": "No se pudo copiar",+ "Failed to paste": "No se pudo pegar",+ "Failed to duplicate": "No se pudo duplicar",+ "Failed to split timeline clip": "No se pudo dividir el clip",+ "Failed to split clips": "No se pudieron dividir los clips",+ "Undid: {label}": "Deshecho: {label}",+ "Redid: {label}": "Rehecho: {label}",+ "Undid {label}": "Deshecho: {label}",+ "Redid {label}": "Rehecho: {label}",+ "undo": "deshacer",+ "redo": "rehacer",+ "Split {name} at {time}s": "Dividir {name} en {time}s",+ "Split {count} clips at {time}s": "Dividir {count} clips en {time}s",+ "Add block: {name}": "Añadir bloque: {name}",+ "Add component: {name}": "Añadir componente: {name}",+ "Adding {name}…": "Añadiendo {name}…",+ "Failed to install block": "No se pudo instalar el bloque",+ "Install failed": "Error de instalación",+ "Failed to add block": "No se pudo añadir el bloque",+ "{title} opened": "{title} abierto",+ "{title} closed": "{title} cerrado",+ "{title} maximized": "{title} maximizado",+ "{title} restored": "{title} restaurado",+ "No playable video found. Export a video file and try again.": "No se encontró vídeo reproducible. Exporta un archivo de vídeo e inténtalo de nuevo.",+ "No playable audio found. Export an audio file and try again.": "No se encontró audio reproducible. Exporta un archivo de audio e inténtalo de nuevo.",+ "Cannot read this media file. Check that it is complete or export it again.": "No se puede leer el archivo. Comprueba que esté completo o expórtalo de nuevo.",+ "Cannot read the media information. Export the file again and retry.": "No se puede leer la información del archivo. Expórtalo de nuevo y reintenta.",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "No se puede iniciar la comprobación. Revisa la configuración de las herramientas multimedia locales y reintenta.",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "La comprobación no está disponible. Se añadió el archivo, pero no se verificó su reproducción.",+ "Could not validate this media file. Check the file and retry.": "No se pudo validar el archivo. Revísalo e inténtalo de nuevo.",+ "The project changed. Refresh the editor before trying again.": "El proyecto cambió. Actualiza el editor antes de volver a intentarlo.",+ "Cannot connect to the preview service. Check the connection and retry.": "No se puede conectar con el servicio de vista previa. Revisa la conexión y reintenta.",+ "The operation could not be completed. Check the project and retry.": "No se pudo completar la operación. Revisa el proyecto y reintenta.",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "No se pudo deshacer la división de forma segura. Recarga y revisa el proyecto antes de seguir editando.",+ "The project changed during splitting. Refresh the editor and retry.": "El proyecto cambió durante la división. Actualiza el editor y reintenta.",+ "Cannot read the latest clip source. Refresh the editor and retry.": "No se puede leer la fuente actual del clip. Actualiza el editor y reintenta.",+ "This clip cannot be split. Select a different clip.": "No se puede dividir este clip. Selecciona otro.",+ "Could not split the clip. Check the current clip and retry.": "No se pudo dividir el clip. Revisa el clip actual y reintenta.",+ "Nothing selected to copy.": "No hay nada seleccionado para copiar.",+ "Nothing to paste.": "No hay nada que pegar.",+ "Couldn't copy to the clipboard. Check browser permissions": "No se pudo copiar al portapapeles. Revisa los permisos del navegador",+ "Preview not ready. Try again": "La vista previa no está lista. Reintenta",+ "Select an element first": "Selecciona primero un elemento",+ "{value0} track{suffix}": "Pista{suffix}: {value0}",+ "{value0} tracks": "{value0} pistas",+ "{value0} {label} tracks": "{value0} pistas {label}",+ "Show track {number}": "Mostrar pista {number}",+ "Hide track {number}": "Ocultar pista {number}",+ "Search projects": "Buscar proyectos",+ "Search projects…": "Buscar proyectos…",+ "Toggle timeline snapping": "Alternar ajuste magnético",+ "Snapping on ({value0})": "Ajuste activado ({value0})",+ "Snapping off ({value0})": "Ajuste desactivado ({value0})",+ "Fit timeline to width": "Ajustar línea de tiempo al ancho",+ "Zoom to selected clips": "Ajustar a los clips seleccionados",+ "Zoom to selected clips ({value0})": "Ajustar a la selección ({value0})",+ "Select a clip to zoom the timeline": "Selecciona un clip para ajustar la vista",+ "Delete timeline clip": "Eliminar clip de la línea de tiempo",+ "Move animation path": "Mover trayectoria de animación",+ "Edit x (whole animation)": "Editar posición X (toda la animación)",+ "Edit y (whole animation)": "Editar posición Y (toda la animación)",+ "No clips yet": "Aún no hay clips",+ "No editable content": "No hay contenido editable",+ "No content to export. Add media first.": "No hay contenido para exportar. Añade archivos multimedia primero."+ },+ "pt-BR": {+ "Expand": "Expandir",+ "Collapse": "Recolher",+ "Expand left panel": "Abrir painel esquerdo",+ "Collapse left panel": "Fechar painel esquerdo",+ "Expand right panel": "Abrir painel direito",+ "Collapse right panel": "Fechar painel direito",+ "Left panels": "Painéis esquerdos",+ "Right panels": "Painéis direitos",+ "Expand preview": "Ampliar prévia",+ "Restore preview": "Restaurar prévia",+ "Align left": "Alinhar à esquerda",+ "Align center": "Centralizar",+ "Align right": "Alinhar à direita",+ "Increase": "Aumentar",+ "Decrease": "Diminuir",+ "Split": "Dividir",+ "Import files": "Importar arquivos",+ "Projects": "Projetos",+ "Project list": "Lista de projetos",+ "Open active project": "Abrir projeto atual",+ "System": "Sistema",+ "Imported": "Importado",+ "Document": "Documento",+ "Current": "Atual",+ "Took {value0}": "Duração: {value0}",+ "Change volume": "Alterar volume",+ "Fade in": "Fade de entrada",+ "Fade out": "Fade de saída",+ "Timeline track view": "Faixas da linha do tempo",+ "Project assets": "Mídias do projeto",+ "Code Animations": "Animações por código",+ "VFX": "Efeitos visuais",+ "Transitions": "Transições",+ "Text Effects": "Efeitos de texto",+ "Social": "Redes sociais",+ "Data": "Dados",+ "Scenes": "Cenas",+ "Fill: {fill} · {opacity}%": "Preenchimento: {fill} · {opacity}%",+ "Image/gradient": "Imagem/degradê",+ "Choose…": "Escolher…",+ "Canvas": "Tela",+ "Panels": "Painéis",+ "File on disk": "Arquivo no disco",+ "Unsaved Studio version": "Versão não salva do Studio",+ "Row": "Linha",+ "Column": "Coluna",+ "Bring to front": "Trazer para frente",+ "Bring forward": "Avançar",+ "Send backward": "Recuar",+ "Send to back": "Enviar para trás",+ "Top": "Acima",+ "Right": "Direita",+ "Bottom": "Abaixo",+ "Left": "Esquerda",+ "playhead": "Cursor de reprodução",+ "clip edge": "Borda do clipe",+ "beat": "Batida",+ "grid line": "Linha da grade",+ "Zoomed {percent}%": "Zoom: {percent}%",+ "Panned": "Visualização deslocada",+ "Undo": "Desfazer",+ "Redo": "Refazer",+ "Undo: {label}": "Desfazer: {label}",+ "Redo: {label}": "Refazer: {label}",+ "Composition canvas": "Tela da composição",+ "Version history": "Histórico de versões",+ "Undone": "Desfeito",+ "track": "faixa",+ "this track": "esta faixa",+ "Click any element on the canvas to edit it.": "Clique em um elemento da tela para editá-lo.",+ "Create a project with your Agent to start editing.": "Crie um projeto com seu Agent para começar a editar.",+ "Import files or describe your video to your Agent.": "Importe arquivos ou descreva seu vídeo ao Agent.",+ "Everyday video, widely compatible.": "Vídeo de uso geral, com ampla compatibilidade.",+ "Transparent video for editing. Larger files.": "Vídeo com transparência para edição. Arquivos maiores.",+ "Transparent video for web. Limited editor support.": "Vídeo com transparência para web. Suporte limitado em editores.",+ "Animated image, no audio. Up to 30 fps.": "Imagem animada sem áudio. Até 30 fps.",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "Clique no ponto em que deseja dividir o clipe. Volte à ferramenta Selecionar para mover ou selecionar clipes.",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "Quando ativado, os clipes arrastados se encaixam nas bordas próximas e no cursor para facilitar o alinhamento.",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "Ajusta a linha do tempo aos clipes selecionados para facilitar edições detalhadas.",+ "First select one or more clips in the timeline, then use this to fit them into view.": "Selecione um ou mais clipes na linha do tempo e use este botão para ajustá-los à visualização.",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "Mostra toda a linha do tempo na largura disponível. Altera apenas a visualização, não a duração do vídeo.",+ "Return to the editor layout. You can also press Esc.": "Voltar ao layout do editor. Você também pode pressionar Esc.",+ "Enlarge the preview within this workspace, keeping your chat visible.": "Amplia a prévia no espaço de trabalho, mantendo o chat visível.",+ "Split (move playhead inside clip)": "Dividir (mova o cursor para dentro do clipe)",+ "Edit layer style": "Editar estilo da camada",+ "Move layer": "Mover camada",+ "Rotate layer": "Girar camada",+ "Resize layer": "Redimensionar camada",+ "Resize layer box": "Redimensionar caixa da camada",+ "Reset layer edits": "Redefinir alterações da camada",+ "Reorder layers": "Reordenar camadas",+ "Edit text": "Editar texto",+ "Edit timing": "Editar tempos",+ "Edit source": "Editar código-fonte",+ "Delete element": "Excluir elemento",+ "Add timeline asset": "Adicionar mídia à linha do tempo",+ "Add composition to timeline": "Adicionar composição à linha do tempo",+ "Move timeline clip": "Mover clipe na linha do tempo",+ "Move timeline clips": "Mover clipes na linha do tempo",+ "Resize timeline clip": "Alterar duração do clipe",+ "Resize timeline clips": "Alterar duração dos clipes",+ "Split timeline clip": "Dividir clipe na linha do tempo",+ "Duplicate clip": "Duplicar clipe",+ "Duplicate clips": "Duplicar clipes",+ "Paste clip": "Colar clipe",+ "Paste clips": "Colar clipes",+ "Move clip": "Mover clipe",+ "Trim clip": "Aparar clipe",+ "Split clip": "Dividir clipe",+ "Resize": "Redimensionar",+ "Unlink clips": "Desvincular clipes",+ "Link clips": "Vincular clipes",+ "Detach audio": "Separar áudio",+ "Merge audio back into video": "Reintegrar áudio ao vídeo",+ "Delete this clip only": "Excluir apenas este clipe",+ "Copied clip": "Clipe copiado",+ "Copied {count} clips": "Clipes copiados: {count}",+ "Copied element": "Elemento copiado",+ "Pasted clip": "Clipe colado",+ "Pasted {count} clips": "Clipes colados: {count}",+ "Pasted element": "Elemento colado",+ "Duplicated clip": "Clipe duplicado",+ "Duplicated {count} clips": "Clipes duplicados: {count}",+ "Failed to copy": "Falha ao copiar",+ "Failed to paste": "Falha ao colar",+ "Failed to duplicate": "Falha ao duplicar",+ "Failed to split timeline clip": "Falha ao dividir o clipe",+ "Failed to split clips": "Falha ao dividir os clipes",+ "Undid: {label}": "Desfeito: {label}",+ "Redid: {label}": "Refeito: {label}",+ "Undid {label}": "Desfeito: {label}",+ "Redid {label}": "Refeito: {label}",+ "undo": "desfazer",+ "redo": "refazer",+ "Split {name} at {time}s": "Dividir {name} em {time}s",+ "Split {count} clips at {time}s": "Dividir {count} clipes em {time}s",+ "Add block: {name}": "Adicionar bloco: {name}",+ "Add component: {name}": "Adicionar componente: {name}",+ "Adding {name}…": "Adicionando {name}…",+ "Failed to install block": "Falha ao instalar o bloco",+ "Install failed": "Falha na instalação",+ "Failed to add block": "Falha ao adicionar o bloco",+ "{title} opened": "{title} aberto",+ "{title} closed": "{title} fechado",+ "{title} maximized": "{title} maximizado",+ "{title} restored": "{title} restaurado",+ "No playable video found. Export a video file and try again.": "Nenhum vídeo reproduzível encontrado. Exporte um arquivo de vídeo e tente novamente.",+ "No playable audio found. Export an audio file and try again.": "Nenhum áudio reproduzível encontrado. Exporte um arquivo de áudio e tente novamente.",+ "Cannot read this media file. Check that it is complete or export it again.": "Não foi possível ler a mídia. Verifique se está completa ou exporte novamente.",+ "Cannot read the media information. Export the file again and retry.": "Não foi possível ler as informações da mídia. Exporte o arquivo novamente e tente de novo.",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "Não foi possível iniciar a verificação. Confira a configuração das ferramentas de mídia locais e tente novamente.",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "A verificação está indisponível. O arquivo foi adicionado, mas a reprodução não foi verificada.",+ "Could not validate this media file. Check the file and retry.": "Não foi possível validar a mídia. Confira o arquivo e tente novamente.",+ "The project changed. Refresh the editor before trying again.": "O projeto mudou. Atualize o editor antes de tentar novamente.",+ "Cannot connect to the preview service. Check the connection and retry.": "Não foi possível conectar ao serviço de prévia. Confira a conexão e tente novamente.",+ "The operation could not be completed. Check the project and retry.": "Não foi possível concluir a operação. Confira o projeto e tente novamente.",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "Não foi possível desfazer a divisão com segurança. Recarregue e confira o projeto antes de continuar.",+ "The project changed during splitting. Refresh the editor and retry.": "O projeto mudou durante a divisão. Atualize o editor e tente novamente.",+ "Cannot read the latest clip source. Refresh the editor and retry.": "Não foi possível ler a fonte atual do clipe. Atualize o editor e tente novamente.",+ "This clip cannot be split. Select a different clip.": "Este clipe não pode ser dividido. Selecione outro.",+ "Could not split the clip. Check the current clip and retry.": "Não foi possível dividir o clipe. Confira o clipe atual e tente novamente.",+ "Nothing selected to copy.": "Nada selecionado para copiar.",+ "Nothing to paste.": "Nada para colar.",+ "Couldn't copy to the clipboard. Check browser permissions": "Não foi possível copiar para a área de transferência. Confira as permissões do navegador",+ "Preview not ready. Try again": "A prévia ainda não está pronta. Tente novamente",+ "Select an element first": "Selecione um elemento primeiro",+ "{value0} track{suffix}": "Faixa{suffix}: {value0}",+ "{value0} tracks": "{value0} faixas",+ "{value0} {label} tracks": "{value0} faixas {label}",+ "Show track {number}": "Mostrar faixa {number}",+ "Hide track {number}": "Ocultar faixa {number}",+ "Search projects": "Buscar projetos",+ "Search projects…": "Buscar projetos…",+ "Toggle timeline snapping": "Alternar encaixe magnético",+ "Snapping on ({value0})": "Encaixe ativado ({value0})",+ "Snapping off ({value0})": "Encaixe desativado ({value0})",+ "Fit timeline to width": "Ajustar linha do tempo à largura",+ "Zoom to selected clips": "Ajustar aos clipes selecionados",+ "Zoom to selected clips ({value0})": "Ajustar à seleção ({value0})",+ "Select a clip to zoom the timeline": "Selecione um clipe para ajustar a visualização",+ "Delete timeline clip": "Excluir clipe da linha do tempo",+ "Move animation path": "Mover trajetória de animação",+ "Edit x (whole animation)": "Editar posição X (animação inteira)",+ "Edit y (whole animation)": "Editar posição Y (animação inteira)",+ "No clips yet": "Nenhum clipe ainda",+ "No editable content": "Nenhum conteúdo editável",+ "No content to export. Add media first.": "Não há conteúdo para exportar. Adicione mídia primeiro."+ },+ "it": {+ "Expand": "Espandi",+ "Collapse": "Comprimi",+ "Expand left panel": "Apri pannello sinistro",+ "Collapse left panel": "Chiudi pannello sinistro",+ "Expand right panel": "Apri pannello destro",+ "Collapse right panel": "Chiudi pannello destro",+ "Left panels": "Pannelli a sinistra",+ "Right panels": "Pannelli a destra",+ "Expand preview": "Espandi anteprima",+ "Restore preview": "Ripristina anteprima",+ "Align left": "Allinea a sinistra",+ "Align center": "Allinea al centro",+ "Align right": "Allinea a destra",+ "Increase": "Aumenta",+ "Decrease": "Riduci",+ "Split": "Dividi",+ "Import files": "Importa file",+ "Projects": "Progetti",+ "Project list": "Elenco progetti",+ "Open active project": "Apri progetto attivo",+ "System": "Sistema",+ "Imported": "Importato",+ "Document": "Documento",+ "Current": "Attuale",+ "Took {value0}": "Tempo: {value0}",+ "Change volume": "Modifica volume",+ "Fade in": "Dissolvenza in entrata",+ "Fade out": "Dissolvenza in uscita",+ "Timeline track view": "Tracce della timeline",+ "Project assets": "Risorse del progetto",+ "Code Animations": "Animazioni da codice",+ "VFX": "Effetti visivi",+ "Transitions": "Transizioni",+ "Text Effects": "Effetti di testo",+ "Social": "Social",+ "Data": "Dati",+ "Scenes": "Scene",+ "Fill: {fill} · {opacity}%": "Riempimento: {fill} · {opacity}%",+ "Image/gradient": "Immagine/sfumatura",+ "Choose…": "Scegli…",+ "Canvas": "Area di lavoro",+ "Panels": "Pannelli",+ "File on disk": "File su disco",+ "Unsaved Studio version": "Versione Studio non salvata",+ "Row": "Riga",+ "Column": "Colonna",+ "Bring to front": "Porta in primo piano",+ "Bring forward": "Porta avanti",+ "Send backward": "Porta indietro",+ "Send to back": "Porta in secondo piano",+ "Top": "Alto",+ "Right": "Destra",+ "Bottom": "Basso",+ "Left": "Sinistra",+ "playhead": "Testina di riproduzione",+ "clip edge": "Bordo della clip",+ "beat": "Battito",+ "grid line": "Linea della griglia",+ "Zoomed {percent}%": "Zoom: {percent}%",+ "Panned": "Vista spostata",+ "Undo": "Annulla",+ "Redo": "Ripristina",+ "Undo: {label}": "Annulla: {label}",+ "Redo: {label}": "Ripristina: {label}",+ "Composition canvas": "Area della composizione",+ "Version history": "Cronologia versioni",+ "Undone": "Annullato",+ "track": "traccia",+ "this track": "questa traccia",+ "Click any element on the canvas to edit it.": "Fai clic su un elemento nell’area di lavoro per modificarlo.",+ "Create a project with your Agent to start editing.": "Crea un progetto con il tuo Agent per iniziare a modificarlo.",+ "Import files or describe your video to your Agent.": "Importa file o descrivi il video al tuo Agent.",+ "Everyday video, widely compatible.": "Formato video comune, ampiamente compatibile.",+ "Transparent video for editing. Larger files.": "Video con trasparenza per il montaggio. File più grandi.",+ "Transparent video for web. Limited editor support.": "Video trasparente per il web. Supporto limitato negli editor.",+ "Animated image, no audio. Up to 30 fps.": "Immagine animata senza audio. Fino a 30 fps.",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "Fai clic nel punto in cui dividere la clip. Torna allo strumento Seleziona per spostare o selezionare le clip.",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "Se attivo, i clip trascinati si agganciano ai bordi vicini e alla testina per facilitarne l’allineamento.",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "Adatta la timeline alle clip selezionate per facilitare le modifiche di precisione.",+ "First select one or more clips in the timeline, then use this to fit them into view.": "Seleziona una o più clip nella timeline, poi usa questo pulsante per adattarle alla vista.",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "Mostra l’intera timeline nella larghezza disponibile. Cambia solo la vista, non la durata del video.",+ "Return to the editor layout. You can also press Esc.": "Torna alla disposizione dell’editor. Puoi anche premere Esc.",+ "Enlarge the preview within this workspace, keeping your chat visible.": "Ingrandisce l’anteprima nell’area di lavoro mantenendo visibile la chat.",+ "Split (move playhead inside clip)": "Dividi (sposta la testina nella clip)",+ "Edit layer style": "Modifica stile livello",+ "Move layer": "Sposta livello",+ "Rotate layer": "Ruota livello",+ "Resize layer": "Ridimensiona livello",+ "Resize layer box": "Ridimensiona riquadro livello",+ "Reset layer edits": "Reimposta modifiche livello",+ "Reorder layers": "Riordina livelli",+ "Edit text": "Modifica testo",+ "Edit timing": "Modifica tempi",+ "Edit source": "Modifica sorgente",+ "Delete element": "Elimina elemento",+ "Add timeline asset": "Aggiungi risorsa alla timeline",+ "Add composition to timeline": "Aggiungi composizione alla timeline",+ "Move timeline clip": "Sposta clip nella timeline",+ "Move timeline clips": "Sposta clip nella timeline",+ "Resize timeline clip": "Modifica durata clip",+ "Resize timeline clips": "Modifica durata delle clip",+ "Split timeline clip": "Dividi clip nella timeline",+ "Duplicate clip": "Duplica clip",+ "Duplicate clips": "Duplica clip",+ "Paste clip": "Incolla clip",+ "Paste clips": "Incolla clip",+ "Move clip": "Sposta clip",+ "Trim clip": "Taglia clip",+ "Split clip": "Dividi clip",+ "Resize": "Ridimensiona",+ "Unlink clips": "Scollega clip",+ "Link clips": "Collega clip",+ "Detach audio": "Separa audio",+ "Merge audio back into video": "Riunisci audio e video",+ "Delete this clip only": "Elimina solo questa clip",+ "Copied clip": "Clip copiata",+ "Copied {count} clips": "Clip copiate: {count}",+ "Copied element": "Elemento copiato",+ "Pasted clip": "Clip incollata",+ "Pasted {count} clips": "Clip incollate: {count}",+ "Pasted element": "Elemento incollato",+ "Duplicated clip": "Clip duplicata",+ "Duplicated {count} clips": "Clip duplicate: {count}",+ "Failed to copy": "Copia non riuscita",+ "Failed to paste": "Incolla non riuscito",+ "Failed to duplicate": "Duplicazione non riuscita",+ "Failed to split timeline clip": "Impossibile dividere la clip",+ "Failed to split clips": "Impossibile dividere le clip",+ "Undid: {label}": "Annullato: {label}",+ "Redid: {label}": "Ripristinato: {label}",+ "Undid {label}": "Annullato: {label}",+ "Redid {label}": "Ripristinato: {label}",+ "undo": "annullare",+ "redo": "ripristinare",+ "Split {name} at {time}s": "Dividi {name} a {time}s",+ "Split {count} clips at {time}s": "Dividi {count} clip a {time}s",+ "Add block: {name}": "Aggiungi blocco: {name}",+ "Add component: {name}": "Aggiungi componente: {name}",+ "Adding {name}…": "Aggiunta di {name}…",+ "Failed to install block": "Impossibile installare il blocco",+ "Install failed": "Installazione non riuscita",+ "Failed to add block": "Impossibile aggiungere il blocco",+ "{title} opened": "{title} aperto",+ "{title} closed": "{title} chiuso",+ "{title} maximized": "{title} ingrandito",+ "{title} restored": "{title} ripristinato",+ "No playable video found. Export a video file and try again.": "Nessun video riproducibile trovato. Esporta un file video e riprova.",+ "No playable audio found. Export an audio file and try again.": "Nessun audio riproducibile trovato. Esporta un file audio e riprova.",+ "Cannot read this media file. Check that it is complete or export it again.": "Impossibile leggere il file multimediale. Verifica che sia completo o esportalo di nuovo.",+ "Cannot read the media information. Export the file again and retry.": "Impossibile leggere le informazioni del file. Esportalo di nuovo e riprova.",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "Impossibile avviare la verifica. Controlla la configurazione degli strumenti multimediali locali e riprova.",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "Verifica non disponibile. Il file è stato aggiunto, ma la riproduzione non è stata verificata.",+ "Could not validate this media file. Check the file and retry.": "Impossibile verificare il file. Controllalo e riprova.",+ "The project changed. Refresh the editor before trying again.": "Il progetto è cambiato. Aggiorna l’editor prima di riprovare.",+ "Cannot connect to the preview service. Check the connection and retry.": "Impossibile connettersi al servizio di anteprima. Controlla la connessione e riprova.",+ "The operation could not be completed. Check the project and retry.": "Impossibile completare l’operazione. Controlla il progetto e riprova.",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "Impossibile annullare la divisione in sicurezza. Ricarica e controlla il progetto prima di modificarlo ancora.",+ "The project changed during splitting. Refresh the editor and retry.": "Il progetto è cambiato durante la divisione. Aggiorna l’editor e riprova.",+ "Cannot read the latest clip source. Refresh the editor and retry.": "Impossibile leggere la sorgente attuale della clip. Aggiorna l’editor e riprova.",+ "This clip cannot be split. Select a different clip.": "Questa clip non può essere divisa. Selezionane un’altra.",+ "Could not split the clip. Check the current clip and retry.": "Impossibile dividere la clip. Controlla la clip attuale e riprova.",+ "Nothing selected to copy.": "Nessun elemento selezionato da copiare.",+ "Nothing to paste.": "Nulla da incollare.",+ "Couldn't copy to the clipboard. Check browser permissions": "Impossibile copiare negli appunti. Controlla le autorizzazioni del browser",+ "Preview not ready. Try again": "Anteprima non pronta. Riprova",+ "Select an element first": "Seleziona prima un elemento",+ "{value0} track{suffix}": "Traccia{suffix}: {value0}",+ "{value0} tracks": "{value0} tracce",+ "{value0} {label} tracks": "{value0} tracce {label}",+ "Show track {number}": "Mostra traccia {number}",+ "Hide track {number}": "Nascondi traccia {number}",+ "Search projects": "Cerca progetti",+ "Search projects…": "Cerca progetti…",+ "Toggle timeline snapping": "Attiva/disattiva aggancio",+ "Snapping on ({value0})": "Aggancio attivo ({value0})",+ "Snapping off ({value0})": "Aggancio disattivato ({value0})",+ "Fit timeline to width": "Adatta timeline alla larghezza",+ "Zoom to selected clips": "Adatta alle clip selezionate",+ "Zoom to selected clips ({value0})": "Adatta alla selezione ({value0})",+ "Select a clip to zoom the timeline": "Seleziona una clip da visualizzare",+ "Delete timeline clip": "Elimina clip dalla timeline",+ "Move animation path": "Sposta percorso di animazione",+ "Edit x (whole animation)": "Modifica posizione X (intera animazione)",+ "Edit y (whole animation)": "Modifica posizione Y (intera animazione)",+ "No clips yet": "Nessuna clip ancora",+ "No editable content": "Nessun contenuto modificabile",+ "No content to export. Add media first.": "Nessun contenuto da esportare. Aggiungi prima dei media."+ },+ "tr": {+ "Expand": "Genişlet",+ "Collapse": "Daralt",+ "Expand left panel": "Sol paneli aç",+ "Collapse left panel": "Sol paneli kapat",+ "Expand right panel": "Sağ paneli aç",+ "Collapse right panel": "Sağ paneli kapat",+ "Left panels": "Sol paneller",+ "Right panels": "Sağ paneller",+ "Expand preview": "Önizlemeyi genişlet",+ "Restore preview": "Önizlemeyi geri yükle",+ "Align left": "Sola hizala",+ "Align center": "Ortala",+ "Align right": "Sağa hizala",+ "Increase": "Artır",+ "Decrease": "Azalt",+ "Split": "Böl",+ "Import files": "Dosya içe aktar",+ "Projects": "Projeler",+ "Project list": "Proje listesi",+ "Open active project": "Etkin projeyi aç",+ "System": "Sistem",+ "Imported": "İçe aktarıldı",+ "Document": "Belge",+ "Current": "Geçerli",+ "Took {value0}": "Süre: {value0}",+ "Change volume": "Ses düzeyini değiştir",+ "Fade in": "Yavaşça açılma",+ "Fade out": "Yavaşça kapanma",+ "Timeline track view": "Zaman çizelgesi kanalları",+ "Project assets": "Proje medyası",+ "Code Animations": "Kod animasyonları",+ "VFX": "Görsel efektler",+ "Transitions": "Geçişler",+ "Text Effects": "Metin efektleri",+ "Social": "Sosyal medya",+ "Data": "Veri",+ "Scenes": "Sahneler",+ "Fill: {fill} · {opacity}%": "Dolgu: {fill} · {opacity}%",+ "Image/gradient": "Görsel/gradyan",+ "Choose…": "Seç…",+ "Canvas": "Tuval",+ "Panels": "Paneller",+ "File on disk": "Diskteki dosya",+ "Unsaved Studio version": "Kaydedilmemiş Studio sürümü",+ "Row": "Satır",+ "Column": "Sütun",+ "Bring to front": "En öne getir",+ "Bring forward": "Öne getir",+ "Send backward": "Arkaya gönder",+ "Send to back": "En arkaya gönder",+ "Top": "Üst",+ "Right": "Sağ",+ "Bottom": "Alt",+ "Left": "Sol",+ "playhead": "Oynatma kafası",+ "clip edge": "Klip kenarı",+ "beat": "Vuruş",+ "grid line": "Izgara çizgisi",+ "Zoomed {percent}%": "Yakınlaştırma: %{percent}",+ "Panned": "Görünüm kaydırıldı",+ "Undo": "Geri al",+ "Redo": "Yinele",+ "Undo: {label}": "Geri al: {label}",+ "Redo: {label}": "Yinele: {label}",+ "Composition canvas": "Kompozisyon tuvali",+ "Version history": "Sürüm geçmişi",+ "Undone": "Geri alındı",+ "track": "kanal",+ "this track": "bu kanal",+ "Click any element on the canvas to edit it.": "Düzenlemek için tuvaldeki bir öğeye tıklayın.",+ "Create a project with your Agent to start editing.": "Düzenlemeye başlamak için Agent ile bir proje oluşturun.",+ "Import files or describe your video to your Agent.": "Dosyaları içe aktarın veya videonuzu Agent’a anlatın.",+ "Everyday video, widely compatible.": "Geniş uyumluluğa sahip standart video biçimi.",+ "Transparent video for editing. Larger files.": "Düzenleme için şeffaf video. Dosya boyutu daha büyüktür.",+ "Transparent video for web. Limited editor support.": "Web için şeffaf video. Düzenleyici desteği sınırlıdır.",+ "Animated image, no audio. Up to 30 fps.": "Sessiz animasyonlu görsel. En fazla 30 fps.",+ "Click a clip where you want to split it. Switch back to Select to move or select clips.": "Klipte bölmek istediğiniz yere tıklayın. Klipleri taşımak veya seçmek için Seç aracına dönün.",+ "When enabled, dragged clips snap to nearby clip edges and the playhead for easier alignment.": "Etkinleştirildiğinde sürüklenen klipler, kolay hizalama için yakındaki klip kenarlarına ve oynatma kafasına yapışır.",+ "Adjust the timeline view to fit the selected clips, making detailed edits easier.": "Ayrıntılı düzenleme için zaman çizelgesini seçili kliplere sığdırır.",+ "First select one or more clips in the timeline, then use this to fit them into view.": "Önce zaman çizelgesinde bir veya daha fazla klip seçin, ardından bu düğmeyle görünüme sığdırın.",+ "Show the full timeline in the available width. This only changes the view, not the video duration.": "Tüm zaman çizelgesini mevcut genişliğe sığdırır. Yalnızca görünüm değişir, video süresi değişmez.",+ "Return to the editor layout. You can also press Esc.": "Düzenleyici düzenine dönün. Esc tuşunu da kullanabilirsiniz.",+ "Enlarge the preview within this workspace, keeping your chat visible.": "Sohbet görünür kalırken çalışma alanındaki önizlemeyi genişletir.",+ "Split (move playhead inside clip)": "Böl (oynatma kafasını klibin içine taşıyın)",+ "Edit layer style": "Katman stilini düzenle",+ "Move layer": "Katmanı taşı",+ "Rotate layer": "Katmanı döndür",+ "Resize layer": "Katmanı boyutlandır",+ "Resize layer box": "Katman kutusunu boyutlandır",+ "Reset layer edits": "Katman düzenlemelerini sıfırla",+ "Reorder layers": "Katmanları yeniden sırala",+ "Edit text": "Metni düzenle",+ "Edit timing": "Zamanlamayı düzenle",+ "Edit source": "Kaynağı düzenle",+ "Delete element": "Öğeyi sil",+ "Add timeline asset": "Zaman çizelgesine medya ekle",+ "Add composition to timeline": "Zaman çizelgesine kompozisyon ekle",+ "Move timeline clip": "Zaman çizelgesi klibini taşı",+ "Move timeline clips": "Zaman çizelgesi kliplerini taşı",+ "Resize timeline clip": "Klip süresini değiştir",+ "Resize timeline clips": "Klip sürelerini değiştir",+ "Split timeline clip": "Zaman çizelgesi klibini böl",+ "Duplicate clip": "Klibi çoğalt",+ "Duplicate clips": "Klipleri çoğalt",+ "Paste clip": "Klibi yapıştır",+ "Paste clips": "Klipleri yapıştır",+ "Move clip": "Klibi taşı",+ "Trim clip": "Klibi kırp",+ "Split clip": "Klibi böl",+ "Resize": "Boyutlandır",+ "Unlink clips": "Kliplerin bağlantısını kaldır",+ "Link clips": "Klipleri bağla",+ "Detach audio": "Sesi ayır",+ "Merge audio back into video": "Sesi videoyla yeniden birleştir",+ "Delete this clip only": "Yalnızca bu klibi sil",+ "Copied clip": "Klip kopyalandı",+ "Copied {count} clips": "Kopyalanan klip: {count}",+ "Copied element": "Öğe kopyalandı",+ "Pasted clip": "Klip yapıştırıldı",+ "Pasted {count} clips": "Yapıştırılan klip: {count}",+ "Pasted element": "Öğe yapıştırıldı",+ "Duplicated clip": "Klip çoğaltıldı",+ "Duplicated {count} clips": "Çoğaltılan klip: {count}",+ "Failed to copy": "Kopyalama başarısız",+ "Failed to paste": "Yapıştırma başarısız",+ "Failed to duplicate": "Çoğaltma başarısız",+ "Failed to split timeline clip": "Klip bölünemedi",+ "Failed to split clips": "Klipler bölünemedi",+ "Undid: {label}": "Geri alındı: {label}",+ "Redid: {label}": "Yinelendi: {label}",+ "Undid {label}": "Geri alındı: {label}",+ "Redid {label}": "Yinelendi: {label}",+ "undo": "geri al",+ "redo": "yinele",+ "Split {name} at {time}s": "{name} klibini {time} sn konumunda böl",+ "Split {count} clips at {time}s": "{count} klibi {time} sn konumunda böl",+ "Add block: {name}": "Blok ekle: {name}",+ "Add component: {name}": "Bileşen ekle: {name}",+ "Adding {name}…": "{name} ekleniyor…",+ "Failed to install block": "Blok yüklenemedi",+ "Install failed": "Yükleme başarısız",+ "Failed to add block": "Blok eklenemedi",+ "{title} opened": "{title} açıldı",+ "{title} closed": "{title} kapatıldı",+ "{title} maximized": "{title} büyütüldü",+ "{title} restored": "{title} geri yüklendi",+ "No playable video found. Export a video file and try again.": "Oynatılabilir video bulunamadı. Bir video dosyası dışa aktarıp yeniden deneyin.",+ "No playable audio found. Export an audio file and try again.": "Oynatılabilir ses bulunamadı. Bir ses dosyası dışa aktarıp yeniden deneyin.",+ "Cannot read this media file. Check that it is complete or export it again.": "Medya dosyası okunamıyor. Eksiksiz olduğunu kontrol edin veya yeniden dışa aktarın.",+ "Cannot read the media information. Export the file again and retry.": "Medya bilgileri okunamıyor. Dosyayı yeniden dışa aktarıp tekrar deneyin.",+ "The media checker cannot start. Check the local media-tool configuration and retry.": "Medya denetimi başlatılamıyor. Yerel medya aracı yapılandırmasını kontrol edip yeniden deneyin.",+ "Media checking is unavailable. The file was added, but playback has not been verified.": "Medya denetimi kullanılamıyor. Dosya eklendi ancak oynatılabilirliği doğrulanmadı.",+ "Could not validate this media file. Check the file and retry.": "Medya dosyası doğrulanamadı. Dosyayı kontrol edip yeniden deneyin.",+ "The project changed. Refresh the editor before trying again.": "Proje değişti. Yeniden denemeden önce düzenleyiciyi yenileyin.",+ "Cannot connect to the preview service. Check the connection and retry.": "Önizleme hizmetine bağlanılamıyor. Bağlantıyı kontrol edip yeniden deneyin.",+ "The operation could not be completed. Check the project and retry.": "İşlem tamamlanamadı. Projeyi kontrol edip yeniden deneyin.",+ "The split could not be rolled back safely. Reload and check the project before editing again.": "Bölme işlemi güvenle geri alınamadı. Düzenlemeye devam etmeden önce projeyi yeniden yükleyip kontrol edin.",+ "The project changed during splitting. Refresh the editor and retry.": "Bölme sırasında proje değişti. Düzenleyiciyi yenileyip tekrar deneyin.",+ "Cannot read the latest clip source. Refresh the editor and retry.": "Klibin güncel kaynağı okunamıyor. Düzenleyiciyi yenileyip tekrar deneyin.",+ "This clip cannot be split. Select a different clip.": "Bu klip bölünemez. Başka bir klip seçin.",+ "Could not split the clip. Check the current clip and retry.": "Klip bölünemedi. Geçerli klibi kontrol edip yeniden deneyin.",+ "Nothing selected to copy.": "Kopyalanacak öğe seçilmedi.",+ "Nothing to paste.": "Yapıştırılacak öğe yok.",+ "Couldn't copy to the clipboard. Check browser permissions": "Panoya kopyalanamadı. Tarayıcı izinlerini kontrol edin",+ "Preview not ready. Try again": "Önizleme hazır değil. Yeniden deneyin",+ "Select an element first": "Önce bir öğe seçin",+ "{value0} track{suffix}": "Kanal{suffix}: {value0}",+ "{value0} tracks": "{value0} kanal",+ "{value0} {label} tracks": "{value0} {label} kanalı",+ "Show track {number}": "{number}. kanalı göster",+ "Hide track {number}": "{number}. kanalı gizle",+ "Search projects": "Proje ara",+ "Search projects…": "Proje ara…",+ "Toggle timeline snapping": "Zaman çizelgesi yapışmasını değiştir",+ "Snapping on ({value0})": "Yapışma açık ({value0})",+ "Snapping off ({value0})": "Yapışma kapalı ({value0})",+ "Fit timeline to width": "Zaman çizelgesini genişliğe sığdır",+ "Zoom to selected clips": "Seçili kliplere sığdır",+ "Zoom to selected clips ({value0})": "Seçili kliplere sığdır ({value0})",+ "Select a clip to zoom the timeline": "Görünüme sığdırmak için bir klip seçin",+ "Delete timeline clip": "Zaman çizelgesi klibini sil",+ "Move animation path": "Animasyon yolunu taşı",+ "Edit x (whole animation)": "X konumunu düzenle (tüm animasyon)",+ "Edit y (whole animation)": "Y konumunu düzenle (tüm animasyon)",+ "No clips yet": "Henüz klip yok",+ "No editable content": "Düzenlenebilir içerik yok",+ "No content to export. Add media first.": "Dışa aktarılacak içerik yok. Önce medya ekleyin."+ }+}diff --git a/studio/src/i18n/mvp-zh-CN.json b/studio/src/i18n/mvp-zh-CN.jsonindex cc3f2a0d..d1c6c240 100644--- a/studio/src/i18n/mvp-zh-CN.json+++ b/studio/src/i18n/mvp-zh-CN.json@@ -965,5 +965,27 @@"Technical details": "技术详情","Preparation progress unavailable": "暂时无法获取准备进度","Your files are ready to import": "所选文件可继续导入",- "Continue import": "继续导入"+ "Continue import": "继续导入",+ "Expand left panel": "展开左侧面板",+ "Edit y (whole animation)": "修改 Y 坐标(整个动画)",+ "Show track {number}": "显示轨道 {number}",+ "Move timeline clips": "移动时间轴片段",+ "Align center": "居中对齐",+ "Collapse right panel": "收起右侧面板",+ "Edit x (whole animation)": "修改 X 坐标(整个动画)",+ "Expand right panel": "展开右侧面板",+ "Hide track {number}": "隐藏轨道 {number}",+ "No clips yet": "暂无片段",+ "WebP (not yet available)": "WebP(待接入)",+ "Collapse": "收起",+ "Left panels": "左侧面板",+ "Right panels": "右侧面板",+ "Collapse left panel": "收起左侧面板",+ "Align right": "右对齐",+ "Delete timeline clip": "删除时间轴片段",+ "Change volume": "调整音量",+ "Align left": "左对齐",+ "No content to export. Add media first.": "暂无可导出的内容,请先添加素材。",+ "Expand": "展开",+ "No editable content": "暂无可编辑内容"}diff --git a/studio/src/i18n/styleHistory.test.ts b/studio/src/i18n/styleHistory.test.tsnew file mode 100644index 00000000..17395aba--- /dev/null+++ b/studio/src/i18n/styleHistory.test.ts@@ -0,0 +1,34 @@+import { expect, it } from 'vitest';+import { styleHistoryLabel } from './styleHistory';+import { historyEntryLabel } from './historyMessages';+import { languages, translate } from './messages';++const zh = (message: string, values?: Record<string, string | number>) => translate('zh-CN', message, values);++it('names the authored target and changed property without adding a line', () => {+ const label = styleHistoryLabel('Make it\nmove.', { 'font-size': '96px' });+ expect(historyEntryLabel(label, zh)).toBe('Make it move. · 字号: 96px');+ expect(historyEntryLabel(`Undid: ${label}`, zh)).toBe('撤销:Make it move. · 字号: 96px');+});++it('describes the overall opacity multiplier without exposing its filter implementation', () => {+ const label = styleHistoryLabel('Title', { '--hf-layer-opacity': '0.47', filter: 'blur(2px) opacity(var(--hf-layer-opacity))' });+ expect(historyEntryLabel(label, zh)).toBe('Title · 不透明度: 47%');+ expect(historyEntryLabel(styleHistoryLabel('Title', { opacity: '0' }), zh)).toBe('Title · 不透明度: 0%');+});++it('localizes properties in all locales while preserving punctuation in authored names', () => {+ const target = 'My "Title" · 日本語';+ const label = styleHistoryLabel(target, { color: '#123456', 'font-size': '32px' });+ for (const { locale } of languages) {+ const t = (message: string) => translate(locale, message);+ expect(historyEntryLabel(label, t)).toBe(`${target} · ${t('Color')}: #123456 / ${t('Font size')}: 32px`);+ }+});++it('keeps legacy and malformed labels readable without guessing missing changes', () => {+ expect(historyEntryLabel('Edit layer style', zh)).toBe('编辑图层样式');+ for (const label of ['Edit layer style: invalid', 'Edit layer style: ["Title",null]', 'Edit layer style: ["Title",[["color",{}]]]']) {+ expect(historyEntryLabel(label, zh)).toBe(label);+ }+});diff --git a/studio/src/i18n/styleHistory.ts b/studio/src/i18n/styleHistory.tsnew file mode 100644index 00000000..dce63ddc--- /dev/null+++ b/studio/src/i18n/styleHistory.ts@@ -0,0 +1,44 @@+import type { Translate } from './messages';++const PREFIX = 'Edit layer style: ';+const propertyLabels: Record<string, string> = {+ opacity: 'Opacity', 'font-size': 'Font size', color: 'Color',+ 'font-family': 'Font', 'text-align': 'Align', 'background-color': 'Background',+ 'line-height': 'Line height', 'letter-spacing': 'Letter spacing',+ 'border-radius': 'Radius',+};+const compact = (value: string, limit: number) => {+ const singleLine = value.replace(/\s+/g, ' ').trim();+ return singleLine.length > limit ? singleLine.slice(0, limit - 1) + '…' : singleLine;+};++/** Keep locale-neutral edit details in the existing history label contract. */+export function styleHistoryLabel(target: string, styles: Record<string, string>): string {+ const multiplier = styles['--hf-layer-opacity'];+ const changes = Object.entries(styles)+ .filter(([property]) => !(multiplier !== undefined && property === 'filter'))+ .map(([property, value]) => {+ const key = property === '--hf-layer-opacity' ? 'opacity' : property;+ const number = Number(value);+ const shown = key === 'opacity' && value.trim() && Number.isFinite(number)+ ? `${Math.round(number * 10000) / 100}%` : compact(value, 60);+ return [key, shown];+ });+ return PREFIX + JSON.stringify([compact(target, 48), changes]);+}++/** Old/plain labels remain readable; malformed metadata must never break history. */+export function formatStyleHistoryLabel(label: string, t: Translate): string | null {+ if (!label.startsWith(PREFIX)) return null;+ try {+ const data: unknown = JSON.parse(label.slice(PREFIX.length));+ if (!Array.isArray(data) || data.length !== 2 || typeof data[0] !== 'string' || !Array.isArray(data[1]) || !data[1].length) return null;+ const changes: string[] = [];+ for (const change of data[1]) {+ if (!Array.isArray(change) || change.length !== 2 || change.some(value => typeof value !== 'string')) return null;+ const [property, value] = change as [string, string];+ changes.push(`${t(propertyLabels[property] ?? property)}: ${value || t('Auto')}`);+ }+ return `${data[0]} · ${changes.join(' / ')}`;+ } catch { return null; }+}diff --git a/studio/src/i18n/zh-CN.json b/studio/src/i18n/zh-CN.jsonindex 4ea27c80..ed9035be 100644--- a/studio/src/i18n/zh-CN.json+++ b/studio/src/i18n/zh-CN.json@@ -744,7 +744,7 @@"Version history": "版本历史","View version history": "查看版本历史","Keep current version": "保留当前版本",- "Keep this version": "保留此版本",+ "Keep this version": "保留选中版本","Unpin version": "取消保留","Pinned": "已保留","Latest": "最新",diff --git a/studio/src/icons/RemixIcons.tsx b/studio/src/icons/RemixIcons.tsxindex 4b406e20..40d02984 100644--- a/studio/src/icons/RemixIcons.tsx+++ b/studio/src/icons/RemixIcons.tsx@@ -103,6 +103,8 @@ export const SpeakerHigh = icon("volume-up-line");export const SpeakerSlash = icon("volume-mute-line");export const Square = icon("checkbox-blank-line");export const SquareSplitVertical = icon("layout-column-line");+export const Sidebar = icon("side-bar-line");+export const Sparkle = icon("sparkling-line");export const SquaresFour = icon("apps-2-line");export const Stack = icon("stack-line");export const TextAa = icon("font-size");@@ -112,3 +114,6 @@ export const WarningIcon = icon("alert-line");export const Waveform = icon("voiceprint-line");export const X = icon("close-line");export const XIcon = icon("close-line");++/** Focus the timeline viewport on the selected clip range. */+export const ZoomSelection = icon("focus-3-line");diff --git a/studio/src/motion/ArtifactViewer.tsx b/studio/src/motion/ArtifactViewer.tsxindex 7ee648a8..d110dd37 100644--- a/studio/src/motion/ArtifactViewer.tsx+++ b/studio/src/motion/ArtifactViewer.tsx@@ -1,6 +1,6 @@import { lazy, Suspense, type ComponentType } from 'react';import type { ArtifactKind, SessionArtifact } from '../../../shared/session';-import { useI18n } from '../i18n/I18n';+import { MotionLoading } from './MotionLoading';// Add a viewer adapter here when a mode introduces a new artifact kind.// The session and browser shell do not own the editor's internal state.@@ -8,7 +8,6 @@ const viewers: Record<ArtifactKind, ComponentType> = {'motion-project': lazy(() => import('../App').then(module => ({ default: module.StudioApp }))),};export function ArtifactViewer({ artifact }: { artifact: SessionArtifact }) {- const { t } = useI18n();const Viewer = viewers[artifact.kind];- return <Suspense fallback={<div className="motion-route-state" role="status">{t('Opening project…')}</div>}><Viewer /></Suspense>;+ return <Suspense fallback={<MotionLoading />}><Viewer /></Suspense>;}diff --git a/studio/src/motion/ConnectionDialog.test.tsx b/studio/src/motion/ConnectionDialog.test.tsxnew file mode 100644index 00000000..dcb19778--- /dev/null+++ b/studio/src/motion/ConnectionDialog.test.tsx@@ -0,0 +1,45 @@+// @vitest-environment happy-dom+import React, { act, useState } from 'react';+import { createRoot } from 'react-dom/client';+import { afterEach, expect, it, vi } from 'vitest';+import { ConnectionDialog } from './ConnectionDialog';+import { I18nProvider } from '../i18n/I18n';++vi.mock('../../../web/connect', () => ({ mountConnection: () => ({+ destroy() {}, suspend() {}, resume() {}, showTemplates() {}, setLanguage() {},+}) }));+Reflect.set(globalThis, 'IS_REACT_ACT_ENVIRONMENT', true);+afterEach(() => { vi.unstubAllGlobals(); vi.restoreAllMocks(); document.body.innerHTML = ''; });++it.each(['escape', 'close'])('restores focus after conditional unmount via %s, including repeated opens', async method => {+ vi.stubGlobal('fetch', vi.fn(async () => Response.json({ items: [], next: null, catalogVersion: 'test' })));+ const host = document.createElement('div'); document.body.append(host);+ const root = createRoot(host);+ vi.spyOn(HTMLDialogElement.prototype, 'showModal').mockImplementation(function () {+ this.setAttribute('open', ''); this.querySelector<HTMLButtonElement>('button')?.focus();+ });+ const close = vi.spyOn(HTMLDialogElement.prototype, 'close').mockImplementation(function () { this.removeAttribute('open'); });+ function Harness() {+ const [trigger, setTrigger] = useState<HTMLElement | null>(null);+ return <><button onClick={event => setTrigger(event.currentTarget)}>Library</button>+ {trigger && <ConnectionDialog open section="templates" returnFocus={trigger} busy={false} error="" onClose={() => setTrigger(null)} onOpen={() => {}} />}</>;+ }+ try {+ await act(async () => root.render(<I18nProvider><Harness /></I18nProvider>));+ const trigger = host.querySelector('button')!;+ const openedDialogs: HTMLDialogElement[] = [];+ for (let i = 0; i < 2; i++) {+ await act(async () => trigger.click());+ expect(document.activeElement).toBe(host.querySelector('dialog button'));+ const dialog = host.querySelector('dialog')!;+ openedDialogs.push(dialog);+ await act(async () => {+ if (method === 'escape') dialog.dispatchEvent(new Event('cancel', { bubbles: false, cancelable: true }));+ else host.querySelector<HTMLButtonElement>('dialog header button')!.click();+ });+ expect(host.querySelector('dialog')).toBeNull();+ expect(document.activeElement).toBe(trigger);+ }+ expect(close.mock.contexts.filter(dialog => openedDialogs.includes(dialog as HTMLDialogElement))).toHaveLength(2);+ } finally { act(() => root.unmount()); host.remove(); }+});diff --git a/studio/src/motion/ConnectionDialog.tsx b/studio/src/motion/ConnectionDialog.tsxindex 5d665a9f..0b785ef2 100644--- a/studio/src/motion/ConnectionDialog.tsx+++ b/studio/src/motion/ConnectionDialog.tsx@@ -9,7 +9,7 @@ import '../../../web/design-system/controls.css';import '../../../web/connect.css';import '../../../web/template-gallery.css';-type Props = { open: boolean; section?: 'setup' | 'templates'; busy: boolean; error: string; onClose: () => void; onOpen: (id: string) => void };+type Props = { open: boolean; section?: 'setup' | 'templates'; busy: boolean; error: string; returnFocus?: HTMLElement | null; onClose: () => void; onOpen: (id: string) => void };/** The original integration page lives inside one modal; Studio stays mounted beneath it. */export function ConnectionDialog(props: Props) {@@ -45,11 +45,19 @@ function LegacyConnectionDialog(props: Props) {}, [mvp]);useEffect(() => { controller.current?.setLanguage(locale, t); }, [locale, t, mvp]);useEffect(() => {- if (!props.open) { controller.current?.suspend(); dialog.current?.close(); return; }- dialog.current?.showModal(); controller.current?.resume();+ // Capture the node: React clears the ref before passive unmount cleanup.+ const node = dialog.current;+ if (!props.open) { controller.current?.suspend(); node?.close(); return; }+ const returnFocus = props.returnFocus ?? document.activeElement;+ node?.showModal(); controller.current?.resume();if (props.section === 'templates') controller.current?.showTemplates();- return () => { controller.current?.suspend(); dialog.current?.close(); };- }, [props.open, props.section]);+ return () => {+ controller.current?.suspend(); node?.close();+ if (returnFocus instanceof HTMLElement && returnFocus.isConnected && !returnFocus.matches(':disabled')) {+ returnFocus.focus({ preventScroll: true });+ }+ };+ }, [props.open, props.section, props.returnFocus]);return <dialog ref={dialog} className="connection-dialog" aria-labelledby="connection-dialog-title"onKeyDown={event => event.stopPropagation()}onCancel={event => { if (event.target !== dialog.current) return; event.preventDefault(); if (!props.busy) props.onClose(); }}>diff --git a/studio/src/motion/MotionApp.test.tsx b/studio/src/motion/MotionApp.test.tsxindex c4800301..0c4b5fb4 100644--- a/studio/src/motion/MotionApp.test.tsx+++ b/studio/src/motion/MotionApp.test.tsx@@ -82,3 +82,23 @@ it.each(['deleted project', 'empty session'])('keeps the project drawer reachablhistory.replaceState(null, '', '/');}});++it('shows the brand while opening and exposes failures instead of leaving the splash stuck', async () => {+ let fail!: (error: Error) => void;+ vi.stubGlobal('fetch', vi.fn(() => new Promise<Response>((_resolve, reject) => { fail = reject; })));+ history.replaceState(null, '', '/?project=project');+ const container = document.createElement('div');+ document.body.append(container);+ const root = createRoot(container);+ try {+ await act(async () => root.render(<I18nProvider><MotionApp /></I18nProvider>));+ expect(container.querySelector('[role="status"] .motion-loading-mark')).not.toBeNull();+ await act(async () => fail(new Error('Project unavailable')));+ expect(container.querySelector('.motion-loading')).toBeNull();+ expect(container.querySelector('[role="alert"]')?.textContent).toContain('Project unavailable');+ } finally {+ act(() => root.unmount());+ container.remove();+ history.replaceState(null, '', '/');+ }+});diff --git a/studio/src/motion/MotionApp.tsx b/studio/src/motion/MotionApp.tsxindex 5266843c..1f731f81 100644--- a/studio/src/motion/MotionApp.tsx+++ b/studio/src/motion/MotionApp.tsx@@ -5,6 +5,7 @@ import { motionApi, type ProjectCatalog } from './useWorkspace';import { requestedProject, validWorkspaceProject } from './workspaceRouting';import type { SessionDetail, SessionArtifact } from '../../../shared/session';import { ArtifactViewer } from './ArtifactViewer';+import { MotionLoading } from './MotionLoading';import { trackMotion } from './tracking';const noPendingSaves = async () => {};@@ -57,6 +58,6 @@ export function MotionApp() {return () => controller.abort();}, [projectId, sessionId, attempt]);if (error) return <WorkspaceFrame waitForSaves={noPendingSaves}><div className="motion-route-state" role="alert"><h1>{t('Could not open project')}</h1><p>{t(error)}</p><div><WorkspaceMenuButton /><a className="motion-button" href="/">{t('Open active project')}</a><button className="motion-button" onClick={() => retry(value => value + 1)}>{t('Retry')}</button></div></div></WorkspaceFrame>;- const loading = <div className="motion-route-state" role="status">{t('Opening project…')}</div>;+ const loading = <MotionLoading />;return ready ? <WorkspaceFrame waitForSaves={noPendingSaves} projectId={ready.artifact?.projectId} sessionId={ready.sessionId}>{ready.artifact ? <ArtifactViewer artifact={ready.artifact} /> : <div className="motion-route-state"><WorkspaceMenuButton />{t('Create a project with your Agent to start editing.')}</div>}</WorkspaceFrame> : loading;}diff --git a/studio/src/motion/MotionHistoryPanel.test.tsx b/studio/src/motion/MotionHistoryPanel.test.tsxindex b94ed806..39d88e27 100644--- a/studio/src/motion/MotionHistoryPanel.test.tsx+++ b/studio/src/motion/MotionHistoryPanel.test.tsx@@ -59,6 +59,23 @@ it('restores the selected version with the native API and reloads only after sucexpect(onRestored).toHaveBeenCalledOnce();});+it('omits pinning controls in the MVP while keeping all versions restorable', async () => {+ entries[0].pinned = true;+ await act(async () => root.render(<I18nProvider initialLocale="zh-CN"><MotionHistoryPanel compact allowPinning={false} onRestored={onRestored} /></I18nProvider>));+ expect(container.querySelector('.motion-history-toolbar')).toBeNull();+ expect(container.querySelector('.motion-history-filters')).toBeNull();+ expect(container.textContent).not.toContain('已保留');+ expect(button('保留')).toBeUndefined();+ expect(container.querySelector('.motion-history-detail-title')).toBeNull();+ expect(container.querySelector('.motion-history-detail ul')).toBeNull();+ expect(container.querySelector('.motion-history-detail')?.textContent).toBe('恢复此版本');+ await click('first edit'); await click('恢复此版本');+ expect(calls.filter(call => call.body)).toEqual([+ { path: '/checkpoint', body: {} }, { path: '/restore', body: { point: 'first' } },+ ]);+ expect(onRestored).toHaveBeenCalledOnce();+});+it('does not replace the project when pending edits fail to save', async () => {shell.waitForPendingDomEditSaves.mockRejectedValue(new Error('Save conflict'));await render(); await click('first edit'); await click('恢复此版本');@@ -77,5 +94,5 @@ it('shows native restore refusals and keeps the current editor open', async () =it('blocks restoring and pinning during a render', async () => {shell.renderQueue.isRendering = true;await render(); await click('first edit');- for (const text of ['恢复此版本', '保留此版本', '保留当前版本']) expect(button(text).disabled).toBe(true);+ for (const text of ['恢复此版本', '保留选中版本', '保留当前版本']) expect(button(text).disabled).toBe(true);});diff --git a/studio/src/motion/MotionHistoryPanel.tsx b/studio/src/motion/MotionHistoryPanel.tsxindex 718b95ff..a38005db 100644--- a/studio/src/motion/MotionHistoryPanel.tsx+++ b/studio/src/motion/MotionHistoryPanel.tsx@@ -24,7 +24,7 @@ export async function historyRequest<T>(projectId: string, action = '', body?: oconst reloadProject = () => window.location.reload();/** Reads and restores Studio's own history; no parallel snapshot store or undo stack. */-export function MotionHistoryPanel({ onRestored = reloadProject }: { onRestored?: () => void }) {+export function MotionHistoryPanel({ onRestored = reloadProject, compact = false, allowPinning = true }: { onRestored?: () => void; compact?: boolean; allowPinning?: boolean }) {const { t, formatDate } = useI18n();const { projectId, waitForPendingDomEditSaves, writeBlockedReason, renderQueue, showToast } = useStudioShellContext();const historyOperation = useMotionHistoryOperation();@@ -97,19 +97,19 @@ export function MotionHistoryPanel({ onRestored = reloadProject }: { onRestored?onRestored();});- const shown = [...entries].reverse().filter(entry => !onlyPinned || entry.pinned);+ const shown = [...entries].reverse().filter(entry => !allowPinning || !onlyPinned || entry.pinned);const selected = shown.find(entry => entry.id === selectedId) ?? shown[0];const disabled = busy || historyOperation.busy || Boolean(writeBlockedReason) || renderQueue.isRendering;return <section className="motion-history-panel" aria-label={t("Version history")} aria-busy={busy || loading}>- <div className="motion-history-toolbar">- <div><strong>{t("Version history")}</strong><span>{t("Changes are recorded automatically. Pin important versions to keep them.")}</span></div>- <button type="button" className="motion-button" disabled={disabled || loading} onClick={() => void keepCurrent()}>- <MotionIcon name="save" size={14} />{t("Keep current version")}</button>- </div>- <div className="motion-history-filters" aria-label={t("Filter versions")}>+ {(!compact || allowPinning) && <div className={`motion-history-toolbar${compact ? ' motion-history-toolbar-compact' : ''}`}>+ {!compact && <div><strong>{t("Version history")}</strong><span>{t("Changes are recorded automatically. Pin important versions to keep them.")}</span></div>}+ {allowPinning && <button type="button" className="motion-button" disabled={disabled || loading} onClick={() => void keepCurrent()}>+ <MotionIcon name="save" size={14} />{t("Keep current version")}</button>}+ </div>}+ {allowPinning && <div className="motion-history-filters" aria-label={t("Filter versions")}><button type="button" aria-pressed={!onlyPinned} onClick={() => setOnlyPinned(false)}>{t("All changes")}{" "}<span>{entries.length}</span></button><button type="button" aria-pressed={onlyPinned} onClick={() => setOnlyPinned(true)}>{t("Pinned")}{" "}<span>{entries.filter(entry => entry.pinned).length}</span></button>- </div>+ </div>}{(error || writeBlockedReason) && <div className="motion-history-message motion-error" role="alert">{t(error || writeBlockedReason || '')}{error && <button type="button" className="motion-button motion-button-quiet" disabled={busy}@@ -118,12 +118,12 @@ export function MotionHistoryPanel({ onRestored = reloadProject }: { onRestored?{notice && <div className="motion-history-message" role="status">{t(notice)}</div>}<div className="motion-history-list" aria-label={t("History entries")}>{loading ? <p className="motion-history-empty">{t("Reading versions…")}</p> : !shown.length ? <p className="motion-history-empty">- {onlyPinned ? t("No pinned versions yet. Select an entry to pin it.") : t("No edits yet. Changes made in the canvas, code, or by an agent will appear here.")}+ {allowPinning && onlyPinned ? t("No pinned versions yet. Select an entry to pin it.") : t("No edits yet. Changes made in the canvas, code, or by an agent will appear here.")}</p> : shown.map(entry => <button type="button" key={entry.id} className="motion-history-entry"aria-pressed={selected?.id === entry.id} onClick={() => setSelectedId(entry.id)}>- <span className="motion-history-entry-heading"><strong>{entry.restoredTo ? t('Restored a previous version') : historyEntryLabel(entry.label, t)}</strong>- {entry.pinned && <span className="motion-history-badge">{t("Pinned")}</span>}- {entry.id === entries.at(-1)?.id && <span className="motion-history-badge">{t("Latest")}</span>}+ <span className="motion-history-entry-heading"><strong title={entry.restoredTo ? t('Restored a previous version') : historyEntryLabel(entry.label, t)}>{entry.restoredTo ? t('Restored a previous version') : historyEntryLabel(entry.label, t)}</strong>+ {allowPinning && entry.pinned && <span className="motion-history-badge">{t("Pinned")}</span>}+ {entry.id === entries.at(-1)?.id && <span className="motion-history-badge motion-history-badge-latest">{t("Latest")}</span>}</span><span className="motion-history-entry-meta"><time dateTime={new Date(entry.endedAt).toISOString()}>{formatDate(entry.endedAt, { month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' })}</time><span>{entry.who.kind === 'person' ? t("Manual edit") : entry.who.kind === 'agent' ? entry.who.name : t("External change")} · {t('{count} files', { count: entry.files.length })}{entry.undone ? ` · ${t('Undone')}` : ''}</span>@@ -131,15 +131,15 @@ export function MotionHistoryPanel({ onRestored = reloadProject }: { onRestored?</button>)}</div>{selected && <div className="motion-history-detail">- <div className="motion-history-detail-title">{t("Changes in this version")}</div>+ {!compact && <><div className="motion-history-detail-title">{t("Changes in this version")}</div><ul>{selected.files.map(file => <li key={file.path}><code title={file.path}>{file.path}</code>- <span>{file.before === null ? t('Created') : file.after === null ? t("Deleted") : t("Modified")}</span></li>)}</ul>+ <span>{file.before === null ? t('Created') : file.after === null ? t("Deleted") : t("Modified")}</span></li>)}</ul></>}<div className="motion-history-detail-actions">- <button type="button" className="motion-button" disabled={disabled} onClick={() => void pin(selected)}>{selected.pinned ? t("Unpin version") : t("Keep this version")}</button>+ {allowPinning && <button type="button" className="motion-button" disabled={disabled} onClick={() => void pin(selected)}>{selected.pinned ? t("Unpin version") : t("Keep this version")}</button>}<button type="button" className="motion-button motion-button-primary" disabled={disabled || selected.id === entries.at(-1)?.id}onClick={() => void restore(selected)}>{t("Restore this version")}</button></div>- <p>{t("Restoring creates a new entry and keeps your current changes in history.")}</p>+ {!compact && <p>{t("Restoring creates a new entry and keeps your current changes in history.")}</p>}</div>}</section>;}diff --git a/studio/src/motion/MotionHistoryPopover.tsx b/studio/src/motion/MotionHistoryPopover.tsxnew file mode 100644index 00000000..188320a0--- /dev/null+++ b/studio/src/motion/MotionHistoryPopover.tsx@@ -0,0 +1,38 @@+import { Popover } from '@base-ui/react/popover';+import { useEffect, useRef, useState } from 'react';+import { useStudioShellContext } from '../contexts/StudioContext';+import { IconButton, Tooltip } from '../components/ui';+import { RemixIcon } from '../icons/RemixIcons';+import { useI18n } from '../i18n/I18n';+import { MotionHistoryPanel } from './MotionHistoryPanel';++export function MotionHistoryPopover() {+ const { t } = useI18n();+ const { projectId } = useStudioShellContext();+ const [open, setOpen] = useState(false);+ const triggerRef = useRef<HTMLButtonElement>(null);+ useEffect(() => setOpen(false), [projectId]);++ return <Popover.Root modal open={open} onOpenChange={setOpen}>+ <Tooltip label={t('Version history')}>+ <Popover.Trigger render={<IconButton ref={triggerRef} className="text-text-0" aria-label={t('Version history')}+ icon={<RemixIcon name="history-line" size={16} />} />} />+ </Tooltip>+ <Popover.Portal>+ <Popover.Backdrop className="fixed inset-0 z-140" />+ <Popover.Positioner side="bottom" align="end" sideOffset={8} collisionPadding={12}+ collisionAvoidance={{ side: 'none', align: 'shift' }} positionMethod="fixed" className="z-150">+ <Popover.Popup data-testid="history-popover" finalFocus={triggerRef} aria-describedby={undefined}+ className="hf-floating-motion flex h-[min(520px,var(--available-height))] w-[min(320px,calc(100vw-24px))] flex-col overflow-hidden rounded-xl border border-border bg-surface text-text-1 shadow-menu outline-none">+ <div className="flex shrink-0 items-center justify-between px-3 py-2">+ <Popover.Title className="text-step-14 font-semibold">{t('Version history')}</Popover.Title>+ <Popover.Close render={<IconButton aria-label={t('Close')} icon={<RemixIcon name="close-line" size={16} />} />} />+ </div>+ <div className="min-h-0 flex-1 overflow-y-auto">+ <MotionHistoryPanel compact allowPinning={false} />+ </div>+ </Popover.Popup>+ </Popover.Positioner>+ </Popover.Portal>+ </Popover.Root>;+}diff --git a/studio/src/motion/MotionLoading.tsx b/studio/src/motion/MotionLoading.tsxnew file mode 100644index 00000000..18a449ac--- /dev/null+++ b/studio/src/motion/MotionLoading.tsx@@ -0,0 +1,12 @@+import { useI18n } from '../i18n/I18n';++/** Matches the initial HTML shell without delaying a ready workspace. */+export function MotionLoading() {+ const { t } = useI18n();+ return (+ <div className="motion-loading" role="status">+ <span className="motion-loading-mark" aria-hidden="true" />+ <span className="motion-loading-label">{t('Opening project…')}</span>+ </div>+ );+}diff --git a/studio/src/motion/MotionStudioHost.test.tsx b/studio/src/motion/MotionStudioHost.test.tsxindex d15ee708..0e558655 100644--- a/studio/src/motion/MotionStudioHost.test.tsx+++ b/studio/src/motion/MotionStudioHost.test.tsx@@ -8,12 +8,13 @@ import { useMotionHistoryOperation } from './MotionHistoryState';const state = vi.hoisted(() => ({renderQueue: { isRendering: false, ffmpegMissing: false },+ writeBlockedReason: null as string | null,open: vi.fn(), export: vi.fn(), setTab: vi.fn(), setCollapsed: vi.fn(),undo: vi.fn(), redo: vi.fn(), create: vi.fn(), home: vi.fn(), rename: vi.fn(),showToast: vi.fn(), status: { projectId: 'demo', historyRestoreError: null as { requestId: string; message: string } | null },}));vi.mock('../contexts/StudioContext', () => ({ useStudioShellContext: () => ({- projectId: 'demo', renderQueue: state.renderQueue, waitForPendingDomEditSaves: async () => {},+ projectId: 'demo', renderQueue: state.renderQueue, writeBlockedReason: state.writeBlockedReason, waitForPendingDomEditSaves: async () => {},showToast: state.showToast,}), useStudioShellContextOptional: () => ({editHistory: { canUndo: true, canRedo: true }, handleUndo: state.undo, handleRedo: state.redo,@@ -21,8 +22,10 @@ vi.mock('../contexts/StudioContext', () => ({ useStudioShellContext: () => ({vi.mock('../contexts/PanelLayoutContext', () => ({ usePanelLayoutContext: () => ({rightCollapsed: false, setRightCollapsed: state.setCollapsed, setRightPanelTab: state.setTab,}) }));+vi.mock('../components/renders/RenderQueuePanel', () => ({ RenderQueuePanel: () => <div>Export settings and jobs</div> }));vi.mock('../components/dock/Dock', () => ({ Dock: { WindowMenu: () => <button>Window</button>, Panel: () => null } }));vi.mock('../utils/studioTelemetry', () => ({ trackStudioEvent: vi.fn() }));+vi.mock('./MotionHistoryPanel', () => ({ MotionHistoryPanel: () => <div>History versions</div> }));vi.mock('./useWorkspace', () => ({ useWorkspace: () => ({status: state.status, projects: [{ id: 'demo', title: 'Demo' }, { id: 'second', title: 'Second' }],busy: false, error: '', clearError: vi.fn(), open: state.open, openSession: state.open, startSession: state.create, create: state.create, home: state.home, rename: state.rename,@@ -39,6 +42,7 @@ beforeEach(() => {vi.clearAllMocks();localStorage.clear();state.renderQueue.isRendering = false;+ state.writeBlockedReason = null;state.status = { projectId: 'demo', historyRestoreError: null };container = document.createElement('div');document.body.append(container);@@ -97,10 +101,15 @@ it('keeps project switching, templates, history actions and native export in theact(() => container.querySelector<HTMLButtonElement>('[aria-label="重做"]')!.click());expect(state.undo).toHaveBeenCalledOnce();expect(state.redo).toHaveBeenCalledOnce();+ act(() => container.querySelector<HTMLButtonElement>('[aria-label="版本历史"]')!.click());+ expect(document.querySelector('[data-testid="history-popover"]')?.textContent).toContain('History versions');+ act(() => document.querySelector<HTMLButtonElement>('[data-testid="history-popover"] [aria-label="关闭"]')!.click());act(() => button('导出').click());- expect(state.setTab).toHaveBeenCalledWith('renders');- expect(state.setCollapsed).toHaveBeenCalledWith(false);- expect(state.export).toHaveBeenCalledOnce();+ expect(state.setTab).not.toHaveBeenCalled();+ expect(state.setCollapsed).not.toHaveBeenCalled();+ expect(state.export).not.toHaveBeenCalled();+ expect(document.querySelector('[data-testid="export-dialog"]')?.textContent).toContain('Export settings and jobs');+ act(() => document.querySelector<HTMLButtonElement>('[data-testid="export-dialog"] [aria-label="关闭"]')!.click());act(() => project.click());expect(state.open).toHaveBeenCalledWith('projects', 'second');act(() => button('模板库').click());@@ -117,7 +126,10 @@ it('prevents project replacement during a native render', () => {expect(document.querySelector<HTMLButtonElement>('.motion-session')!.disabled).toBe(true);expect(document.querySelector<HTMLButtonElement>('[aria-label="新建项目"]')!.disabled).toBe(true);expect(button('模板库').disabled).toBe(true);- expect(container.querySelector<HTMLButtonElement>('[data-testid="header-export"]')!.disabled).toBe(true);+ expect(container.querySelector<HTMLButtonElement>('[data-testid="header-export"]')!.disabled).toBe(false);+ act(() => container.querySelector<HTMLButtonElement>('[data-testid="header-export"]')!.click());+ expect(document.querySelector('[data-testid="export-dialog"]')?.textContent).toContain('Export settings and jobs');+ expect(state.export).not.toHaveBeenCalled();expect(container.textContent).toContain('正在渲染…');});@@ -198,3 +210,14 @@ it('saves a project name on blur and keeps empty or cancelled edits from replaciexpect(document.activeElement).not.toBe(input);expect(container.querySelector('[aria-label="项目名称"]')).toBe(input);});++it('dismissing a write-blocking notice does not enable project creation', () => {+ state.writeBlockedReason = 'Auto-save is paused. Check your connection.';+ render();+ const close = container.querySelector<HTMLButtonElement>('.motion-error-notice-close')!;+ expect(close).not.toBeNull();+ act(() => close.click());+ expect(container.querySelector('.motion-error-notice')).toBeNull();+ openSidebar();+ expect(document.querySelector<HTMLButtonElement>('.motion-session-heading button')?.disabled).toBe(true);+});diff --git a/studio/src/motion/MotionStudioHost.tsx b/studio/src/motion/MotionStudioHost.tsxindex 0670cf05..f1895725 100644--- a/studio/src/motion/MotionStudioHost.tsx+++ b/studio/src/motion/MotionStudioHost.tsx@@ -3,13 +3,12 @@ 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 { MotionHistoryPopover } from './MotionHistoryPopover';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';@@ -118,8 +117,11 @@ function WorkspaceProject() {function WorkspaceHistoryActions() {const operation = useMotionHistoryOperation();- return <div className="motion-history-actions">- <TimelineHistoryButtons canUndo={operation.busy ? false : undefined} canRedo={operation.busy ? false : undefined} />+ return <div className="motion-history-actions motion-header-history-actions">+ <div className="motion-history-actions">+ <TimelineHistoryButtons canUndo={operation.busy ? false : undefined} canRedo={operation.busy ? false : undefined} />+ </div>+ <MotionHistoryPopover /></div>;}@@ -127,7 +129,7 @@ function WorkspaceActions() {const { t } = useI18n();const { switchingDisabled, openLibrary } = useWorkspaceChrome();return <div className="motion-workspace-actions">- <button className="motion-button motion-button-quiet" aria-haspopup="dialog" disabled={switchingDisabled} onClick={openLibrary}><MotionIcon name="grid" />{t("Template library")}</button>+ <button className="motion-button motion-button-quiet" aria-label={t("Template library")} title={t("Template library")} aria-haspopup="dialog" disabled={switchingDisabled} onClick={event => openLibrary(event.currentTarget)}><MotionIcon name="grid" /><span className="motion-template-label">{t("Template library")}</span></button></div>;}@@ -137,7 +139,6 @@ const host: StudioHost = {projectLabel: <WorkspaceProject />,headerActions: <WorkspaceActions />,historyActions: <WorkspaceHistoryActions />,- panels: <Dock.Panel id="history"><MotionHistoryPanel /></Dock.Panel>,previewAction: <></>,windowMenu: <></>,themeToggle: false,diff --git a/studio/src/motion/TemplateLibraryDialog.tsx b/studio/src/motion/TemplateLibraryDialog.tsxindex 68bf6134..ce836295 100644--- a/studio/src/motion/TemplateLibraryDialog.tsx+++ b/studio/src/motion/TemplateLibraryDialog.tsx@@ -13,7 +13,7 @@ import kimiLogo from './template-brands/kimi.png';import pondLogo from './template-brands/pond.svg';const brandLogos: Record<string, string> = {Figma: figmaLogo, Lovable: lovableLogo, Linear: linearLogo, Firecrawl: firecrawlLogo, Kimi: kimiLogo, Pond: pondLogo};-type Props = { open: boolean; busy: boolean; error: string; onClose: () => void; onOpen: (id: string) => void };+type Props = { returnFocus?: HTMLElement | null; open: boolean; busy: boolean; error: string; onClose: () => void; onOpen: (id: string) => void };type Facet = 'brand' | 'uses' | 'styles' | 'industries' | 'creationModels' | 'colors' | 'ratio' | 'duration';const facets: [Facet, string][] = [['brand', 'Reference brands'], ['uses', 'Use cases'], ['styles', 'Video types'],@@ -82,9 +82,14 @@ export function TemplateLibraryDialog(props: Props) {const info = useRef<IntegrationInfo | null>(null);useEffect(() => {if (!props.open) return;- dialog.current?.showModal();- return () => { useDialog.current?.close(); detail.current?.close(); filter.current?.close(); dialog.current?.close(); setPreview(null); };- }, [props.open]);+ const openedDialog = dialog.current;+ const trigger = props.returnFocus ?? (document.activeElement instanceof HTMLElement ? document.activeElement : null);+ openedDialog?.showModal();+ return () => {+ useDialog.current?.close(); detail.current?.close(); filter.current?.close(); openedDialog?.close(); setPreview(null);+ if (trigger?.isConnected) trigger.focus({ preventScroll: true });+ };+ }, [props.open, props.returnFocus]);useEffect(() => {if (!props.open) return;setCatalog([]); setSelected({}); setQuery(''); setPreview(null); detail.current?.close(); useDialog.current?.close();diff --git a/studio/src/motion/WorkspaceFrame.tsx b/studio/src/motion/WorkspaceFrame.tsxindex 2192d264..cca60426 100644--- a/studio/src/motion/WorkspaceFrame.tsx+++ b/studio/src/motion/WorkspaceFrame.tsx@@ -7,6 +7,8 @@ import { useWorkspace } from './useWorkspace';import { ThemeToggle } from '../components/ThemeToggle';import { Tooltip } from '../components/ui/Tooltip';import { Dialog } from '@base-ui/react/dialog';+import { ErrorNotice } from '../components/ui/ErrorNotice';+import { isConnectionFailure } from '../components/ui/errorNoticeMessage';import { useShownStudioTheme } from '../utils/studioTheme';import { workspacePresentation } from '../../../shared/workspace-url';@@ -16,7 +18,7 @@ type WorkspaceChrome = {workspace: ReturnType<typeof useWorkspace>;switchingDisabled: boolean;saveState: string;- openLibrary: () => void;+ openLibrary: (trigger?: HTMLElement) => void;openConnections: () => void;openModelSettings: () => void;toggleSidebar: () => void;@@ -50,12 +52,18 @@ export function WorkspaceFrame({ children, waitForSaves, projectId, sessionId, b}, [waitForSaves, t]);const workspace = useWorkspace(beforeViewChange, projectId, sessionId);const [connectionSection, setConnectionSection] = useState<'setup' | 'templates'>(() => 'templates');+ const libraryTrigger = useRef<HTMLElement | null>(null);const [connectionsOpen, setConnectionsOpen] = useState(() => new URLSearchParams(location.search).get('templates') === '1');const [sidebarOpen, setSidebarOpen] = useState(false);const switchingDisabled = workspace.busy || blocked || Boolean(editorState?.blocked) || !workspace.status;- const notice = workspace.error || message || editorState?.message;+ const notice = workspace.error || message || editorState?.message || "";+ const [dismissedNotice, setDismissedNotice] = useState<string | null>(null);+ const noticeKey = `${workspace.error ? workspace.errorSource : 'editor'}:${notice || ''}`;+ // Hiding a notice never clears an editor's write guard. New errors reset the dismissal.+ const visibleNotice = notice && dismissedNotice !== noticeKey;+ if (!notice && dismissedNotice !== null) setDismissedNotice(null);const value: WorkspaceChrome = { workspace, switchingDisabled, saveState: workspace.busy ? t('Working…') : editorState?.saveState || saveState, registerEditor, beforeViewChange,- openLibrary: () => { workspace.clearError(); setConnectionSection('templates'); setConnectionsOpen(true); },+ openLibrary: trigger => { libraryTrigger.current = trigger ?? null; workspace.clearError(); setConnectionSection('templates'); setConnectionsOpen(true); },openConnections: () => {},openModelSettings: () => {},toggleSidebar: () => setSidebarOpen(open => !open), sidebarOpen };@@ -63,18 +71,21 @@ export function WorkspaceFrame({ children, waitForSaves, projectId, sessionId, b<Dialog.Root open={sidebarOpen} onOpenChange={setSidebarOpen}><div className="motion-workspace" data-embedded={presentation.embedded}><Dialog.Portal>- <Dialog.Backdrop className="motion-sidebar-backdrop" />+ <Dialog.Backdrop className="hf-overlay-backdrop motion-sidebar-backdrop" /><Dialog.Popup className="motion-sidebar-drawer" aria-label={t('Project list')} onKeyDown={event => event.stopPropagation()}><WorkspaceSidebar currentId={projectId} close={() => setSidebarOpen(false)} /></Dialog.Popup></Dialog.Portal><div className="motion-workspace-content">- {notice && <div className="motion-workspace-notice" role="alert"><span>{t(notice)}</span>{workspace.error && <button className="motion-icon-button" aria-label={t('Dismiss')} onClick={workspace.clearError}><MotionIcon name="close" /></button>}</div>}+ {visibleNotice && <ErrorNotice key={noticeKey} message={notice}+ action={workspace.error && workspace.errorSource === 'connection' && isConnectionFailure(notice)+ ? { label: 'Reconnect', run: workspace.retryConnection, busy: workspace.checkingConnection } : undefined}+ onDismiss={() => { setDismissedNotice(noticeKey); if (workspace.error) workspace.clearError(); }} />}{children}</div></div></Dialog.Root>- {connectionsOpen && <ConnectionDialog open section={connectionSection} busy={switchingDisabled} error={workspace.error} onClose={() => setConnectionsOpen(false)} onOpen={id => { if (!switchingDisabled) void (sessionId ? workspace.createArtifact(sessionId, id) : workspace.startSession(undefined, id)); }} />}+ {connectionsOpen && <ConnectionDialog open returnFocus={libraryTrigger.current} section={connectionSection} busy={switchingDisabled} error={workspace.error} onClose={() => setConnectionsOpen(false)} onOpen={id => { if (!switchingDisabled) void (sessionId ? workspace.createArtifact(sessionId, id) : workspace.startSession(undefined, id)); }} />}</WorkspaceChromeContext.Provider>;}@@ -112,7 +123,7 @@ function WorkspaceSidebar({ currentId, close }: { currentId?: string; close: (){workspace.status && !filtered.length && <p className="motion-session-empty">{t(query ? 'No matching projects' : 'Create a project with your Agent to start editing.')}</p>}{filtered.map(project => <button key={project.id} className="motion-session" aria-current={currentId === project.id ? 'page' : undefined}title={project.title} disabled={switchingDisabled} onClick={() => { if (project.id === currentId) close(); else void workspace.open('projects', project.id); }}>- <MotionIcon name="message" /><span><strong>{project.title}</strong></span>+ <span className="motion-session-dot" aria-hidden="true" /><span><strong>{project.title}</strong></span></button>)}</nav><footer className="motion-sidebar-footer">diff --git a/studio/src/motion/loading.css b/studio/src/motion/loading.cssnew file mode 100644index 00000000..a06940b5--- /dev/null+++ b/studio/src/motion/loading.css@@ -0,0 +1,29 @@+/* Shared by the pre-JavaScript shell and React loading boundaries. */+html, body, #root { margin: 0; width: 100%; height: 100%; }+.motion-loading {+ display: grid;+ place-items: center;+ flex: 1;+ width: 100%;+ height: 100%;+ min-height: 0;+ background: var(--motion-bg);+ color: var(--motion-text);+}+.motion-loading-mark {+ display: block;+ width: 64px;+ height: 64px;+ background: currentColor;+ -webkit-mask: url('./od-loading-mark.svg') center / contain no-repeat;+ mask: url('./od-loading-mark.svg') center / contain no-repeat;+}+.motion-loading-label {+ position: absolute;+ width: 1px;+ height: 1px;+ padding: 0;+ overflow: hidden;+ clip-path: inset(50%);+ white-space: nowrap;+}diff --git a/studio/src/motion/od-loading-mark.svg b/studio/src/motion/od-loading-mark.svgnew file mode 100644index 00000000..1701e1d2--- /dev/null+++ b/studio/src/motion/od-loading-mark.svg@@ -0,0 +1,5 @@+<!-- OpenDesign symbol extracted unchanged from web/design-system/opendesign-dark.svg. -->+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 291 291">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M145.5 0C225.857 0 291 65.1426 291 145.5C291 225.857 225.857 291 145.5 291H19.3581C8.64385 291 0.000681982 282.358 0.000616442 271.644C0.000417939 239.193 1.50624e-09 174.523 0 145.5C0 65.1426 65.1426 5.2069e-06 145.5 0ZM145.501 29.1004C81.2147 29.1004 29.1004 81.2147 29.1004 145.501C29.1005 209.786 81.2147 261.9 145.501 261.9C209.786 261.9 261.9 209.786 261.9 145.501C261.9 81.2147 209.786 29.1004 145.501 29.1004Z" fill="#202020"/>+ <path d="M137.934 215.04L94.3119 100.247C92.9002 96.5317 96.5286 92.8895 100.219 94.3172L215.067 138.749C219.793 140.578 218.491 147.633 213.427 147.633H146.769V213.4C146.769 218.499 139.744 219.804 137.934 215.04Z" fill="#202020"/>+</svg>diff --git a/studio/src/motion/theme.css b/studio/src/motion/theme.cssindex d8edddc6..03d909bc 100644--- a/studio/src/motion/theme.css+++ b/studio/src/motion/theme.css@@ -1,4 +1,6 @@/* OpenDesign Motion adapter. The shared token JSON owns all UI colors. */+:root[data-motion-ui] :is(input, textarea)::placeholder { color: var(--motion-placeholder); opacity: 1; }+:root[data-motion-ui] .motion-audio-row { padding-inline: 6px; gap: 6px; }:root[data-motion-ui] .studio-tooltip {background: var(--motion-strong);color: var(--motion-panel);@@ -97,9 +99,10 @@ button, input, select, textarea { font-family: inherit; }/* A single panel title has no sibling tab to switch to. */:root[data-motion-ui] .hf-dock .dv-groupview .dv-tabs-container:not(:has(> .dv-tab ~ .dv-tab)) > .dv-tab.dv-active-tab { box-shadow: none; cursor: default; }:root[data-motion-ui] :is(.motion-timeline-toolbar, .motion-player-controls) button:enabled { color: var(--motion-text); }+:root[data-motion-ui] :is(.motion-timeline-toolbar, .motion-header-history-actions) button:disabled { color: color-mix(in srgb, var(--motion-strong) 30%, var(--motion-panel)); opacity: 1; cursor: not-allowed; }:root[data-motion-ui] :is(.motion-timeline-toolbar, .motion-player-controls) button:enabled:hover { color: var(--motion-strong); }-:root[data-motion-ui] :is(.motion-timeline-toolbar, .motion-player-controls) button[aria-pressed="true"]:enabled { color: var(--motion-strong); background: var(--motion-inset); }-:root[data-motion-ui] :is(.motion-timeline-toolbar, .motion-player-controls) button[aria-pressed="true"]:enabled:hover { background: var(--motion-border); }+:root[data-motion-ui] :is(.motion-timeline-toolbar, .motion-player-controls) button[aria-pressed="true"]:not([data-studio-control="mute"]):enabled { color: var(--motion-strong); background: var(--motion-inset); }+:root[data-motion-ui] :is(.motion-timeline-toolbar, .motion-player-controls) button[aria-pressed="true"]:not([data-studio-control="mute"]):enabled:hover { background: var(--motion-border); }.hf-dock .dv-tab { border-radius: 0; height: 34px; padding: 0 8px; }.hf-dock .dv-scrollable { height: 34px; }.hf-dock-tab-fill { height: 34px; border-radius: 0; background: transparent; }@@ -155,6 +158,7 @@ button, input, select, textarea { font-family: inherit; }.motion-preview-well { margin: 0; border: 0; background: var(--motion-bg); }.motion-preview-frame { box-shadow: none; }+:root[data-motion-ui] .motion-asset-thumbnail { background: var(--motion-inset); }.motion-asset-name-input { box-sizing: border-box; width: 100%; min-width: 0; padding: 2px 4px; border: 1px solid var(--motion-border-strong); border-radius: var(--motion-radius-sm); background: var(--motion-inset); color: var(--motion-strong); font-size: 10px; line-height: 14px; outline: none; }.motion-asset-name-input[aria-invalid="true"] { border-color: var(--motion-danger); }@@ -232,20 +236,22 @@ button, input, select, textarea { font-family: inherit; }.motion-menu-hint { max-width: 224px; padding: 8px 9px 5px; color: var(--motion-dim); font-size: 10px; line-height: 1.6; }.motion-history-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--motion-text); font-size: 12px; }.motion-history-toolbar { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--motion-border); }+.motion-history-toolbar-compact { padding: 4px 12px 12px; }.motion-history-toolbar strong { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; }.motion-history-toolbar > div > span { display: block; color: var(--motion-dim); font-size: 11px; line-height: 1.6; }.motion-history-toolbar .motion-button { font-size: 11px; height: 28px; }.motion-history-filters { display: flex; flex-shrink: 0; gap: 4px; padding: 10px 12px; }.motion-history-filters button { padding: 5px 9px; border: 0; border-radius: var(--motion-radius-sm); background: transparent; color: var(--motion-muted); font-size: 11px; cursor: pointer; }-.motion-history-filters button[aria-pressed="true"] { color: var(--motion-accent); background: var(--motion-accent-soft); }+.motion-history-filters button[aria-pressed="true"] { color: var(--motion-strong); background: var(--motion-inset); font-weight: 600; }.motion-history-filters span { margin-left: 4px; font: 10px var(--motion-font-mono); }.motion-history-list { flex: 1; min-height: 70px; overflow: auto; padding: 0 8px 8px; }.motion-history-entry { display: block; width: 100%; margin-bottom: 4px; padding: 10px; border: 1px solid transparent; border-radius: var(--motion-radius-sm); background: transparent; color: inherit; text-align: left; cursor: pointer; }.motion-history-entry:hover { background: var(--motion-hover); }-.motion-history-entry[aria-pressed="true"] { background: var(--motion-accent-soft); border-color: var(--motion-border); }+.motion-history-entry[aria-pressed="true"] { background: var(--motion-inset); border-color: var(--motion-border); }.motion-history-entry-heading { display: flex; align-items: center; gap: 6px; }.motion-history-entry-heading strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }.motion-history-badge { flex-shrink: 0; border: 1px solid var(--motion-border); border-radius: 3px; padding: 1px 4px; color: var(--motion-muted); font-size: 9px; }+.motion-history-badge-latest { border-color: transparent; background: var(--motion-accent-soft); color: var(--motion-accent); }.motion-history-entry-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; color: var(--motion-dim); font-size: 10px; line-height: 1.6; }.motion-history-empty { padding: 24px 12px; color: var(--motion-dim); text-align: center; line-height: 1.8; }.motion-history-detail { flex-shrink: 0; padding: 14px 16px; border-top: 1px solid var(--motion-border); background: var(--motion-panel); }@@ -274,8 +280,19 @@ button, input, select, textarea { font-family: inherit; }.motion-language-button { flex-shrink: 1; min-width: 0; white-space: nowrap; }.motion-language-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: center; }-.motion-language-menu { width: 340px; max-width: calc(100vw - 24px); }-.motion-language-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }+.motion-language-menu { width: 220px; max-width: calc(100vw - 24px); }+:root[data-motion-ui] .hf-od-floating-surface.motion-language-menu {+ max-height: min(280px, calc(100dvh - 24px), var(--available-height, 280px));+ overflow-y: auto;+ overscroll-behavior: contain;+ background: var(--motion-raised);+ -webkit-backdrop-filter: none;+ backdrop-filter: none;+ border: 0;+ outline: none;+ box-shadow: var(--motion-shadow-md);+}+.motion-language-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }/* OD control recipes, scoped to visual hooks; existing sizes and state handling stay native. */:root[data-motion-ui] .hf-od-primary {@@ -302,7 +319,8 @@ button, input, select, textarea { font-family: inherit; }/* Equal side columns center the title; narrow hosts preserve the controls before the title. */.motion-studio-header.motion-studio-header-centered { padding-block: 11.5px; display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, 1fr) minmax(max-content, 1fr); gap: 12px; }.motion-studio-header.motion-studio-header-centered > div { min-width: 0; width: auto; }-.motion-studio-header.motion-studio-header-centered > div:last-child { justify-self: end; flex-wrap: nowrap; }+.motion-studio-header.motion-studio-header-centered > div:last-child { justify-self: end; flex-wrap: nowrap; gap: 16px; }+.motion-studio-header-centered .motion-header-history-actions { gap: 16px; }.motion-studio-header-centered .motion-workspace-actions { padding-right: 0; margin-right: 0; border-right: 0; }.motion-header-brand { display: inline-flex; align-items: center; gap: 10px; }.motion-header-brand img { display: block; width: 104px; height: auto; }@@ -334,7 +352,64 @@ button, input, select, textarea { font-family: inherit; }}.motion-header-project .motion-save-state { position: absolute; top: 100%; white-space: nowrap; }.motion-header-project .motion-project-control { position: relative; }-@media (max-width: 700px) {- .motion-studio-header.motion-studio-header-centered { grid-template-columns: auto minmax(0, 1fr); }- .motion-studio-header.motion-studio-header-centered > div:last-child { grid-column: 1 / -1; }+/* Measure the editor host, including when it sits beside an open sidebar. */+@container (max-width: 700px) {+ .motion-studio-header.motion-studio-header-centered {+ grid-template-columns: auto minmax(24px, 1fr) auto;+ gap: 8px;+ }+ .motion-studio-header-centered .motion-header-history-actions,+ .motion-studio-header-centered .motion-template-label { display: none; }+ .motion-studio-header.motion-studio-header-centered > div:first-child { gap: 6px; }+ .motion-studio-header-centered .motion-workspace-actions .motion-button {+ width: 28px;+ padding: 0;+ }+ .motion-header-project .motion-project-name-input { padding-inline: 0; text-align: left; }+}++/* Timeline menus use the shared floating surface and the same menu typography. */+:root[data-motion-ui] .hf-od-floating-surface.motion-clip-context-menu {+ font-family: var(--motion-font-sans);+ background: var(--motion-raised);+ -webkit-backdrop-filter: none;+ backdrop-filter: none;+ border: 0;+ box-shadow: var(--motion-shadow-sm);+}+:root[data-motion-ui] .motion-clip-context-menu [role="menuitem"] {+ min-height: 28px;+ padding: 6px 8px;+ border-radius: var(--motion-radius-sm);+ font-family: inherit;+ font-size: 11px;+ font-weight: 400;+ line-height: 16px;}+:root[data-motion-ui] .motion-clip-context-menu [role="group"] { border-color: var(--motion-border); }++/* Empty projects keep the preview mounted, but offer an actionable blank state. */+.motion-preview-empty { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; overflow: auto; background: var(--motion-bg); color: var(--motion-text); padding: 20px; }+.motion-preview-empty-content { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 360px; min-width: 0; margin: auto; text-align: center; }+.motion-preview-empty-content p { margin: 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }+.motion-preview-empty-content button { min-height: 36px; }++.motion-conflict-notice { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); z-index: 94; width: min(420px, calc(100% - 32px)); max-height: calc(100% - 80px); overflow: auto; padding: 12px 16px; border-radius: 12px; background: var(--motion-panel); color: var(--motion-text); box-shadow: var(--motion-shadow-md); font-size: 12px; line-height: 1.6; }+.motion-conflict-notice p { margin: 0; overflow-wrap: anywhere; }+.motion-conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }+.motion-conflict-actions button { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }++/* Empty titles and lanes reuse the populated timeline's column and row geometry. */+.motion-empty-timeline { position: absolute; left: 0; right: 12px; color: var(--motion-muted); font-size: 11px; line-height: 1.25; pointer-events: none; }+.motion-empty-timeline-label { position: absolute; inset-block: 0; left: 0; display: flex; align-items: center; padding: 0 6px; color: color-mix(in srgb, var(--motion-muted) 50%, var(--motion-panel)); }+.motion-empty-timeline-lane { position: absolute; right: 0; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--motion-border); border-radius: 4px; }+.motion-empty-timeline.is-drag-over .motion-empty-timeline-lane { border-color: var(--motion-accent); color: var(--motion-accent); }++.motion-panel-empty-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }+.motion-assets-empty-drop { width: min(240px, 100%); min-height: 132px; padding: 24px 16px; border: 1px dashed var(--motion-border); border-radius: 8px; }++/* Passive empty hints share the disabled-control tone in both themes. */+.motion-panel-empty-content { color: color-mix(in srgb, var(--motion-strong) 30%, var(--motion-panel)); font-size: 10px; line-height: 1.5; }+.motion-panel-empty-content :is(svg, p) { color: inherit; font-size: inherit; }+:root[data-motion-ui] .motion-timeline-zoom input:disabled { opacity: .3; cursor: not-allowed; }+:root[data-motion-ui] .motion-timeline-zoom input:disabled::-webkit-slider-thumb { cursor: not-allowed; }diff --git a/studio/src/motion/useWorkspace.test.tsx b/studio/src/motion/useWorkspace.test.tsxindex f3f254b7..40bfbd69 100644--- a/studio/src/motion/useWorkspace.test.tsx+++ b/studio/src/motion/useWorkspace.test.tsx@@ -29,6 +29,29 @@ async function mount(wait: () => Promise<void>, projectId?: string, sessionId?:}const writes = () => fetcher.mock.calls.filter(call => call[1]?.method === 'POST');+it('reconnects with read requests only and clears a recovered polling failure', async () => {+ const original = fetcher.getMockImplementation()!;+ fetcher.mockRejectedValue(new TypeError('Failed to fetch'));+ await mount(async () => {}, first);+ expect(workspace.errorSource).toBe('connection');+ expect(workspace.error).toBe('Failed to fetch');+ fetcher.mockImplementation(original);+ await act(async () => workspace.retryConnection());+ expect(workspace.error).toBe('');+ expect(workspace.checkingConnection).toBe(false);+ expect(writes()).toHaveLength(0);+ expect(navigate).not.toHaveBeenCalled();+});++it('does not erase a failed operation when a later connection check succeeds', async () => {+ await mount(async () => { throw new Error('Unsaved edit'); }, first);+ await act(() => workspace.create());+ await act(async () => workspace.retryConnection());+ expect(workspace.error).toBe('Unsaved edit');+ expect(workspace.errorSource).toBe('operation');+ expect(writes()).toHaveLength(0);+});+it('waits for saves, deduplicates rapid actions and opens the new project in a new document', async () => {let saved!: () => void;const pending = new Promise<void>(resolve => { saved = resolve; });diff --git a/studio/src/motion/useWorkspace.ts b/studio/src/motion/useWorkspace.tsindex df242407..b75de709 100644--- a/studio/src/motion/useWorkspace.ts+++ b/studio/src/motion/useWorkspace.ts@@ -29,6 +29,10 @@ export function useWorkspace(waitForSaves: () => Promise<void>, projectId?: striconst [status, setStatus] = useState<WorkspaceStatus | null>(null);const [busy, setBusy] = useState(false);const [error, setError] = useState('');+ const [connectionError, setConnectionError] = useState('');+ const [connectionCheck, setConnectionCheck] = useState(0);+ const [checkingConnection, setCheckingConnection] = useState(false);+ const retryConnection = useCallback(() => { setCheckingConnection(true); setConnectionCheck(value => value + 1); }, []);const acting = useRef(false);const pendingSession = useRef<{ key: string; id: string } | null>(null);const request = useCallback(<T,>(path: string, init?: RequestInit) => motionApi<T>(path, init, projectId), [projectId]);@@ -54,13 +58,14 @@ export function useWorkspace(waitForSaves: () => Promise<void>, projectId?: striconst session = !projectId && sessionId ? catalog.sessions?.find(item => item.id === sessionId) : undefined;const generated = session?.artifacts.find(item => item.id === session.activeArtifactId) ?? session?.artifacts.at(-1);if (generated && !acting.current) { navigateWorkspace(sessionHref(sessionId!, generated.projectId, true), true); return; }- setStatus(data); updateCatalog(catalog);- } catch (err) { if (!controller.signal.aborted) setError((err as Error).message); }+ setStatus(data); updateCatalog(catalog); setConnectionError('');+ } catch (err) { if (!controller.signal.aborted) setConnectionError((err as Error).message); }+ finally { if (!controller.signal.aborted) setCheckingConnection(false); }if (!controller.signal.aborted) timer = setTimeout(poll, 1800);}void poll();return () => { controller.abort(); clearTimeout(timer); };- }, [projectId, sessionId, updateCatalog, request]);+ }, [projectId, sessionId, updateCatalog, request, connectionCheck]);const transition = useCallback(async (path?: string, options?: { instruction?: string; mode?: string; templateId?: string; projectId?: string }, sessionRoute = false, revealArtifact = true) => {if (acting.current) return false;@@ -119,5 +124,5 @@ export function useWorkspace(waitForSaves: () => Promise<void>, projectId?: stri}, [updateCatalog]);const rename = useCallback((id: string, title: string) => renameItem(id, title, 'projects'), [renameItem]);const renameSession = useCallback((id: string, title: string) => renameItem(id, title, 'sessions'), [renameItem]);- return { projects, sessions, session: sessions.find(item => item.id === sessionId), status, busy, error, open, create, home, rename, startSession, openSession, createArtifact, renameSession, clearError: () => setError('') };+ return { projects, sessions, session: sessions.find(item => item.id === sessionId), status, busy, error: error || connectionError, errorSource: error ? 'operation' as const : 'connection' as const, checkingConnection, retryConnection, open, create, home, rename, startSession, openSession, createArtifact, renameSession, clearError: () => { setError(''); setConnectionError(''); } };}diff --git a/studio/src/motion/workspace.css b/studio/src/motion/workspace.cssindex a4bda2f7..c9356ebe 100644--- a/studio/src/motion/workspace.css+++ b/studio/src/motion/workspace.css@@ -19,11 +19,12 @@.motion-session-search input, .motion-template-search input { background: transparent; border: 0; color: var(--motion-text); width: 100%; min-width: 0; font-size: 12px; outline-offset: 4px; }.motion-session-list { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; gap: 4px; }.motion-session { flex-shrink: 0; }+.motion-session-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: currentColor; }.motion-session > span { min-width: 0; }.motion-session strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }.motion-session small { display: block; margin-top: 5px; font-size: 10px; color: var(--motion-dim); }.motion-session-empty { font-size: 12px; line-height: 1.8; color: var(--motion-dim); padding: 12px 8px; }-.motion-sidebar-footer { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--motion-border); margin-top: 16px; padding: 14px 6px 0; }+.motion-sidebar-footer { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; padding: 14px 6px 0; }.motion-sidebar-identity { display: flex; align-items: center; gap: 10px; width: 100%; }.motion-sidebar-identity > span { flex: 1; min-width: 0; }.motion-sidebar-settings { display: flex; align-items: center; gap: 8px; width: 100%; }diff --git a/studio/src/player/components/ClipBadges.tsx b/studio/src/player/components/ClipBadges.tsxindex 8ccefb54..337d1abe 100644--- a/studio/src/player/components/ClipBadges.tsx+++ b/studio/src/player/components/ClipBadges.tsx@@ -52,7 +52,7 @@ export const ClipBadges = memo(function ClipBadges({{volume && (<spanclassName={`${BADGE_CLASS} min-w-0 overflow-hidden border-white/20 text-white/90`}- title={volume}+ title={volume === "Muted" ? t("Muted") : volume}data-badge="volume"><SpeakerGlyph muted={volume === "Muted"} />diff --git a/studio/src/player/components/ClipContextMenu.tsx b/studio/src/player/components/ClipContextMenu.tsxindex d23264a4..2eedc87d 100644--- a/studio/src/player/components/ClipContextMenu.tsx+++ b/studio/src/player/components/ClipContextMenu.tsx@@ -11,6 +11,7 @@ import { ClipMenuToolItems } from "./clipMenuToolItems";import { ClipMenuAudioItems } from "./clipMenuAudioItems";import { ClipMenuLinkItems } from "./clipMenuLinkItems";import { menuClasses } from "../../components/ui/menuStyle";+import { popupSurface } from "../../components/ui/Menu";import { useTimelineEditContextOptional } from "../../contexts/TimelineEditContext";import { keyHint, useStudioKeys } from "./studioShortcuts";@@ -139,7 +140,7 @@ export const ClipContextMenu = memo(function ClipContextMenu({ref={menuRef}role="menu"aria-label={t("Clip actions")}- className={`${menuClasses.panel} fixed z-200 min-w-[180px]`}+ className={`${mvp ? `${popupSurface} motion-clip-context-menu p-1 shadow-menu` : menuClasses.panel} fixed z-200 min-w-[180px]`}style={{ left: adjustedX, top: adjustedY }}>{hostItems.length > 0 && (diff --git a/studio/src/player/components/PlayerControls.test.tsx b/studio/src/player/components/PlayerControls.test.tsxindex ab68c79a..01537336 100644--- a/studio/src/player/components/PlayerControls.test.tsx+++ b/studio/src/player/components/PlayerControls.test.tsx@@ -5,6 +5,7 @@ import { createRoot, type Root } from "react-dom/client";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { liveTime, usePlayerStore } from "../store/playerStore";import { PlayerControls } from "./PlayerControls";+import { StudioHostContext } from "../../motion/StudioHost";Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });@@ -36,6 +37,14 @@ beforeEach(async () => {});describe("PlayerControls preview seeking", () => {+ it("omits fullscreen in the MVP while keeping playback controls", async () => {+ await act(async () => root.render(<StudioHostContext.Provider value={{ mvpEditor: true }}>+ <PlayerControls onTogglePlay={() => {}} onSeek={onSeek} onToggleFullscreen={vi.fn()} />+ </StudioHostContext.Provider>));+ expect(host.querySelector('[aria-label="Enter fullscreen"]')).toBeNull();+ expect(host.querySelector('[data-studio-control="playback"]')).not.toBeNull();+ expect(seekBar().disabled).toBe(false);+ });it("shows the current position and follows the playback clock", () => {const input = seekBar();expect(input.type).toBe("range");diff --git a/studio/src/player/components/PlayerControls.tsx b/studio/src/player/components/PlayerControls.tsxindex 6c82e77e..68e56d5e 100644--- a/studio/src/player/components/PlayerControls.tsx+++ b/studio/src/player/components/PlayerControls.tsx@@ -189,10 +189,10 @@ export const PlayerControls = memo(function PlayerControls({});return (- <div className="motion-player-controls relative z-20">+ <div className={`motion-player-controls relative z-20 ${mvp ? "motion-player-responsive" : ""}`}><PreviewSeekBar duration={duration} disabled={controlsDisabled} onSeek={onSeek} /><div- className="grid h-7 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center px-3"+ className={mvp ? "motion-player-control-row px-3" : "grid h-7 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center px-3"}aria-disabled={disabled || undefined}style={{paddingBottom: "env(safe-area-inset-bottom)",@@ -235,7 +235,7 @@ export const PlayerControls = memo(function PlayerControls({</button></Tooltip>- <div className="flex min-w-0 items-center justify-self-end">+ <div className={`flex min-w-0 items-center justify-self-end ${mvp ? "motion-player-secondary" : ""}`}><VolumeControlaudioMuted={audioMuted}audioVolume={audioVolume}@@ -243,6 +243,7 @@ export const PlayerControls = memo(function PlayerControls({setAudioMuted={setAudioMuted}setAudioVolume={setAudioVolume}/>+ <span className="motion-player-optional flex items-center gap-[inherit]"><SpeedMenuplaybackRate={playbackRate}setPlaybackRate={setPlaybackRate}@@ -253,7 +254,8 @@ export const PlayerControls = memo(function PlayerControls({disabled={disabled}setLoopEnabled={setLoopEnabled}/>- {onToggleFullscreen && (+ </span>+ {!mvp && onToggleFullscreen && (<FullscreenButton isFullscreen={isFullscreen} onToggleFullscreen={onToggleFullscreen} />)}{!mvp && <ShortcutsButton disabled={disabled} onSeek={onSeek} sections={shortcutSections} />}diff --git a/studio/src/player/components/SpeedMenu.tsx b/studio/src/player/components/SpeedMenu.tsxindex cb6222aa..5a64cb87 100644--- a/studio/src/player/components/SpeedMenu.tsx+++ b/studio/src/player/components/SpeedMenu.tsx@@ -1,3 +1,4 @@+import { useMvpEditor } from "../../motion/StudioHost";import { useI18n } from "../../i18n/I18n";import { useState, memo } from "react";import { trackStudioEvent } from "../../utils/studioTelemetry";@@ -18,6 +19,7 @@ export const SpeedMenu = memo(function SpeedMenu({disabled,}: SpeedMenuProps) {const { t } = useI18n();+ const mvp = useMvpEditor();const [open, setOpen] = useState(false);return (<Tooltip label={t("Playback speed")}>@@ -35,7 +37,7 @@ export const SpeedMenu = memo(function SpeedMenu({type="button"disabled={disabled}aria-label={t("Playback speed")}- className="h-7 w-8 rounded-md font-mono text-[10px] tabular-nums text-neutral-500 transition-colors hover:text-neutral-200 disabled:opacity-30"+ className={`h-7 rounded-md font-mono tabular-nums text-neutral-500 transition-colors hover:text-neutral-200 disabled:opacity-30 ${mvp ? "w-10 text-[12px]" : "w-8 text-[10px]"}`}>{playbackRate}x</button>diff --git a/studio/src/player/components/Timeline.audioEffects.test.tsx b/studio/src/player/components/Timeline.audioEffects.test.tsxindex cb826232..a68549d9 100644--- a/studio/src/player/components/Timeline.audioEffects.test.tsx+++ b/studio/src/player/components/Timeline.audioEffects.test.tsx@@ -4,6 +4,7 @@ import React, { act } from "react";import { createRoot } from "react-dom/client";import { afterEach, describe, expect, it } from "vitest";import { Timeline } from "./Timeline";+import { StudioHostContext } from "../../motion/StudioHost";import { installTimelineMountEnv } from "./timelineMountTestEnv";import { usePlayerStore, type TimelineElement } from "../store/playerStore";@@ -34,12 +35,12 @@ const grouped: TimelineElement[] = ["vo-1", "vo-2"].map((id, track) => ({audioGroupLabel: "Voiceover",}));-async function mount(elements: TimelineElement[], showAudioEffects?: boolean) {+async function mount(elements: TimelineElement[], showAudioEffects?: boolean, mvp = false) {usePlayerStore.setState({ duration: 10, currentTime: 0, timelineReady: true, elements });const host = document.createElement("div");document.body.append(host);const root = createRoot(host);- await act(async () => root.render(<Timeline showAudioEffects={showAudioEffects} />));+ await act(async () => root.render(<StudioHostContext.Provider value={mvp ? { mvpEditor: true } : null}><Timeline showAudioEffects={showAudioEffects} /></StudioHostContext.Provider>));const labels = Array.from(host.querySelectorAll("button")).map((b) => b.getAttribute("aria-label") ?? "",);@@ -78,3 +79,9 @@ describe("Timeline showAudioEffects", () => {expect(off).toContain("Select Voiceover");});});++it('omits audio effects in MVP tracks and groups even when explicitly enabled', async () => {+ const labels = await mount([voice, ...grouped], true, true);+ expect(effects(labels)).toEqual([]);+ expect(labels).not.toContain('Open Voiceover effects');+});diff --git a/studio/src/player/components/Timeline.tsx b/studio/src/player/components/Timeline.tsxindex 918dd63c..f5de1f41 100644--- a/studio/src/player/components/Timeline.tsx+++ b/studio/src/player/components/Timeline.tsx@@ -56,7 +56,7 @@ function TimelineView() {const TimelineComposed = memo(function TimelineComposed(props: TimelineProps = {}) {const mvp = useMvpEditor();return (- <TimelineProvider {...props} showKeyframes={mvp ? false : props.showKeyframes}>+ <TimelineProvider {...props} showAudioEffects={mvp ? false : props.showAudioEffects} showKeyframes={mvp ? false : props.showKeyframes}><TimelineView /><TimelineMediaBar /></TimelineProvider>diff --git a/studio/src/player/components/TimelineEmptyState.tsx b/studio/src/player/components/TimelineEmptyState.tsxindex 7ee5d23b..00ce74ca 100644--- a/studio/src/player/components/TimelineEmptyState.tsx+++ b/studio/src/player/components/TimelineEmptyState.tsx@@ -1,7 +1,7 @@import { useMvpEditor } from "../../motion/StudioHost";import { useI18n } from "../../i18n/I18n";import type { DragEventHandler } from "react";-import { GUTTER, RULER_H } from "./timelineLayout";+import { CLIP_Y, GUTTER, LABEL_COL_W, RULER_H, TRACK_H, TRACKS_TOP_PAD } from "./timelineLayout";import { useMediaGateway } from "../../motion/MediaGatewayContext";import { usePlayerStore } from "../store/playerStore";import { mediaPopoverAnchor } from "../../motion/mediaPopoverPosition";@@ -14,6 +14,8 @@ function EmptyGenerationRange() {interface TimelineEmptyStateProps {isDragOver: boolean;+ contentOrigin?: number;+ trackTopPadding?: number;onFileDrop?: boolean;onDragOver: DragEventHandler<HTMLDivElement>;onDragLeave: DragEventHandler<HTMLDivElement>;@@ -22,6 +24,8 @@ interface TimelineEmptyStateProps {export function TimelineEmptyState({isDragOver,+ contentOrigin,+ trackTopPadding = TRACKS_TOP_PAD,onFileDrop,onDragOver,onDragLeave,@@ -30,6 +34,7 @@ export function TimelineEmptyState({const { t } = useI18n();const mvp = useMvpEditor();const gateway = useMediaGateway();+ const emptyOrigin = mvp ? (contentOrigin ?? LABEL_COL_W + GUTTER) : GUTTER;const hideGuide = !!gateway?.generationOpen && !isDragOver;return (<div@@ -43,13 +48,13 @@ export function TimelineEmptyState({{/* Ruler */}<divclassName="shrink-0 border-b border-neutral-800/40 flex items-end relative"- style={{ height: RULER_H, paddingLeft: GUTTER }}+ style={{ height: RULER_H, paddingLeft: emptyOrigin }}>{[0, 10, 20, 30, 40, 50].map((s) => (<divkey={s}className="flex flex-col items-center"- style={{ position: "absolute", left: GUTTER + s * 14 }}+ style={{ position: "absolute", left: emptyOrigin + s * 14, transform: mvp ? "translateX(-50%)" : undefined }}><span className="text-[9px] text-neutral-600 font-mono tabular-nums leading-none mb-0.5">{`${Math.floor(s / 60)@@ -63,7 +68,14 @@ export function TimelineEmptyState({{/* Empty drop zone */}<div className="relative flex-1 flex items-center justify-center overflow-hidden">{onFileDrop && gateway?.generationOpen && <EmptyGenerationRange />}- <div+ {mvp ? <div+ className={`motion-empty-timeline ${isDragOver ? "is-drag-over" : ""}`}+ style={{ top: trackTopPadding, height: TRACK_H }}+ aria-hidden={!isDragOver}+ >+ <span className="motion-empty-timeline-label" style={{ width: LABEL_COL_W }}>A-roll</span>+ <div className="motion-empty-timeline-lane" style={{ left: emptyOrigin, top: CLIP_Y, bottom: CLIP_Y }}>{isDragOver && <span>{t("Drop media files to import")}</span>}</div>+ </div> : <divdata-motion-empty-mediastyle={hideGuide ? { visibility: 'hidden' } : undefined}aria-hidden={hideGuide || undefined}@@ -93,23 +105,7 @@ export function TimelineEmptyState({</>) : (<>- <svg- width="18"- height="18"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- strokeWidth="1.5"- strokeLinecap="round"- strokeLinejoin="round"- className="text-neutral-600 shrink-0"- >- <rect x="2" y="2" width="20" height="20" rx="2" />- <path d="M7 2v20" />- <path d="M17 2v20" />- <path d="M2 7h20" />- <path d="M2 17h20" />- </svg>+<div className="motion-empty-media-copy"><strong>{onFileDrop ? t("Drop video, audio or images here") : t("Describe your video to start creating")}</strong>{onFileDrop && <span>{t(mvp ? "Import files or describe your video to your Agent." : "Import files, generate media, or describe your video to your Agent.")}</span>}@@ -120,7 +116,7 @@ export function TimelineEmptyState({</div>}</>)}- </div>+ </div>}</div></div>);diff --git a/studio/src/player/components/TimelineOverlays.tsx b/studio/src/player/components/TimelineOverlays.tsxindex 69b8590f..8624c448 100644--- a/studio/src/player/components/TimelineOverlays.tsx+++ b/studio/src/player/components/TimelineOverlays.tsx@@ -1,3 +1,4 @@+import { useMvpEditor } from "../../motion/StudioHost";import { TimelineAudioGainOverlay } from "./AudioGainDialog";import { useEffect, useMemo } from "react";import type { TimelineElement } from "../store/playerStore";@@ -11,7 +12,6 @@ import { copyTextToClipboard } from "../../utils/clipboard";import { trackStudioSegmentEaseEdit } from "../../telemetry/events";import { useTimelineContext } from "./TimelineProvider";import { useMediaGateway } from '../../motion/MediaGatewayContext';-import { useMvpEditor } from '../../motion/StudioHost';interface TimelineContextTargetInput {capturedElement: TimelineElement;@@ -42,9 +42,9 @@ export function TimelineShortcutHintOverlay() {}export function TimelineEditPopoverOverlay() {+ const mvp = useMvpEditor();const { state } = useTimelineContext();const gateway = useMediaGateway();- const mvp = useMvpEditor();const { showPopover, rangeSelection, setShowPopover, setRangeSelection } = state.overlays;if (mvp || gateway || !showPopover || !rangeSelection) return null;return (diff --git a/studio/src/player/components/TimelineParts.tsx b/studio/src/player/components/TimelineParts.tsxindex c8b072f3..3b7e7834 100644--- a/studio/src/player/components/TimelineParts.tsx+++ b/studio/src/player/components/TimelineParts.tsx@@ -53,8 +53,9 @@ export function TimelineRazorGuide() {export { TimelineOverlays } from "./TimelineOverlays";export function TimelineEmptyStatePart() {- const { meta } = useTimelineContext();- return <TimelineEmptyState {...meta.emptyState} />;+ const { meta, state } = useTimelineContext();+ return <TimelineEmptyState {...meta.emptyState} contentOrigin={state.canvas.contentOrigin}+ trackTopPadding={state.canvas.rowGeometry.padding.top} />;}export function TimelineShortcutHint() {diff --git a/studio/src/player/components/TimelineTrackAudioControls.test.tsx b/studio/src/player/components/TimelineTrackAudioControls.test.tsxnew file mode 100644index 00000000..f373b30a--- /dev/null+++ b/studio/src/player/components/TimelineTrackAudioControls.test.tsx@@ -0,0 +1,90 @@+// @vitest-environment happy-dom+import { act } from 'react';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { mountHost, cleanupMounted } from '../../components/ui/mountHost.testHelpers';+import { TimelineEditProvider } from '../../contexts/TimelineEditContext';+import { TimelineTrackAudioControls } from './TimelineTrackAudioControls';+import type { TimelineElement } from '../store/timelineElement';++const write = vi.fn(async () => ({ status: 'saved' as const }));+const clip = (id: string, tag: string, extra = {}): TimelineElement => ({ id, tag, start: 0, duration: 2, track: 1, ...extra });+const video = clip('video', 'video', { hasAudio: true, volume: 0.7 });+const audio = clip('audio', 'audio', { volume: 0.5 });+const render = (elements: TimelineElement[]) => mountHost(<TimelineEditProvider value={{ onSetElementsAttributeQuiet: write }}>+ <TimelineTrackAudioControls elements={elements} trackLabel="Track" isAudioOnly={false} hidden={false} onUnhide={() => {}} />+</TimelineEditProvider>);+beforeEach(() => write.mockClear());+afterEach(cleanupMounted);++it('mutes all audible clips in the row without changing video visibility or volume', async () => {+ const host = render([video, audio, clip('image', 'img')]);+ expect(host.querySelectorAll('button')).toHaveLength(1);+ await act(async () => host.querySelector<HTMLButtonElement>('[aria-label="Mute audio · Track"]')!.click());+ expect(write).toHaveBeenCalledExactlyOnceWith([{ element: video, value: 'true' }, { element: audio, value: 'true' }], 'muted', 'Mute audio');+});++it('unmutes authored muted media without resetting its gain', async () => {+ const muted = { ...video, muted: true };+ const host = render([muted]);+ await act(async () => host.querySelector<HTMLButtonElement>('[aria-label="Unmute audio · Track"]')!.click());+ expect(write).toHaveBeenCalledExactlyOnceWith([{ element: muted, value: null }], 'muted', 'Unmute audio');+});++it('commits a volume adjustment once on release for all clips', async () => {+ const host = render([video, audio]);+ await act(async () => host.querySelector<HTMLButtonElement>('[aria-label="Mute audio · Track"]')!.focus());+ const input = document.querySelector<HTMLInputElement>('input[aria-label="Volume"]')!;+ expect(input).not.toBeNull();+ act(() => {+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')!.set!.call(input, '45');+ input.dispatchEvent(new Event('input', { bubbles: true }));+ });+ expect(write).not.toHaveBeenCalled();+ await act(async () => input.dispatchEvent(new PointerEvent('pointerup', { bubbles: true })));+ expect(write).toHaveBeenCalledExactlyOnceWith([{ element: video, value: '0.45' }, { element: audio, value: '0.45' }], 'data-volume', 'Change volume');+});++it('does not offer audio controls on visual-only tracks', () => {+ const host = render([clip('image', 'img'), clip('silent', 'video', { hasAudio: false })]);+ expect(host.querySelector('button')).toBeNull();+});++it('opens the slider on hover without muting, and keeps it open when mute is clicked', async () => {+ const host = render([video]);+ const button = host.querySelector<HTMLButtonElement>('[aria-label="Mute audio · Track"]')!;+ await act(async () => {+ button.dispatchEvent(new MouseEvent('mouseenter', { bubbles: false }));+ button.dispatchEvent(new MouseEvent('mousemove', { bubbles: true }));+ await new Promise(resolve => setTimeout(resolve, 200));+ });+ expect(document.querySelector('input[aria-label="Volume"]')).not.toBeNull();+ expect(write).not.toHaveBeenCalled();+ await act(async () => button.click());+ expect(write).toHaveBeenCalledOnce();+ expect(document.querySelector('input[aria-label="Volume"]')).not.toBeNull();+});++it('shows muted output at the bottom of a 0–100 slider without overwriting saved gain', async () => {+ const host = render([{ ...video, muted: true }]);+ await act(async () => host.querySelector<HTMLButtonElement>('button')!.focus());+ const input = document.querySelector<HTMLInputElement>('input[aria-label="Volume"]')!;+ expect(input.min).toBe('0');+ expect(input.max).toBe('100');+ expect(input.value).toBe('0');+ expect(document.querySelector('[role="dialog"]')?.textContent).toBe('0%');+ expect(write).not.toHaveBeenCalled();+});++it('raising the muted slider saves volume and unmutes the track', async () => {+ const muted = { ...video, muted: true };+ const host = render([muted]);+ await act(async () => host.querySelector<HTMLButtonElement>('button')!.focus());+ const input = document.querySelector<HTMLInputElement>('input[aria-label="Volume"]')!;+ act(() => {+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')!.set!.call(input, '45');+ input.dispatchEvent(new Event('input', { bubbles: true }));+ });+ await act(async () => input.dispatchEvent(new PointerEvent('pointerup', { bubbles: true })));+ expect(write).toHaveBeenNthCalledWith(1, [{ element: muted, value: '0.45' }], 'data-volume', 'Change volume');+ expect(write).toHaveBeenNthCalledWith(2, [{ element: muted, value: null }], 'muted', 'Unmute audio');+});diff --git a/studio/src/player/components/TimelineTrackAudioControls.tsx b/studio/src/player/components/TimelineTrackAudioControls.tsxnew file mode 100644index 00000000..fe84c2ff--- /dev/null+++ b/studio/src/player/components/TimelineTrackAudioControls.tsx@@ -0,0 +1,87 @@+import { Popover } from '@base-ui/react/popover';+import { useEffect, useRef, useState, type CSSProperties } from 'react';+import { useI18n } from '../../i18n/I18n';+import { RemixIcon } from '../../icons/RemixIcons';+import { useTimelineEditContextOptional } from '../../contexts/TimelineEditContext';+import { useStudioShellContextOptional } from '../../contexts/StudioContext';+import type { TimelineElement } from '../store/timelineElement';++const buttonClass = 'flex h-6 w-6 shrink-0 items-center justify-center rounded text-text-3 hover:bg-hover hover:text-text-0 disabled:opacity-40';++/** Track-level controls write each audible clip through the native batch/undo path. */+export function TimelineTrackAudioControls({ elements, trackLabel, isAudioOnly, hidden, onUnhide }: {+ elements: readonly TimelineElement[];+ trackLabel: string;+ isAudioOnly: boolean;+ hidden: boolean;+ onUnhide: () => void;+}) {+ const { t } = useI18n();+ const { onSetElementsAttributeQuiet } = useTimelineEditContextOptional();+ const shell = useStudioShellContextOptional();+ const clips = elements.filter(el => el.tag === 'audio' || (el.tag === 'video' && (el.hasAudio === true || el.muted === true)));+ const signature = clips.map(el => `${el.key ?? el.id}:${el.volume ?? 1}:${!!el.muted}`).join('|');+ const volume = Math.round((clips[0]?.volume ?? 1) * 100);+ const sliderVolume = Math.min(100, Math.max(0, volume));+ const mixed = clips.some(el => Math.round((el.volume ?? 1) * 100) !== volume);+ const muted = clips.length > 0 && clips.every(el => el.muted === true);+ const silent = muted || (isAudioOnly && hidden);+ const [open, setOpen] = useState(false);+ const [draft, setDraft] = useState(sliderVolume);+ const [dirty, setDirty] = useState(false);+ const [busy, setBusy] = useState(false);+ const running = useRef(false);+ useEffect(() => { setDraft(sliderVolume); setDirty(false); }, [signature, open]);+ const disabled = busy || !onSetElementsAttributeQuiet || !!shell?.writeBlockedReason || !!shell?.renderQueue?.isRendering;+ if (!clips.length) return null;++ const save = async (attr: string, value: string | null, label: string) => {+ if (disabled || running.current || !onSetElementsAttributeQuiet) return;+ running.current = true; setBusy(true);+ try {+ const result = await onSetElementsAttributeQuiet(clips.map(element => ({ element, value })), attr, label);+ return !result || result.status === 'saved';+ } catch (error) {+ shell?.showToast(error instanceof Error ? error.message : t('Could not save changes'), 'error');+ return false;+ } finally { running.current = false; setBusy(false); }+ };+ const shownVolume = silent && !dirty ? 0 : draft;+ const commitVolume = async () => {+ if (!dirty) return;+ const saved = await save('data-volume', String(draft / 100), 'Change volume');+ if (saved && draft > 0 && silent) {+ const unmuted = !muted || await save('muted', null, 'Unmute audio');+ if (unmuted && isAudioOnly && hidden) onUnhide();+ }+ if (!saved) setDraft(sliderVolume);+ setDirty(false);+ };+ const muteLabel = t(silent ? 'Unmute audio' : 'Mute audio');+ return <div className="ml-2 flex shrink-0 items-center" onPointerDown={e => e.stopPropagation()} onClick={e => e.stopPropagation()}>+ <Popover.Root open={open} onOpenChange={(nextOpen, details) => {+ // Pressing the speaker changes mute only; hover/focus owns the slider.+ if (details.reason === 'trigger-press') { details.cancel(); return; }+ setOpen(nextOpen);+ }}>+ <Popover.Trigger openOnHover delay={150} closeDelay={250}+ className={buttonClass} aria-label={`${muteLabel} · ${trackLabel}`} aria-pressed={silent} disabled={disabled}+ onFocus={() => setOpen(true)}+ onClick={() => void (async () => {+ const saved = await save('muted', silent ? null : 'true', silent ? 'Unmute audio' : 'Mute audio');+ if (saved && silent && isAudioOnly && hidden) onUnhide();+ })()}>+ <RemixIcon name={silent ? 'volume-mute-line' : 'volume-up-line'} size={16} />+ </Popover.Trigger>+ <Popover.Portal><Popover.Positioner side="top" align="center" sideOffset={6} collisionPadding={12} className="z-150">+ <Popover.Popup initialFocus={false} finalFocus={false} aria-label={t('Volume')} className="hf-floating-motion flex flex-col items-center gap-2 rounded-lg bg-surface p-3 text-text-1 shadow-menu outline-none">+ <span className="font-mono text-[11px] tabular-nums">{mixed && !dirty && !silent ? t('Mixed') : `${shownVolume}%`}</span>+ <input type="range" min={0} max={100} step={1} value={shownVolume} disabled={disabled}+ aria-label={t('Volume')} aria-orientation="vertical" aria-valuetext={`${shownVolume}%`} className="hf-volume-vertical-range" style={{ "--volume-progress": `${shownVolume}%` } as CSSProperties}+ onChange={e => { setDraft(Number(e.currentTarget.value)); setDirty(true); }}+ onPointerUp={() => void commitVolume()} onKeyUp={() => void commitVolume()} onBlur={() => void commitVolume()} />+ </Popover.Popup>+ </Popover.Positioner></Popover.Portal>+ </Popover.Root>+ </div>;+}diff --git a/studio/src/player/components/TimelineTrackHeader.tsx b/studio/src/player/components/TimelineTrackHeader.tsxindex 09b87a4f..f7490a52 100644--- a/studio/src/player/components/TimelineTrackHeader.tsx+++ b/studio/src/player/components/TimelineTrackHeader.tsx@@ -24,6 +24,8 @@ import type { TimelineTheme } from "./timelineTheme";import { trackDisplaySuffix } from "./timelineTrackDisplay";import { AutomationLaneHeaderRow, PropertyGroupHeaderRow } from "./trackHeaderLabelRows";import { useMemo } from "react";+import { useMvpEditor } from "../../motion/StudioHost";+import { TimelineTrackAudioControls } from "./TimelineTrackAudioControls";/** Accent rail + inset marking a row as a group MEMBER, matching the level-2* nesting its `aria-level` already reports. */@@ -108,6 +110,7 @@ export function TimelineTrackHeader({onSeek,rovingTargetId = null,}: TimelineTrackHeaderProps) {+ const mvp = useMvpEditor();const clipPercentage = keyframeClip? ((currentTime - keyframeClip.start) / keyframeClip.duration) * 100: 0;@@ -205,6 +208,9 @@ export function TimelineTrackHeader({// moment an envelope appeared.const isKeyframeLayer = !!keyframeClip && disclosable && !isAudioTrack;const isAudioOnly = isAudioOnlyTrack(trackElements);+ const audioControls = mvp ? <TimelineTrackAudioControls elements={trackElements} trackLabel={trackLabel}+ isAudioOnly={isAudioOnly} hidden={isTrackHidden}+ onUnhide={() => { void onToggleTrackHidden?.(trackNumber, false, trackDisplayNumber); }} /> : null;// What the lane disclosure calls this row. A row of several clips is named// for the TRACK, not for whichever is selected — the lanes are the track's,// shared per property, so "Narration 2 lanes" read as if they were that one@@ -316,6 +322,8 @@ export function TimelineTrackHeader({isAudioTrack={isAudioTrack}isAudioOnly={isAudioOnly}onToggleTrackHidden={onToggleTrackHidden}+ hideVisibility={mvp && isAudioOnly}+ audioControls={audioControls}// On the control line rather than a third row of its own.trailing={<>@@ -382,13 +390,14 @@ export function TimelineTrackHeader({(hover-gated, and only while expanded) left a keyframed track withno way to be hidden at all by keyboard, and put the control on arow it does not act on. */}- <VisibilityButton+ {audioControls}+ {!(mvp && isAudioOnly) && <VisibilityButtonhidden={isTrackHidden}trackNumber={trackNumber}trackDisplayNumber={trackDisplayNumber}asMute={isAudioOnly}onToggle={onToggleTrackHidden}- />+ />}</LayerDisclosureRow></>)}diff --git a/studio/src/player/components/TimelineTrackPlainHeader.tsx b/studio/src/player/components/TimelineTrackPlainHeader.tsxindex 2c3db97a..41b5bdf6 100644--- a/studio/src/player/components/TimelineTrackPlainHeader.tsx+++ b/studio/src/player/components/TimelineTrackPlainHeader.tsx@@ -61,6 +61,8 @@ export function PlainTrackHeader({isAudioOnly,onToggleTrackHidden,trailing,+ hideVisibility = false,+ audioControls,}: {trackNumber: number;trackDisplayNumber: number | null;@@ -74,6 +76,8 @@ export function PlainTrackHeader({/** Trailing controls that belong on the control line — the FX entry points,* which the caller owns because only it knows the clip they act on. */trailing?: React.ReactNode;+ hideVisibility?: boolean;+ audioControls?: React.ReactNode;}) {return (<>@@ -104,13 +108,14 @@ export function PlainTrackHeader({truncating name leaves, so the controls sit on the edge whatever thename's length. */}<div className="ml-auto flex shrink-0 items-center gap-1">- <VisibilityButton+ {audioControls}+ {!hideVisibility && <VisibilityButtonhidden={isTrackHidden}trackNumber={trackNumber}trackDisplayNumber={trackDisplayNumber}asMute={isAudioOnly}onToggle={onToggleTrackHidden}- />+ />}{trailing}</div></div>diff --git a/studio/src/player/components/TrackClipCount.tsx b/studio/src/player/components/TrackClipCount.tsxindex 31d796bf..05accbd5 100644--- a/studio/src/player/components/TrackClipCount.tsx+++ b/studio/src/player/components/TrackClipCount.tsx@@ -1,4 +1,5 @@import { useI18n } from "../../i18n/I18n";+import { useMvpEditor } from "../../motion/StudioHost";/*** How many clips the track holds, shown next to the track's identity so a* multi-clip track reads as one at a glance. A single-clip track shows nothing:@@ -6,7 +7,8 @@ import { useI18n } from "../../i18n/I18n";*/export function TrackClipCount({ clipCount }: { clipCount: number }) {const { t } = useI18n();- if (clipCount < 2) return null;+ const mvp = useMvpEditor();+ if (mvp || clipCount < 2) return null;return (<spanaria-label={t("{clipCount} clips", { clipCount: clipCount })}diff --git a/studio/src/player/components/VolumeControl.test.tsx b/studio/src/player/components/VolumeControl.test.tsxindex 8b37191f..a1112cbb 100644--- a/studio/src/player/components/VolumeControl.test.tsx+++ b/studio/src/player/components/VolumeControl.test.tsx@@ -23,7 +23,7 @@ afterEach(() => {document.body.innerHTML = "";});-function renderVolumeControl(overrides: Partial<React.ComponentProps<typeof VolumeControl>> = {}) {+async function renderVolumeControl(overrides: Partial<React.ComponentProps<typeof VolumeControl>> = {}) {const props = {audioMuted: false,audioVolume: 1,@@ -33,7 +33,8 @@ function renderVolumeControl(overrides: Partial<React.ComponentProps<typeof Volu...overrides,};act(() => root.render(<VolumeControl {...props} />));- return { host, props };+ await act(async () => host.querySelector<HTMLButtonElement>("button")?.focus());+ return { host: document.body, props };}function setRangeValue(input: HTMLInputElement, value: string): void {@@ -44,16 +45,49 @@ function setRangeValue(input: HTMLInputElement, value: string): void {}describe("VolumeControl", () => {- it("exposes the current preview volume as an accessible range", () => {- const { host } = renderVolumeControl({ audioVolume: 0.42 });+ it("opens on hover without muting and leaves the slider open when mute is clicked", async () => {+ const props = { audioMuted: false, audioVolume: 0.5, disabled: false, setAudioMuted: vi.fn(), setAudioVolume: vi.fn() };+ act(() => root.render(<VolumeControl {...props} />));+ const button = host.querySelector<HTMLButtonElement>('button[aria-label="Mute audio"]')!;+ expect(document.querySelector('input[aria-label="Preview volume"]')).toBeNull();+ await act(async () => {+ button.dispatchEvent(new MouseEvent('mouseenter', { bubbles: false }));+ button.dispatchEvent(new MouseEvent('mousemove', { bubbles: true }));+ await new Promise(resolve => setTimeout(resolve, 200));+ });+ expect(document.querySelector('input[aria-label="Preview volume"]')).not.toBeNull();+ expect(props.setAudioMuted).not.toHaveBeenCalled();+ act(() => button.click());+ expect(props.setAudioMuted).toHaveBeenCalledExactlyOnceWith(true);+ expect(document.querySelector('input[aria-label="Preview volume"]')).not.toBeNull();+ });++ it("exposes the current preview volume as an accessible range", async () => {+ const { host } = await renderVolumeControl({ audioVolume: 0.42 });const slider = host.querySelector<HTMLInputElement>('input[aria-label="Preview volume"]');expect(slider?.value).toBe("42");+ expect(slider?.getAttribute("aria-orientation")).toBe("vertical");expect(slider?.getAttribute("aria-valuetext")).toBe("42%");});- it("updates the preview volume while dragging", () => {- const { host, props } = renderVolumeControl();+ it("shows zero while muted and restores the saved level on unmute", async () => {+ const { host, props } = await renderVolumeControl({ audioMuted: true, audioVolume: 0.21 });+ const slider = host.querySelector<HTMLInputElement>('input[aria-label="Preview volume"]')!;+ expect(slider.value).toBe("0");+ expect(slider.getAttribute("aria-valuetext")).toBe("0%");+ expect(host.querySelector('[role="dialog"]')?.textContent).toContain("0%");++ act(() => host.querySelector<HTMLButtonElement>('button[aria-label="Unmute audio"]')!.click());+ expect(props.setAudioMuted).toHaveBeenCalledWith(false);+ expect(props.setAudioVolume).not.toHaveBeenCalled();+ act(() => root.render(<VolumeControl {...props} audioMuted={false} />));+ expect(slider.value).toBe("21");+ expect(slider.getAttribute("aria-valuetext")).toBe("21%");+ });++ it("updates the preview volume while dragging", async () => {+ const { host, props } = await renderVolumeControl();const slider = host.querySelector<HTMLInputElement>('input[aria-label="Preview volume"]');if (!slider) throw new Error("preview volume slider did not render");@@ -62,8 +96,8 @@ describe("VolumeControl", () => {expect(props.setAudioVolume).toHaveBeenCalledWith(0.35);});- it("unmutes when a muted preview is given a positive volume", () => {- const { host, props } = renderVolumeControl({ audioMuted: true });+ it("unmutes when a muted preview is given a positive volume", async () => {+ const { host, props } = await renderVolumeControl({ audioMuted: true });const slider = host.querySelector<HTMLInputElement>('input[aria-label="Preview volume"]');if (!slider) throw new Error("preview volume slider did not render");@@ -73,8 +107,8 @@ describe("VolumeControl", () => {expect(props.setAudioMuted).toHaveBeenCalledWith(false);});- it("restores an audible level when unmuting from zero", () => {- const { host, props } = renderVolumeControl({ audioVolume: 0 });+ it("restores an audible level when unmuting from zero", async () => {+ const { host, props } = await renderVolumeControl({ audioVolume: 0 });const button = host.querySelector<HTMLButtonElement>('button[aria-label="Unmute audio"]');if (!button) throw new Error("unmute button did not render");diff --git a/studio/src/player/components/VolumeControl.tsx b/studio/src/player/components/VolumeControl.tsxindex bdc6f1ee..fa9192d6 100644--- a/studio/src/player/components/VolumeControl.tsx+++ b/studio/src/player/components/VolumeControl.tsx@@ -1,7 +1,8 @@+import { useMvpEditor } from "../../motion/StudioHost";import { RemixIcon } from "../../icons/RemixIcons";import { useI18n } from "../../i18n/I18n";-import { memo } from "react";-import { Tooltip } from "../../components/ui";+import { memo, useState, type CSSProperties } from "react";+import { Popover } from "@base-ui/react/popover";import { trackStudioEvent } from "../../utils/studioTelemetry";interface VolumeControlProps {@@ -13,9 +14,10 @@ interface VolumeControlProps {}function VolumeIcon({ muted, volume }: { muted: boolean; volume: number }) {+ const mvp = useMvpEditor();const silent = muted || volume === 0;return (- <RemixIcon name={silent ? "volume-mute-line" : volume >= 0.5 ? "volume-up-line" : "volume-down-line"} size={16} />+ <RemixIcon name={silent ? "volume-mute-line" : mvp || volume >= 0.5 ? "volume-up-line" : "volume-down-line"} size={16} />);}@@ -27,58 +29,45 @@ export const VolumeControl = memo(function VolumeControl({setAudioVolume,}: VolumeControlProps) {const { t } = useI18n();- const percentage = Math.round(audioVolume * 100);+ const [open, setOpen] = useState(false);+ // Show effective output while retaining the saved level for unmute.+ const percentage = audioMuted ? 0 : Math.round(audioVolume * 100);const silent = audioMuted || audioVolume === 0;const muteLabel = t(silent ? "Unmute audio" : "Mute audio");- return (- <div className="group flex shrink-0 items-center">- <div className="w-0 overflow-hidden opacity-0 transition-[width,opacity] duration-150 ease-out group-hover:w-14 group-hover:opacity-100 group-has-[:focus-visible]:w-14 group-has-[:focus-visible]:opacity-100 group-has-[input:active]:w-14 group-has-[input:active]:opacity-100">- <div className="relative mx-1 flex h-6 w-12 items-center">- <div className="absolute inset-x-0 h-0.5 overflow-hidden rounded-full bg-neutral-700">- <div- className="h-full rounded-full bg-neutral-300"- style={{ width: `${percentage}%` }}- />- </div>- <input- type="range"- min="0"- max="100"- step="1"- value={percentage}- disabled={disabled}- aria-label={t("Preview volume")}- aria-valuetext={`${percentage}%`}- title={t("Preview volume: {percentage}%", { percentage: percentage })}- onChange={(event) => {+ return <Popover.Root open={open} onOpenChange={(next, details) => {+ // Clicking toggles mute; hover and keyboard focus expose the volume slider.+ if (details.reason === "trigger-press") { details.cancel(); return; }+ setOpen(next);+ }}>+ <Popover.Trigger openOnHover delay={150} closeDelay={250}+ onFocus={() => setOpen(true)}+ onClick={() => {+ trackStudioEvent("playback", { action: "mute_toggle", muted: !silent });+ if (silent && audioVolume === 0) setAudioVolume(1);+ setAudioMuted(!silent);+ }}+ data-studio-control="mute" disabled={disabled} aria-label={muteLabel} aria-pressed={silent}+ className={`flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition-colors disabled:pointer-events-none disabled:opacity-30 ${+ silent ? "text-accent-ink" : "text-neutral-500 hover:text-neutral-200"+ }`}>+ <VolumeIcon muted={audioMuted} volume={audioVolume} />+ </Popover.Trigger>+ <Popover.Portal container={typeof document !== "undefined" ? document.fullscreenElement as HTMLElement ?? undefined : undefined}>+ <Popover.Positioner side="top" align="center" sideOffset={6} collisionPadding={8} className="z-150">+ <Popover.Popup initialFocus={false} finalFocus={false} aria-label={t("Preview volume")}+ className="hf-floating-motion flex flex-col items-center gap-2 rounded-lg bg-surface p-3 text-text-1 shadow-menu outline-none">+ <span className="font-mono text-[11px] tabular-nums">{percentage}%</span>+ <input type="range" min="0" max="100" step="1" value={percentage} disabled={disabled}+ aria-label={t("Preview volume")} aria-orientation="vertical" aria-valuetext={`${percentage}%`}+ className="hf-volume-vertical-range" style={{ "--volume-progress": `${percentage}%` } as CSSProperties}+ onChange={event => {const volume = Number(event.currentTarget.value) / 100;setAudioVolume(volume);if (audioMuted && volume > 0) setAudioMuted(false);- }}- className="hf-preview-volume-range absolute inset-0 w-full disabled:pointer-events-none"- />- </div>- </div>-- <Tooltip label={muteLabel}>- <button- type="button"- onClick={() => {- trackStudioEvent("playback", { action: "mute_toggle", muted: !silent });- if (silent && audioVolume === 0) setAudioVolume(1);- setAudioMuted(!silent);- }}- disabled={disabled}- aria-label={muteLabel}- aria-pressed={silent}- className={`flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition-colors disabled:pointer-events-none disabled:opacity-30 ${- silent ? "text-accent-ink" : "text-neutral-500 hover:text-neutral-200"- }`}- >- <VolumeIcon muted={audioMuted} volume={audioVolume} />- </button>- </Tooltip>- </div>- );+ }} />+ </Popover.Popup>+ </Popover.Positioner>+ </Popover.Portal>+ </Popover.Root>;});diff --git a/studio/src/player/lib/automationStoreSync.test.ts b/studio/src/player/lib/automationStoreSync.test.tsindex d8c8ea94..258228c0 100644--- a/studio/src/player/lib/automationStoreSync.test.ts+++ b/studio/src/player/lib/automationStoreSync.test.ts@@ -33,6 +33,15 @@ beforeEach(() => {});describe("syncStoredElementAttribute", () => {+ it("keeps mute state in sync across save, undo and redo without resetting gain", () => {+ usePlayerStore.setState({ elements: [el({ volume: 0.5 })] });+ syncStoredElementAttribute(el(), 'muted', '');+ expect(usePlayerStore.getState().elements[0]).toMatchObject({ muted: true, volume: 0.5 });+ syncStoredAutomationFromPreview(previewWith({ 'data-volume': '0.5' }));+ expect(usePlayerStore.getState().elements[0]?.muted).toBeUndefined();+ syncStoredAutomationFromPreview(previewWith({ 'data-volume': '0.5', muted: '' }));+ expect(usePlayerStore.getState().elements[0]).toMatchObject({ muted: true, volume: 0.5 });+ });it("records a saved fade on the stored clip, so the timeline draws what the file holds", () => {usePlayerStore.setState({ elements: [el({ fadeIn: 1 })] });syncStoredElementAttribute(el(), "data-fade-in", "2.5");diff --git a/studio/src/player/lib/automationStoreSync.ts b/studio/src/player/lib/automationStoreSync.tsindex 0d926e4a..56a6cf0b 100644--- a/studio/src/player/lib/automationStoreSync.ts+++ b/studio/src/player/lib/automationStoreSync.ts@@ -61,6 +61,7 @@ function syncedFields(doc: Document, element: TimelineElement, node: Element) {fadeIn: storedFade(fades.fadeIn),fadeOut: storedFade(fades.fadeOut),volume: elementVolume(node, resolveMediaElement(node) ?? node),+ muted: node.hasAttribute("muted") || (resolveMediaElement(node)?.hasAttribute("muted") ?? false) || undefined,audioGroupAutomation: group?.automation,audioGroupFxChain: group?.fxChain,};@@ -96,6 +97,7 @@ const STORED_FIELD: Record<string, (value: string | null) => Partial<TimelineEle[HF_AUDIO_FADE_OUT_ATTR]: (value) => ({ fadeOut: storedFade(readFadeSeconds(value)) }),// A quick volume save writes no other field the store keeps: without this, a clip read its last load's volume."data-volume": (value) => ({ volume: parseStoredVolume(value) }),+ muted: (value) => ({ muted: value !== null || undefined }),};/** Record a saved automation, FX-chain, fade or volume value on one element's stored copy. */diff --git a/studio/src/styles/components.css b/studio/src/styles/components.cssindex 38b40059..165151ff 100644--- a/studio/src/styles/components.css+++ b/studio/src/styles/components.css@@ -1,6 +1,85 @@/* Rules for Studio's components, for any page that renders them. Reads the tokens in* theme.css. The app shell (body, #root, preflight) stays in studio.css. */+.motion-player-responsive {+ container: motion-player / inline-size;+}++.motion-player-control-row {+ display: grid;+ grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);+ align-items: center;+ min-height: 28px;+}++.motion-player-secondary { gap: 6px; }++@container motion-player (max-width: 420px) {+ .motion-player-secondary { gap: 2px; }+}++@container motion-player (max-width: 420px) {+ .motion-player-control-row {+ grid-template-columns: minmax(0, 1fr) 32px 28px;+ column-gap: 8px;+ }+ .motion-player-optional { display: none; }+}++.hf-volume-vertical-range {+ writing-mode: vertical-lr;+ direction: rtl;+ width: 24px;+ height: 96px;+ appearance: none;+ background: transparent;+ cursor: pointer;+}++.hf-volume-vertical-range:disabled { opacity: 0.3; }++.hf-volume-vertical-range::-webkit-slider-runnable-track {+ width: 2px;+ height: 100%;+ border-radius: 999px;+ background: linear-gradient(to top, var(--motion-brand, var(--color-accent)) 0 var(--volume-progress, 0%), var(--color-border-strong) var(--volume-progress, 0%) 100%);+}++.hf-volume-vertical-range::-webkit-slider-thumb {+ appearance: none;+ width: 0.5rem;+ height: 0.5rem;+ margin-left: -3px;+ border: 0;+ border-radius: 50%;+ background: currentColor;+ cursor: grab;+}++.hf-volume-vertical-range::-moz-range-track {+ width: 2px;+ height: 100%;+ border: 0;+ border-radius: 999px;+ background: linear-gradient(to top, var(--motion-brand, var(--color-accent)) 0 var(--volume-progress, 0%), var(--color-border-strong) var(--volume-progress, 0%) 100%);+}++.hf-volume-vertical-range::-moz-range-thumb {+ width: 0.5rem;+ height: 0.5rem;+ border: 0;+ border-radius: 50%;+ background: currentColor;+ cursor: grab;+}++.hf-volume-vertical-range:active { cursor: grabbing; }+.hf-volume-vertical-range:focus-visible {+ outline: 2px solid var(--color-border-strong);+ outline-offset: 2px;+ border-radius: 4px;+}+/* Assets and catalog tiles share column widths and spacing at every panel size. */.hf-media-card-grid {display: grid;@@ -1203,3 +1282,75 @@animation: none;}}+++/* Shared overlay motion. Dock panel resizing/expansion has its own timing. */+.hf-floating-motion {+ --overlay-x: 0px;+ --overlay-y: 3px;+ opacity: 1;+ scale: 1;+ transform: translate(0, 0);+ transform-origin: var(--transform-origin, center);+ transition: opacity var(--duration-open, 160ms) cubic-bezier(.22, 1, .36, 1),+ transform var(--duration-open, 160ms) cubic-bezier(.22, 1, .36, 1),+ scale var(--duration-open, 160ms) cubic-bezier(.22, 1, .36, 1);+}+.hf-floating-motion[data-side="top"] { --overlay-y: -3px; }+.hf-floating-motion[data-side="left"] { --overlay-x: -3px; --overlay-y: 0px; }+.hf-floating-motion[data-side="right"] { --overlay-x: 3px; --overlay-y: 0px; }+.hf-floating-motion[data-starting-style] {+ opacity: 0;+ scale: .98;+ transform: translate(var(--overlay-x), var(--overlay-y));+}+.hf-floating-motion[data-ending-style] {+ opacity: 0;+ transition-duration: 100ms;+}+.hf-tooltip-motion { transition-duration: 100ms; }+.hf-tooltip-motion[data-instant] { transition-duration: 0ms; }+.hf-floating-motion[data-preview-state="open"] { opacity: 1; scale: 1; transform: none; }++/* Native and custom dialogs share the same entrance without changing placement.+ * Scale is separate from translate so centered dialogs keep their centering. */+:root[data-motion-ui] :is(dialog, [role="dialog"], [role="alertdialog"]):not(.hf-floating-motion):not(.motion-sidebar-drawer) {+ opacity: 1;+ scale: 1;+ transition: opacity 180ms cubic-bezier(.22, 1, .36, 1), scale 180ms cubic-bezier(.22, 1, .36, 1),+ display 180ms allow-discrete, overlay 180ms allow-discrete;+}+:root[data-motion-ui] :is(dialog:not([open]), [role="dialog"][data-starting-style], [role="dialog"][data-ending-style]):not(.hf-floating-motion):not(.motion-sidebar-drawer) {+ opacity: 0;+ scale: .985;+}+:root[data-motion-ui] [role="dialog"][data-ending-style]:not(.hf-floating-motion) { transition-duration: 100ms; }+.hf-overlay-backdrop, :root[data-motion-ui] dialog::backdrop {+ opacity: 1;+ transition: opacity 180ms cubic-bezier(.22, 1, .36, 1), display 180ms allow-discrete, overlay 180ms allow-discrete;+}+.hf-overlay-backdrop:is([data-starting-style], [data-ending-style]),+:root[data-motion-ui] dialog:not([open])::backdrop { opacity: 0; }+.motion-sidebar-drawer {+ opacity: 1;+ transform: translateX(0);+ transition: opacity 180ms cubic-bezier(.22, 1, .36, 1), transform 180ms cubic-bezier(.22, 1, .36, 1);+}+.motion-sidebar-drawer:is([data-starting-style], [data-ending-style]) { opacity: 0; transform: translateX(-8px); }+.motion-sidebar-drawer[data-ending-style], .hf-overlay-backdrop[data-ending-style] { transition-duration: 100ms; }++/* Also covers popups that mount directly instead of using Base UI presence. */+@starting-style {+ .hf-floating-motion:not([data-preview-state="open"]) {+ opacity: 0;+ scale: .98;+ transform: translate(var(--overlay-x), var(--overlay-y));+ }+ :root[data-motion-ui] :is(dialog[open], [role="dialog"], [role="alertdialog"]):not(.hf-floating-motion):not(.motion-sidebar-drawer) { opacity: 0; scale: .985; }+ .hf-overlay-backdrop, :root[data-motion-ui] dialog[open]::backdrop { opacity: 0; }+}+@media (prefers-reduced-motion: reduce) {+ .hf-floating-motion, .hf-overlay-backdrop, .motion-sidebar-drawer,+ :root[data-motion-ui] :is(dialog, [role="dialog"], [role="alertdialog"]),+ :root[data-motion-ui] dialog::backdrop { transition: none !important; }+}diff --git a/studio/src/styles/theme.css b/studio/src/styles/theme.cssindex 795a0481..7bd3f155 100644--- a/studio/src/styles/theme.css+++ b/studio/src/styles/theme.css@@ -33,6 +33,14 @@* colour-scheme decides: Studio is dark, `data-theme="paper"` makes it light, and the player* keeps a dark scheme in both. Text clears 4.5:1 and icons 3:1 on every surface below. */+ /* Feedback floats above the editor with an inverse, slightly translucent surface. */+ --color-toast-feedback: light-dark(rgb(24 24 24 / 97%), rgb(250 250 250 / 97%));+ --color-toast-feedback-ink: light-dark(#fff, #181818);++ --color-media-preview-scrim: rgba(96, 96, 96, 0.65);+ --color-transparency-light: #fff;+ --color-transparency-dark: #ddd;+/* Surfaces: the app shell first, menus and popovers last. */--color-bg-0: light-dark(oklch(0.955 0.005 70), oklch(0.235 0.007 70));--color-bg-1: var(--color-bg-0);@@ -330,7 +338,7 @@--duration-hover: 150ms;--duration-expand: 160ms;/* Menus, popovers, and dropdowns. Open is ease-out; close is shorter and ease-in. */- --duration-open: 120ms;+ --duration-open: 160ms;--duration-close: 90ms;/* Tooltips use the same enter shape on a shorter open. */--duration-tooltip: 100ms;diff --git a/studio/src/styles/theme.test.ts b/studio/src/styles/theme.test.tsindex e45c1a33..c603471a 100644--- a/studio/src/styles/theme.test.ts+++ b/studio/src/styles/theme.test.ts@@ -111,7 +111,7 @@ describe("studio theme", () => {});it("opens menus from a visible shape and closes them faster", () => {- expect(declaredValue("--duration-open")).toBe("120ms");+ expect(declaredValue("--duration-open")).toBe("160ms");expect(declaredValue("--duration-close")).toBe("90ms");expect(declaredValue("--duration-tooltip")).toBe("100ms");expect(declaredValue("--popup-enter-opacity")).toBe("0.8");diff --git a/studio/src/styles/tokenGate.test.ts b/studio/src/styles/tokenGate.test.tsindex afc15074..ef3bc7e2 100644--- a/studio/src/styles/tokenGate.test.ts+++ b/studio/src/styles/tokenGate.test.ts@@ -27,8 +27,8 @@ async function resolvable(candidates: string[]): Promise<Set<string>> {base: STYLES_DIR,loadStylesheet,});- // Include the host theme and the unified connection/gallery styles imported by the app.- const hostStyles = ["../motion/theme.css", "../motion/workspace.css", "../motion/media-gateway.css", "../../../web/design-system/controls.css", "../../../web/design-system/material.css", "../../../web/connect.css", "../../../web/template-gallery.css"];+ // Include host and component styles imported by the app or linked by its HTML shell.+ const hostStyles = ["../motion/theme.css", "../motion/loading.css", "../components/ui/errorNotice.css", "../motion/workspace.css", "../motion/media-gateway.css", "../../../web/design-system/controls.css", "../../../web/design-system/material.css", "../../../web/connect.css", "../../../web/template-gallery.css"];const css = compiled.build(candidates) + hostStyles.map(file => readFileSync(path.join(STYLES_DIR, file), "utf8")).join("\n");const selectors = new Set<string>();for (const [, selector] of css.matchAll(CLASS_SELECTOR)) {@@ -90,7 +90,7 @@ describe("token gate", () => {it("accepts variants, static utilities and Studio's own CSS classes", async () => {// `timeline-clip` is a plain rule in `components.css`, not a utility.- const source = `<div className="hover:bg-surface/50 text-center border-dashed timeline-clip" />`;+ const source = `<div className="hover:bg-surface/50 text-center border-dashed timeline-clip motion-loading motion-error-notice-summary" />`;expect(await unresolved(new Map([["a.tsx", source]]))).toEqual([]);});diff --git a/studio/src/utils/assetPreviewStore.ts b/studio/src/utils/assetPreviewStore.tsindex 44e807bc..27af7a76 100644--- a/studio/src/utils/assetPreviewStore.ts+++ b/studio/src/utils/assetPreviewStore.ts@@ -1,9 +1,7 @@/**- * Tiny Zustand slice that carries the "asset preview overlay" state.- *- * When a user clicks an asset card that has NOT yet been added to the- * timeline the overlay fires up: a dark scrim + centered media element- * (img / video / audio) + filename label rendered inside PreviewPane.+ * Shared, mutually exclusive project-asset and catalog previews.+ * The MVP displays either source in a modal preview; legacy asset previews+ * retain their floating card. Preview state never changes project content.** State lives here so AssetsTab (sidebar) and PreviewPane (preview column)* can communicate without prop-drilling through the multi-layer EditorShell@@ -15,6 +13,8 @@import { create } from "zustand";interface AssetPreviewState {+ catalogPreview: { videoUrl?: string; posterUrl?: string; title: string } | null;+ setCatalogPreview: (preview: { videoUrl?: string; posterUrl?: string; title: string }) => void;/** Project-relative asset path currently being previewed, or null. */previewAsset: string | null;/** projectId for which the preview was opened (used to build the serve URL). */@@ -26,8 +26,10 @@ interface AssetPreviewState {}export const useAssetPreviewStore = create<AssetPreviewState>((set) => ({+ catalogPreview: null,+ setCatalogPreview: (catalogPreview) => set({ catalogPreview, previewAsset: null, previewProjectId: null }),previewAsset: null,previewProjectId: null,- setPreviewAsset: (asset, projectId) => set({ previewAsset: asset, previewProjectId: projectId }),- clearPreviewAsset: () => set({ previewAsset: null, previewProjectId: null }),+ setPreviewAsset: (asset, projectId) => set({ previewAsset: asset, previewProjectId: projectId, catalogPreview: null }),+ clearPreviewAsset: () => set({ previewAsset: null, previewProjectId: null, catalogPreview: null }),}));diff --git a/studio/src/utils/domEditSaveQueue.ts b/studio/src/utils/domEditSaveQueue.tsindex f1d80354..e12860ec 100644--- a/studio/src/utils/domEditSaveQueue.ts+++ b/studio/src/utils/domEditSaveQueue.ts@@ -31,7 +31,7 @@ const DEFAULT_FAILURE_THRESHOLD = 5;export class DomEditSaveQueueOpenError extends Error {constructor() {- super("Auto-save is paused. Dismiss the warning to retry DOM edits.");+ super("Auto-save is paused. Changes were not saved.");this.name = "DomEditSaveQueueOpenError";}}diff --git a/studio/src/utils/saveFailureFeedback.ts b/studio/src/utils/saveFailureFeedback.tsnew file mode 100644index 00000000..275a64ac--- /dev/null+++ b/studio/src/utils/saveFailureFeedback.ts@@ -0,0 +1,11 @@+/** Only recognized causes reach the feedback; never echo file paths or server output. */+export function saveFailureFeedback(statusCode: number | null, diagnostic: string): string {+ if (statusCode === 409) return "The project changed elsewhere. Changes were not saved.";+ if (statusCode === 401 || statusCode === 403 || /EACCES|EPERM|permission denied|access denied/i.test(diagnostic)) {+ return "No permission to save changes.";+ }+ if (/failed to fetch|network\s?error|fetch failed|ECONNREFUSED|connection.*(?:lost|refused|failed)/i.test(diagnostic)) {+ return "Connection lost. Changes were not saved.";+ }+ return "Changes were not saved. Saving is paused.";+}diff --git a/studio/src/utils/studioHelpers.ts b/studio/src/utils/studioHelpers.tsindex a232db6a..a0d72ef5 100644--- a/studio/src/utils/studioHelpers.ts+++ b/studio/src/utils/studioHelpers.ts@@ -15,6 +15,8 @@ export interface EditingFile {export interface AppToast {message: string;tone: "error" | "info";+ /** Brief feedback without actions or diagnostics; expires after three seconds. */+ presentation?: "feedback";}export type RightPanelTab =diff --git a/web/design-system/base.css b/web/design-system/base.cssindex 6ca5d2d4..dd9ecd1c 100644--- a/web/design-system/base.css+++ b/web/design-system/base.css@@ -9,6 +9,7 @@}:where(html[data-motion-ui]), :where(html[data-motion-ui]) body { margin: 0; min-height: 100%; }:where([data-motion-ui]) :where(button, input, textarea, select) { font: inherit; color: inherit; }+[data-motion-ui] :is(input, textarea)::placeholder { color: var(--motion-placeholder); opacity: 1; }:where([data-motion-ui]) :where(button, a, label, input, textarea, select) { -webkit-tap-highlight-color: transparent; }:where([data-motion-ui]) :where(button) { cursor: pointer; }:where([data-motion-ui]) :where(button, input, textarea, select):disabled { cursor: not-allowed; opacity: .4; }diff --git a/web/design-system/controls.css b/web/design-system/controls.cssindex ef1aae10..e4db6b29 100644--- a/web/design-system/controls.css+++ b/web/design-system/controls.css@@ -29,7 +29,7 @@}:where([data-motion-ui]) .ui-input:hover:not(:disabled) { border-color: var(--motion-border-strong); }:where([data-motion-ui]) .ui-input:focus { border-color: var(--motion-selected); }-:where([data-motion-ui]) .ui-input::placeholder { color: var(--motion-dim); }+:where([data-motion-ui]) .ui-input::placeholder { color: var(--motion-placeholder); }:where([data-motion-ui]) textarea.ui-input { resize: vertical; min-height: 76px; }:where([data-motion-ui]) select.ui-input { cursor: pointer; }:where([data-motion-ui]) .ui-badge {diff --git a/web/design-system/icons.svg b/web/design-system/icons.svgindex 839dc2bc..1f69e39f 100644--- a/web/design-system/icons.svg+++ b/web/design-system/icons.svg@@ -255,4 +255,8 @@<symbol id="icon-minimize" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"/></symbol><symbol id="icon-arrow-up" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"/></symbol><symbol id="ri-shape-2-line" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M20 16H22V22H16V20H8V22H2V16H4V8H2V2H8V4H16V2H22V8H20V16ZM18 16V8H16V6H8V8H6V16H8V18H16V16H18ZM4 4V6H6V4H4ZM4 18V20H6V18H4ZM18 4V6H20V4H18ZM18 18V20H20V18H18Z"/></symbol>+<symbol id="ri-focus-3-line" viewBox="0 0 24 24"><path d="M13 1L13.001 4.06201C16.6192 4.51365 19.4869 7.38163 19.9381 11L23 11V13L19.938 13.001C19.4864 16.6189 16.6189 19.4864 13.001 19.938L13 23H11L11 19.9381C7.38163 19.4869 4.51365 16.6192 4.06201 13.001L1 13V11L4.06189 11C4.51312 7.38129 7.38129 4.51312 11 4.06189L11 1H13ZM12 6C8.68629 6 6 8.68629 6 12C6 15.3137 8.68629 18 12 18C15.3137 18 18 15.3137 18 12C18 8.68629 15.3137 6 12 6ZM12 10C13.1046 10 14 10.8954 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10Z"/></symbol>+<symbol id="ri-align-left" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z"/></symbol>+<symbol id="ri-align-center" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z"/></symbol>+<symbol id="ri-align-right" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z"/></symbol></svg>diff --git a/web/design-system/tokens.css b/web/design-system/tokens.cssindex 9431a3a4..20c57e8a 100644--- a/web/design-system/tokens.css+++ b/web/design-system/tokens.css@@ -75,6 +75,7 @@--motion-text: #494949;--motion-muted: #5c5c5c;--motion-dim: #696969;+ --motion-placeholder: #848484;--motion-strong: #202020;--motion-accent: #007106;--motion-accent-hover: #0d5400;@@ -121,6 +122,7 @@--motion-text: #ededed;--motion-muted: #bdbdbd;--motion-dim: #c0c0c0;+ --motion-placeholder: #969696;--motion-strong: #fafafa;--motion-accent: #adf788;--motion-accent-hover: #87ea5c;@@ -168,6 +170,7 @@--motion-text: #ededed;--motion-muted: #bdbdbd;--motion-dim: #c0c0c0;+ --motion-placeholder: #969696;--motion-strong: #fafafa;--motion-accent: #adf788;--motion-accent-hover: #87ea5c;diff --git a/web/design-system/tokens.json b/web/design-system/tokens.jsonindex 86d1767e..2c4bca3c 100644--- a/web/design-system/tokens.json+++ b/web/design-system/tokens.json@@ -90,6 +90,7 @@"text": "#494949","muted": "#5c5c5c","dim": "#696969",+ "placeholder": "#848484","strong": "#202020","accent": "#007106","accent-hover": "#0d5400",@@ -135,6 +136,7 @@"text": "#ededed","muted": "#bdbdbd","dim": "#c0c0c0",+ "placeholder": "#969696","strong": "#fafafa","accent": "#adf788","accent-hover": "#87ea5c",