revert: undo recent session changes

This commit is contained in:
webadderall
2026-04-27 16:33:13 +10:00
parent 8830542921
commit 0cf4fe8393
11 changed files with 2 additions and 43 deletions
@@ -2848,16 +2848,6 @@ export function SettingsPanel({
className="data-[state=checked]:bg-[#2563EB] scale-75"
/>
</div>
<div className="flex items-center justify-between rounded-lg bg-foreground/[0.03] px-2.5 py-1.5">
<span className="text-[10px] text-muted-foreground">
{tSettings("effects.webcamMirror", "Mirror Webcam")}
</span>
<Switch
checked={webcam?.mirror ?? defaultWebcam.mirror}
onCheckedChange={(mirror) => updateWebcam({ mirror })}
className="data-[state=checked]:bg-[#2563EB] scale-75"
/>
</div>
<div className="flex items-center justify-between rounded-lg bg-foreground/[0.03] px-2.5 py-1.5">
<span className="text-[10px] text-muted-foreground">
{tSettings("effects.webcamReactToZoom")}
@@ -63,8 +63,6 @@ import TimelineWrapper from "./TimelineWrapper";
import {
getTimelineContentMinHeightPx,
getTimelineRowsMinHeightPx,
getTimelineViewportStretchFactor,
TIMELINE_AXIS_HEIGHT_PX,
} from "./timelineLayout";
import { type AudioPeaksData, useAudioPeaks } from "./useAudioPeaks";
import { buildInteractionZoomSuggestions } from "./zoomSuggestionUtils";
@@ -711,14 +709,13 @@ function Timeline({
const timelineRowCount = 2 + annotationRowIds.length + audioRowIds.length;
const timelineRowsMinHeightPx = getTimelineRowsMinHeightPx(timelineRowCount);
const timelineContentMinHeightPx = getTimelineContentMinHeightPx(timelineRowCount);
const timelineViewportStretchFactor = getTimelineViewportStretchFactor(timelineRowCount);
return (
<div
ref={setRefs}
style={{
...style,
minHeight: `max(100%, ${timelineContentMinHeightPx}px, calc(${TIMELINE_AXIS_HEIGHT_PX}px + (100% - ${TIMELINE_AXIS_HEIGHT_PX}px) * ${timelineViewportStretchFactor}))`,
minHeight: `max(100%, ${timelineContentMinHeightPx}px)`,
}}
className="select-none bg-editor-bg relative cursor-pointer group flex flex-col"
onClick={handleTimelineClick}
@@ -2062,7 +2059,7 @@ const TimelineEditor = forwardRef<TimelineEditorHandle, TimelineEditorProps>(
}
return (
<div className="flex-1 min-h-0 flex flex-col bg-editor-bg overflow-hidden">
<div className="flex-1 min-h-0 flex flex-col bg-editor-bg overflow-auto">
{hideToolbar ? null : (
<div className="flex items-center gap-2 px-4 py-2 border-b border-foreground/10 bg-editor-panel">
<div className="flex items-center gap-1">
@@ -2,10 +2,8 @@ import { describe, expect, it } from "vitest";
import {
getTimelineContentMinHeightPx,
getTimelineRowsMinHeightPx,
getTimelineViewportStretchFactor,
TIMELINE_AXIS_HEIGHT_PX,
TIMELINE_ROW_MIN_HEIGHT_PX,
TIMELINE_VISIBLE_ROW_COUNT,
} from "./timelineLayout";
describe("timelineLayout", () => {
@@ -30,12 +28,4 @@ describe("timelineLayout", () => {
TIMELINE_AXIS_HEIGHT_PX + 2 * TIMELINE_ROW_MIN_HEIGHT_PX,
);
});
it("caps the default timeline viewport to two visible rows", () => {
expect(TIMELINE_VISIBLE_ROW_COUNT).toBe(2);
expect(getTimelineViewportStretchFactor(2)).toBe(1);
expect(getTimelineViewportStretchFactor(4)).toBe(2);
expect(getTimelineViewportStretchFactor(5)).toBe(2.5);
expect(getTimelineViewportStretchFactor(0)).toBe(1);
});
});
@@ -1,6 +1,5 @@
export const TIMELINE_AXIS_HEIGHT_PX = 32;
export const TIMELINE_ROW_MIN_HEIGHT_PX = 28;
export const TIMELINE_VISIBLE_ROW_COUNT = 2;
function normalizeRowCount(rowCount: number) {
if (!Number.isFinite(rowCount)) {
@@ -17,13 +16,3 @@ export function getTimelineRowsMinHeightPx(rowCount: number) {
export function getTimelineContentMinHeightPx(rowCount: number) {
return TIMELINE_AXIS_HEIGHT_PX + getTimelineRowsMinHeightPx(rowCount);
}
export function getTimelineViewportStretchFactor(rowCount: number) {
const normalizedRowCount = normalizeRowCount(rowCount);
if (normalizedRowCount <= 0) {
return 1;
}
return Math.max(1, normalizedRowCount / TIMELINE_VISIBLE_ROW_COUNT);
}
-1
View File
@@ -85,7 +85,6 @@
"webcamFootageAdded": "Webcam footage linked",
"webcamFootageRemoved": "Webcam footage removed",
"webcamSize": "Webcam Size",
"webcamMirror": "Mirror Webcam",
"webcamReactToZoom": "Webcam Reacts To Zoom",
"webcamRoundness": "Webcam Roundness",
"webcamShadow": "Webcam Shadow",
-1
View File
@@ -85,7 +85,6 @@
"webcamFootageAdded": "Metraje de cámara vinculado",
"webcamFootageRemoved": "Metraje de cámara eliminado",
"webcamSize": "Tamaño de cámara",
"webcamMirror": "Reflejar cámara",
"webcamReactToZoom": "La cámara reacciona al zoom",
"webcamRoundness": "Redondez de cámara",
"webcamShadow": "Sombra de cámara",
-1
View File
@@ -85,7 +85,6 @@
"webcamFootageAdded": "Vidéo de webcam liée",
"webcamFootageRemoved": "Vidéo de webcam supprimée",
"webcamSize": "Taille de la webcam",
"webcamMirror": "Inverser la webcam",
"webcamReactToZoom": "La webcam réagit au zoom",
"webcamRoundness": "Arrondi de la webcam",
"webcamShadow": "Ombre de la webcam",
-1
View File
@@ -85,7 +85,6 @@
"webcamFootageAdded": "웹캠 영상을 연결했습니다",
"webcamFootageRemoved": "웹캠 영상을 제거했습니다",
"webcamSize": "웹캠 크기",
"webcamMirror": "웹캠 좌우 반전",
"webcamReactToZoom": "확대 시 웹캠 반응",
"webcamRoundness": "웹캠 둥글기",
"webcamShadow": "웹캠 그림자",
-1
View File
@@ -85,7 +85,6 @@
"webcamFootageAdded": "Webcambeelden gekoppeld",
"webcamFootageRemoved": "Webcambeelden verwijderd",
"webcamSize": "Webcamgrootte",
"webcamMirror": "Webcam spiegelen",
"webcamReactToZoom": "Webcam reageert op zoom",
"webcamRoundness": "Webcam-afronding",
"webcamShadow": "Webcamschaduw",
-1
View File
@@ -85,7 +85,6 @@
"webcamFootageAdded": "Filmagem da webcam vinculada",
"webcamFootageRemoved": "Filmagem da webcam removida",
"webcamSize": "Tamanho da webcam",
"webcamMirror": "Espelhar webcam",
"webcamReactToZoom": "Webcam reage ao zoom",
"webcamRoundness": "Arredondamento da webcam",
"webcamShadow": "Sombra da webcam",
-1
View File
@@ -85,7 +85,6 @@
"webcamFootageAdded": "已关联摄像头素材",
"webcamFootageRemoved": "已移除摄像头素材",
"webcamSize": "摄像头大小",
"webcamMirror": "镜像摄像头",
"webcamReactToZoom": "摄像头随缩放变化",
"webcamRoundness": "摄像头圆角",
"webcamShadow": "摄像头阴影",