The VS Code of video editing, built for agents.
TypeScript
Refactor timeline and soundboard components by adjusting layout and removing the footer. Update ruler dimensions in timeline configuration for improved UI consistency.
konstantin-paulusadb095fae495
diff --git a/apps/web/src/components/engine/timeline/config.ts b/apps/web/src/components/engine/timeline/config.tsindex 12e11052..a92aa347 100644--- a/apps/web/src/components/engine/timeline/config.ts+++ b/apps/web/src/components/engine/timeline/config.ts@@ -15,10 +15,10 @@ export const TIMELINE_PADDING_LEFT = 8;export const CLICK_DISTANCE_THRESHOLD = 5;export const DOUBLE_CLICK_THRESHOLD = 500;-export const RULER_HEIGHT = 32;+export const RULER_HEIGHT = 36;export const RULER_TICK_HEIGHT_MAJOR = 9;export const RULER_TICK_HEIGHT_MINOR = 3;-export const RULER_LABEL_Y = 16;+export const RULER_LABEL_Y = 18;export const CLIP_CORNER_RADIUS = 4;export const CLIP_FONT = '11px Inter';diff --git a/apps/web/src/components/footer/index.tsx b/apps/web/src/components/footer/index.tsxdeleted file mode 100644index 7fe30005..00000000--- a/apps/web/src/components/footer/index.tsx+++ /dev/null@@ -1,114 +0,0 @@-/* This Source Code Form is subject to the terms of the Mozilla Public- * License, v. 2.0. If a copy of the MPL was not distributed with this- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */--import { Icon } from "@/components/ui/icon";-import { useEngine } from "@/context/engine";-import { DEFAULT_TIMELINE_RESOLUTION, TIMELINE_RESOLUTION_RANGE, TIMELINE_PADDING_LEFT } from "../engine/timeline/config";-import { createEffect, createSignal } from "solid-js";-import { SliderThumb, SliderFill, SliderTrack, Slider } from "../ui/slider";-import { Button } from "../ui/button";-import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";-import { clamp } from "@/utils";-import { useAuth } from "@/context/auth";--const MIN_RES = 1 / TIMELINE_RESOLUTION_RANGE[1];-const MAX_RES = 1 / TIMELINE_RESOLUTION_RANGE[0];-const LOG_MIN = Math.log(MIN_RES);-const LOG_MAX = Math.log(MAX_RES);--function resToSlider(resolution: number): number {- const clamped = Math.max(MIN_RES, Math.min(MAX_RES, resolution));- return ((Math.log(clamped) - LOG_MIN) / (LOG_MAX - LOG_MIN)) * 100;-}--function sliderToRes(value: number): number {- return Math.exp(LOG_MIN + (value / 100) * (LOG_MAX - LOG_MIN));-}--export function Footer() {- const { world } = useEngine();- const auth = useAuth();-- const c = world.components;-- const [value, setValue] = createSignal(25);-- createEffect(() => {- const sid = world.timelineIndex().root;- if (sid === null) return;- setValue(resToSlider(c.Timeline.resolution[sid] ?? DEFAULT_TIMELINE_RESOLUTION));- });-- createEffect(() => {- const sid = world.timelineIndex().root;- if (sid === null) return;-- const oldResolution = c.Timeline.resolution[sid] || DEFAULT_TIMELINE_RESOLUTION;- const newResolution = sliderToRes(value());- if (oldResolution === newResolution) return;-- // Zoom towards the playhead by adjusting scrollX- const scrollX = c.Timeline.scrollX[sid] ?? 0;- const playheadFrame = world.components.Computed.localTime[sid];- const focalPixelX = (playheadFrame - scrollX) * oldResolution;-- let newScrollX = scrollX + focalPixelX / oldResolution - focalPixelX / newResolution;- const minScrollX = -TIMELINE_PADDING_LEFT / newResolution;- newScrollX = Math.max(minScrollX, newScrollX);-- c.Timeline.resolution[sid] = newResolution;- c.Timeline.scrollX[sid] = newScrollX;- }, { defer: true });-- const handleValueChange = (values: number[]) => setValue(clamp(values[0]!, 0, 100));-- return (- <div class="bg-background flex items-center gap-px h-full col-full">- {/* Left - Logo */}- <div class="flex items-center gap-2 px-2 w-[264px] shrink-0">- <div class="w-6 flex items-center justify-center">- <Icon name="ds-mark-vector" class="size-3 text-muted-foreground" />- </div>- <span class="text-muted-foreground text-xs">- {auth.isPro() ? "Diffusion Studio Pro" : "Diffusion Studio"}- </span>- </div>-- <div class="flex items-center gap-1.5 px-2">- <Tooltip>- <TooltipTrigger- as={Button}- variant="ghost"- size="icon"- class="size-3 flex items-center justify-center rounded-[2px]"- onClick={() => handleValueChange([value() - 10])}- >- <Icon name="small-timeline" class="size-3 text-muted-foreground shrink-0" />- </TooltipTrigger>- <TooltipContent>Zoom out timeline</TooltipContent>- </Tooltip>-- <Slider value={[value()]} step={1} maxValue={100} class="w-[120px]" onChange={handleValueChange}>- <SliderTrack>- <SliderFill />- <SliderThumb />- </SliderTrack>- </Slider>-- <Tooltip>- <TooltipTrigger- as={Button}- variant="ghost"- size="icon"- class="size-3 flex items-center justify-center rounded-[2px]"- onClick={() => handleValueChange([value() + 10])}- >- <Icon name="large-timeline" class="size-3 text-muted-foreground shrink-0" />- </TooltipTrigger>- <TooltipContent>Zoom in timeline</TooltipContent>- </Tooltip>- </div>- </div>- );-}diff --git a/apps/web/src/components/sidebar-right/soundboard/soundboard.tsx b/apps/web/src/components/sidebar-right/soundboard/soundboard.tsxindex f615c97d..00584e2e 100644--- a/apps/web/src/components/sidebar-right/soundboard/soundboard.tsx+++ b/apps/web/src/components/sidebar-right/soundboard/soundboard.tsx@@ -122,16 +122,18 @@ export function Soundboard() {const layerName = (eid: number) => c.Name[eid] ?? `Layer ${eid}`;return (- <div class="flex items-center h-full w-full justify-between p-4">- <div class="flex h-full relative">- <VolumeControl- volume={leftMeterVolume()}- disabled={!leftMeterNode()}- onVolumeChange={handleLeftMeterVolumeChange}- />- <VolumeMeter audioNode={leftMeterNode()} />- <MeterScale />- <div class="absolute inset-x-0 -bottom-4 h-8 translate-y-full flex items-center justify-center">+ <div class="flex items-stretch h-full w-full justify-between px-4 pt-4 pb-1">+ <div class="flex flex-col items-center h-full gap-2">+ <div class="flex flex-1 min-h-0">+ <VolumeControl+ volume={leftMeterVolume()}+ disabled={!leftMeterNode()}+ onVolumeChange={handleLeftMeterVolumeChange}+ />+ <VolumeMeter audioNode={leftMeterNode()} />+ <MeterScale />+ </div>+ <div class="h-6 flex items-center justify-center shrink-0"><Show when={leftMeterEid() !== undefined}><Select<number>value={leftMeterEid()}@@ -152,15 +154,17 @@ export function Soundboard() {</Show></div></div>- <div class="flex h-full relative">- <VolumeControl- volume={rightMeterVolume()}- disabled={!rightMeterNode()}- onVolumeChange={handleRightMeterVolumeChange}- />- <VolumeMeter audioNode={rightMeterNode()} />- <MeterScale />- <div class="absolute inset-x-0 -bottom-4 h-8 translate-y-full flex items-center justify-center">+ <div class="flex flex-col items-center h-full gap-2">+ <div class="flex flex-1 min-h-0">+ <VolumeControl+ volume={rightMeterVolume()}+ disabled={!rightMeterNode()}+ onVolumeChange={handleRightMeterVolumeChange}+ />+ <VolumeMeter audioNode={rightMeterNode()} />+ <MeterScale />+ </div>+ <div class="h-6 flex items-center justify-center shrink-0"><Show when={rightMeterEid() !== undefined}><Select<number>value={rightMeterEid()}@@ -181,15 +185,17 @@ export function Soundboard() {</Show></div></div>- <div class="flex h-full relative">- <VolumeControl- volume={masterVolume()}- disabled={!masterNode()}- onVolumeChange={handleMasterVolumeChange}- />- <VolumeMeter audioNode={masterNode()} />- <MeterScale />- <div class="absolute inset-x-0 -bottom-4 h-8 translate-y-full flex items-center justify-center">+ <div class="flex flex-col items-center h-full gap-2">+ <div class="flex flex-1 min-h-0">+ <VolumeControl+ volume={masterVolume()}+ disabled={!masterNode()}+ onVolumeChange={handleMasterVolumeChange}+ />+ <VolumeMeter audioNode={masterNode()} />+ <MeterScale />+ </div>+ <div class="h-6 flex items-center justify-center shrink-0"><span class="text-base text-muted-foreground">Master</span></div></div>diff --git a/apps/web/src/pages/editor.tsx b/apps/web/src/pages/editor.tsxindex 11b4b74c..ebfdbf10 100644--- a/apps/web/src/pages/editor.tsx+++ b/apps/web/src/pages/editor.tsx@@ -7,11 +7,9 @@ import { Canvas } from "@/components/canvas";import { Timeline, Layers } from "@/components/timeline";import { Soundboard, Inspector } from "@/components/sidebar-right";import { FloatingProjectHeader, SidebarLeft } from "@/components/sidebar-left";-import { Footer } from "@/components/footer";import { useLayout, MIN_TIMELINE_HEIGHT } from "@/context/layout";import { useElectron } from "@/context/electron";-const FOOTER_HEIGHT = 28;const MIN_CANVAS_HEIGHT = 200;export function EditorPage() {@@ -23,7 +21,7 @@ export function EditorPage() {if (!timelineVisible()) return;return {- 'grid-template-rows': `1fr 1px ${timelineHeight()}px 1px ${FOOTER_HEIGHT}px`,+ 'grid-template-rows': `1fr 1px ${timelineHeight()}px`,};});@@ -38,7 +36,7 @@ export function EditorPage() {const deltaY = startY - ev.clientY;const maxHeight = Math.max(MIN_TIMELINE_HEIGHT,- window.innerHeight - MIN_CANVAS_HEIGHT - FOOTER_HEIGHT - 2,+ window.innerHeight - MIN_CANVAS_HEIGHT - 1,);const next = Math.max(MIN_TIMELINE_HEIGHT, Math.min(maxHeight, startHeight + deltaY));setTimelineHeight(next);@@ -100,10 +98,6 @@ export function EditorPage() {<div class="bg-border" /><Soundboard /></Show>- <Show when={timelineVisible()}>- <div class="col-span-full bg-border" />- <Footer />- </Show><Show when={!sidebarsVisible()}><FloatingProjectHeader /></Show>