chore: formatting

This commit is contained in:
Maze Winther
2026-04-15 06:26:55 +02:00
parent eb28942dab
commit 8161de00e6
7 changed files with 357 additions and 342 deletions
@@ -254,9 +254,7 @@ export function Captions() {
<HugeiconsIcon icon={AlertCircleIcon} size={16} /> <HugeiconsIcon icon={AlertCircleIcon} size={16} />
</Button> </Button>
</TooltipTrigger> </TooltipTrigger>
<TooltipContent> <TooltipContent>{diagnostic.message}</TooltipContent>
{diagnostic.message}
</TooltipContent>
</Tooltip> </Tooltip>
))} ))}
<Button <Button
@@ -49,7 +49,9 @@ const BlurPreview = memo(
}; };
renderPreview(); renderPreview();
return effectPreviewService.onPreviewImageReady({ callback: renderPreview }); return effectPreviewService.onPreviewImageReady({
callback: renderPreview,
});
}, [blur.value]); }, [blur.value]);
return ( return (
@@ -186,7 +188,12 @@ export function BackgroundContent() {
return ( return (
<div className="flex flex-col"> <div className="flex flex-col">
<Section collapsible defaultOpen={true} sectionKey="background-blur" showTopBorder={false}> <Section
collapsible
defaultOpen={true}
sectionKey="background-blur"
showTopBorder={false}
>
<SectionHeader> <SectionHeader>
<SectionTitle>Blur</SectionTitle> <SectionTitle>Blur</SectionTitle>
</SectionHeader> </SectionHeader>
+6 -1
View File
@@ -47,7 +47,12 @@ const EMPTY_AUTHORS: MarbleAuthorList = {
}; };
function isMarbleConfigured() { function isMarbleConfigured() {
return !["", "placeholder", "build-placeholder", "your_workspace_key_here"].includes(key); return ![
"",
"placeholder",
"build-placeholder",
"your_workspace_key_here",
].includes(key);
} }
async function fetchFromMarble<T>({ async function fetchFromMarble<T>({
@@ -166,36 +166,47 @@ function FeedbackPopoverContent({ onClose }: { onClose: () => void }) {
</Form> </Form>
{entries.length > 0 && ( {entries.length > 0 && (
<div className="border-t"> <div className="border-t overflow-hidden">
<div className="px-3 py-2"> <div
<span className="text-xs font-medium text-muted-foreground"> className="max-h-52 overflow-y-auto divide-y"
Previous feedback style={{
</span> maskImage:
</div> "linear-gradient(to bottom, black 70%, transparent 100%)",
<div className="max-h-48 overflow-y-auto px-3 pb-3"> }}
<div className="flex flex-col gap-2"> >
{entries.map((entry) => ( {entries.map((entry) => (
<FeedbackEntryItem key={entry.id} entry={entry} /> <FeedbackEntryItem key={entry.id} entry={entry} />
))} ))}
</div> </div>
</div> </div>
</div>
)} )}
</div> </div>
); );
} }
function FeedbackEntryItem({ entry }: { entry: FeedbackEntry }) { function relativeDate(iso: string): string {
const formatted = new Date(entry.createdAt).toLocaleDateString(undefined, { const diff = Date.now() - new Date(iso).getTime();
const mins = Math.floor(diff / 60_000);
if (mins < 1) return "just now";
if (mins < 60) return `${mins}m ago`;
const hrs = Math.floor(mins / 60);
if (hrs < 24) return `${hrs}h ago`;
const days = Math.floor(hrs / 24);
if (days < 7) return `${days}d ago`;
return new Date(iso).toLocaleDateString(undefined, {
month: "short", month: "short",
day: "numeric", day: "numeric",
}); });
}
function FeedbackEntryItem({ entry }: { entry: FeedbackEntry }) {
return ( return (
<div className="rounded-md border px-2.5 py-2"> <div className="px-3 py-2.5">
<p className="text-sm whitespace-pre-wrap break-words">{entry.message}</p> <p className="text-sm text-muted-foreground leading-snug whitespace-pre-wrap break-words">
<span className="mt-1 block text-xs text-muted-foreground"> {entry.message}
{formatted} </p>
<span className="mt-1 block text-[11px] text-muted-foreground/50">
{relativeDate(entry.createdAt)}
</span> </span>
</div> </div>
); );
@@ -1,7 +1,5 @@
import { describe, expect, test } from "bun:test"; import { describe, expect, test } from "bun:test";
import { import { DEFAULT_BACKGROUND_BLUR_INTENSITY } from "@/lib/background/blur";
DEFAULT_BACKGROUND_BLUR_INTENSITY,
} from "@/lib/background/blur";
import { DEFAULT_BACKGROUND_COLOR } from "@/lib/background/color"; import { DEFAULT_BACKGROUND_COLOR } from "@/lib/background/color";
import { DEFAULT_CANVAS_SIZE } from "@/lib/canvas/sizes"; import { DEFAULT_CANVAS_SIZE } from "@/lib/canvas/sizes";
const DEFAULT_FPS = 30; const DEFAULT_FPS = 30;
@@ -135,9 +133,7 @@ describe("V1 to V2 Migration", () => {
const settings = result.project.settings as Record<string, unknown>; const settings = result.project.settings as Record<string, unknown>;
const background = settings.background as Record<string, unknown>; const background = settings.background as Record<string, unknown>;
expect(background.blurIntensity).toBe( expect(background.blurIntensity).toBe(DEFAULT_BACKGROUND_BLUR_INTENSITY);
DEFAULT_BACKGROUND_BLUR_INTENSITY,
);
}); });
test("preserves currentSceneId", async () => { test("preserves currentSceneId", async () => {
@@ -1,6 +1,4 @@
import { import { DEFAULT_BACKGROUND_BLUR_INTENSITY } from "@/lib/background/blur";
DEFAULT_BACKGROUND_BLUR_INTENSITY,
} from "@/lib/background/blur";
import { DEFAULT_BACKGROUND_COLOR } from "@/lib/background/color"; import { DEFAULT_BACKGROUND_COLOR } from "@/lib/background/color";
import { DEFAULT_CANVAS_SIZE } from "@/lib/canvas/sizes"; import { DEFAULT_CANVAS_SIZE } from "@/lib/canvas/sizes";
const DEFAULT_FPS = 30; const DEFAULT_FPS = 30;