fix CodeRabbit comments

This commit is contained in:
Alan Trebugeais
2026-05-08 15:28:44 +02:00
parent c65b811630
commit c87daa5e00
2 changed files with 13 additions and 9 deletions
@@ -28,8 +28,8 @@ export default function TimelineAxis({ videoDurationMs, currentTimeMs }: Timelin
const markerTimes = new Set<number>();
const firstMarker = Math.ceil(visibleStart / intervalMs) * intervalMs;
for (let time = firstMarker; time <= maxTime; time += intervalMs) {
if (time >= visibleStart && time <= visibleEnd) markerTimes.add(Math.round(time));
for (let time = firstMarker; time <= visibleEnd; time += intervalMs) {
markerTimes.add(Math.round(time));
}
if (visibleStart <= maxTime) markerTimes.add(Math.round(visibleStart));
@@ -41,11 +41,9 @@ export default function TimelineAxis({ videoDurationMs, currentTimeMs }: Timelin
const minorTicks: number[] = [];
const minorInterval = intervalMs / 5;
for (let time = firstMarker; time <= maxTime; time += minorInterval) {
if (time >= visibleStart && time <= visibleEnd) {
const isMajor = Math.abs(time % intervalMs) < 1;
if (!isMajor) minorTicks.push(time);
}
for (let time = firstMarker; time <= visibleEnd; time += minorInterval) {
const isMajor = Math.abs(time % intervalMs) < 1;
if (!isMajor) minorTicks.push(time);
}
return {
@@ -80,7 +78,7 @@ export default function TimelineAxis({ videoDurationMs, currentTimeMs }: Timelin
flexDirection: "row",
alignItems: "flex-end",
[sideProperty]: `${offset}px`,
transform: "translateX(-50%)",
transform: direction === "rtl" ? "translateX(50%)" : "translateX(-50%)",
};
return (
@@ -118,7 +118,13 @@ export default function TimelineToolbar({
</DropdownMenuContent>
</DropdownMenu>
<div className="w-[1px] h-4 bg-foreground/10" />
<Button variant="ghost" size="sm" onClick={() => onOpenCropEditor?.()} className="h-7 px-2 text-xs text-muted-foreground hover:text-foreground hover:bg-foreground/10 transition-all gap-1.5">
<Button
variant="ghost"
size="sm"
onClick={onOpenCropEditor}
disabled={!onOpenCropEditor}
className="h-7 px-2 text-xs text-muted-foreground hover:text-foreground hover:bg-foreground/10 transition-all gap-1.5"
>
<Crop className="w-3.5 h-3.5" />
<span className="font-medium">{cropLabel}</span>
{isCropped ? <span className="h-1.5 w-1.5 rounded-full bg-[#2563EB]" /> : null}