Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): make floating browser previews easier to drag #15499

Closedelliptic1(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/15499/headopened View on GitHub

Showing 8 changed files with 79 additions and 1 deletion (loading 5).

x
0 of 8 viewed, 8 left
3 additions and 1 deletionapps/web/src/components/chat/ChatCanvas.tsxModified
View file
@@ -53,7 +53,9 @@
current.position?.x === next.position?.x &&
current.position?.y === next.position?.y &&
current.source.width === next.source.width &&
- current.source.height === next.source.height
+ current.source.height === next.source.height &&
+ current.headerHeight === next.headerHeight &&
+ current.overlay === next.overlay
? current
: next,
);
63 additions and 0 deletionsapps/web/src/components/chat/chatCanvasLayout.test.tsModified
View file
@@ -23,6 +23,24 @@
};
​
describe("chat canvas layout", () => {
+ it("preserves the browser header while lifting a resized preview above the composer", () => {
+ for (const width of [480, 800, 1100]) {
+ const result = resolve(1344, {
+ ...preview,
+ width,
+ headerHeight: 36,
+ lastInteraction: "resize",
+ position: { x: 1332 - width, y: 888 - Math.round(width / 1.6) - 36 },
+ });
+ const frame = result.frame!;
+ expect(frame.height).toBe(Math.round(frame.width / 1.6) + 36);