authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 00:19:37-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 00:19:37-07:00
logc7e93f520bbd1ba4b795a5fb1aad14778aa1d047
treecae7df563493bc9ee3f3b607fad845c68d09892e
parent487d1766caba52579f07a3e5ebc6f276227e4382
signature Signed by PGP key B5690EEEBB952194

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


2 files changed, 1 insertions(+), 19 deletions(-)

apps/web/src/browser/BrowserDeviceToolbar.test.ts+1-12
......@@ -1,10 +1,7 @@
11import type { PreviewViewportSetting } from "@t3tools/contracts";
22import { describe, expect, it, vi } from "vite-plus/test";
33
4import {
5 commitViewportAndAspectRatio,
6 reconcileLockedAspectRatio,
7} from "./browserDeviceToolbarState";
4import { commitViewportAndAspectRatio } from "./browserDeviceToolbarState";
85
96describe("commitViewportAndAspectRatio", () => {
107 it("commits the aspect ratio only after the viewport succeeds", async () => {
......@@ -39,11 +36,3 @@ describe("commitViewportAndAspectRatio", () => {
3936 expect(onAspectRatioChange).not.toHaveBeenCalled();
4037 });
4138});
42
43describe("reconcileLockedAspectRatio", () => {
44 it("tracks external viewport ratios only while the lock remains active", () => {
45 expect(reconcileLockedAspectRatio(1.5, 16 / 9)).toBe(16 / 9);
46 expect(reconcileLockedAspectRatio(null, 16 / 9)).toBeNull();
47 expect(reconcileLockedAspectRatio(1.5, null)).toBeNull();
48 });
49});
apps/web/src/browser/browserDeviceToolbarState.ts-7
......@@ -1,12 +1,5 @@
11import type { PreviewViewportSetting } from "@t3tools/contracts";
22
3export function reconcileLockedAspectRatio(
4 current: number | null,
5 viewportAspectRatio: number | null,
6): number | null {
7 return current === null || viewportAspectRatio === null ? null : viewportAspectRatio;
8}
9
103export async function commitViewportAndAspectRatio(
114 setting: PreviewViewportSetting,
125 aspectRatio: number | null,