refactor(web): remove unused aspect ratio reconciler (#9994)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-05 00:19:37 -07:00
1 parent 487d1766ca
commit c7e93f520b
2 files changed
+1 -19

No files matched your search

@@ -1,10 +1,7 @@
import type { PreviewViewportSetting } from "@t3tools/contracts";
import { describe, expect, it, vi } from "vite-plus/test";
import {
commitViewportAndAspectRatio,
reconcileLockedAspectRatio,
} from "./browserDeviceToolbarState";
import { commitViewportAndAspectRatio } from "./browserDeviceToolbarState";
describe("commitViewportAndAspectRatio", () => {
it("commits the aspect ratio only after the viewport succeeds", async () => {
@@ -39,11 +36,3 @@ describe("commitViewportAndAspectRatio", () => {
expect(onAspectRatioChange).not.toHaveBeenCalled();
});
});
describe("reconcileLockedAspectRatio", () => {
it("tracks external viewport ratios only while the lock remains active", () => {
expect(reconcileLockedAspectRatio(1.5, 16 / 9)).toBe(16 / 9);
expect(reconcileLockedAspectRatio(null, 16 / 9)).toBeNull();
expect(reconcileLockedAspectRatio(1.5, null)).toBeNull();
});
});
@@ -1,12 +1,5 @@
import type { PreviewViewportSetting } from "@t3tools/contracts";
export function reconcileLockedAspectRatio(
current: number | null,
viewportAspectRatio: number | null,
): number | null {
return current === null || viewportAspectRatio === null ? null : viewportAspectRatio;
}
export async function commitViewportAndAspectRatio(
setting: PreviewViewportSetting,
aspectRatio: number | null,