OpenReel Video - Professional browser-based video editor. Open source CapCut alternative. 100% browser-based, no installation, no cloud uploads, no watermarks.
TypeScript
feat(timeline): add large/small track height toggle
lvalicsbe1cc9ab3ae4
diff --git a/apps/web/src/components/editor/Timeline.tsx b/apps/web/src/components/editor/Timeline.tsxindex 3d3a6b2c..1d818bbe 100644--- a/apps/web/src/components/editor/Timeline.tsx+++ b/apps/web/src/components/editor/Timeline.tsx@@ -22,6 +22,8 @@ import {Plus,ChevronDown as ChevronDownIcon,Magnet,+ Rows3,+ Rows2,} from "lucide-react";import { useProjectStore } from "../../stores/project-store";import { useTimelineStore } from "../../stores/timeline-store";@@ -90,6 +92,8 @@ export const Timeline: React.FC = () => {setViewportDimensions,zoomIn,zoomOut,+ trackHeight,+ setTrackHeight,setTrackHeightById,getTrackHeight,} = useTimelineStore();@@ -860,6 +864,30 @@ export const Timeline: React.FC = () => {</div><div className="flex items-center gap-2">+ <div className="flex items-center bg-background-tertiary rounded-lg border border-border overflow-hidden">+ <button+ onClick={() => { setTrackHeight(80); useTimelineStore.setState({ trackHeights: {} }); }}+ className={`w-8 h-8 flex items-center justify-center transition-colors border-r border-border ${+ trackHeight >= 60+ ? "text-primary bg-primary/10"+ : "text-text-secondary hover:text-text-primary hover:bg-background-elevated"+ }`}+ title="Large tracks"+ >+ <Rows3 size={14} />+ </button>+ <button+ onClick={() => { setTrackHeight(50); useTimelineStore.setState({ trackHeights: {} }); }}+ className={`w-8 h-8 flex items-center justify-center transition-colors ${+ trackHeight < 60+ ? "text-primary bg-primary/10"+ : "text-text-secondary hover:text-text-primary hover:bg-background-elevated"+ }`}+ title="Small tracks"+ >+ <Rows2 size={14} />+ </button>+ </div><div className="flex items-center bg-background-tertiary rounded-lg border border-border overflow-hidden"><buttononClick={zoomOut}diff --git a/apps/web/src/components/editor/timeline/TrackHeader.tsx b/apps/web/src/components/editor/timeline/TrackHeader.tsxindex bf40e0f8..e37e875f 100644--- a/apps/web/src/components/editor/timeline/TrackHeader.tsx+++ b/apps/web/src/components/editor/timeline/TrackHeader.tsx@@ -29,7 +29,7 @@ export const TrackHeader: React.FC<TrackHeaderProps> = ({keyframeCount = 0,}) => {const { lockTrack, hideTrack, muteTrack, removeTrack } = useProjectStore();- const { isTrackExpanded, toggleTrackExpanded } = useTimelineStore();+ const { isTrackExpanded, toggleTrackExpanded, getTrackHeight } = useTimelineStore();const isExpanded = isTrackExpanded(track.id);const trackInfo = getTrackInfo(track, index);@@ -52,7 +52,8 @@ export const TrackHeader: React.FC<TrackHeaderProps> = ({onDragStart={(e) => onDragStart(e, track.id)}onDragOver={onDragOver}onDrop={(e) => onDrop(e, track.id)}- className={`h-20 border-b border-border flex flex-col justify-between py-2 px-3 relative group transition-colors cursor-grab active:cursor-grabbing ${+ style={{ height: getTrackHeight(track.id) }}+ className={`border-b border-border flex flex-col justify-between py-2 px-3 relative group transition-colors cursor-grab active:cursor-grabbing ${track.hidden ? "opacity-50" : ""} ${track.locked ? "bg-background-secondary/50" : "bg-background-tertiary"