Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): floating preview resize holds its shape and ends when interrupted #36315

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/36315/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 121 additions and 0 deletions (loading 3).

x
0 of 4 viewed, 4 left
121 additions and 0 deletionsapps/web/src/components/preview/ThreadPreviewMiniPlayer.browser.test.tsxAdded
View file
@@ -0,0 +1,121 @@
+import "~/index.css";
+​
+import { RegistryContext } from "@effect/atom-react";
+import { scopeThreadRef } from "@t3tools/client-runtime/environment";
+import { type DeviceServiceState, type EnvironmentId, ThreadId } from "@t3tools/contracts";
+import { AsyncResult, Atom } from "effect/reactivity";
+import { useState } from "react";
+import { expect, it, vi } from "vite-plus/test";
+​
+import { act, render } from "../../../test/render";
+import {
+ type PreviewMiniPlayerSource,
+ selectThreadPreviewMiniPlayer,
+ usePreviewMiniPlayerStore,
+} from "../../previewMiniPlayerStore";
+import { appAtomRegistry } from "../../rpc/atomRegistry";
+import { deviceEnvironment } from "../../state/device";
+import { ChatCanvas } from "../chat/ChatCanvas";
+import { createChatCanvasStore } from "../chat/canvasStore";
+import { deviceStreamScreenAtom } from "../device/deviceStreamSession";
+import { ThreadPreviewMiniPlayer, useThreadPreviewCanvasSource } from "./ThreadPreviewMiniPlayer";
+​
+vi.mock(import("../device/DeviceStreamView"), () => ({
+ DeviceStreamView: (({ viewId }: { viewId: string }) => (
+ <div data-testid="stream" data-view-id={viewId} />
+ )) as never,
+}));
+​
+const threadRef = scopeThreadRef("env-1" as EnvironmentId, ThreadId.make("thread-1"));
+const phone: PreviewMiniPlayerSource = {