Skip to content

Commit

Permalink
set default window size
Browse files Browse the repository at this point in the history
  • Loading branch information
autologie committed Mar 11, 2025
1 parent 5111dd3 commit daa9f6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/frontend/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ declare global {
// https://developer.mozilla.org/en-US/docs/Web/API/DocumentPictureInPicture
documentPictureInPicture?: {
window: Window | null;
requestWindow: () => Promise<Window>;
requestWindow: (options?: {
width?: number;
height?: number;
preferInitialWindowPlacement?: boolean;
disallowReturnToOpener?: boolean;
}) => Promise<Window>;
};
// eslint-disable-next-line @typescript-eslint/naming-convention
Cypress: unknown;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export function usePiPWindow(
async function onPopOut() {
telemetry.track('User toggled log view', { new_state: 'floating' });

pipWindow.value = await window.documentPictureInPicture?.requestWindow();
pipWindow.value = await window.documentPictureInPicture?.requestWindow({
width: window.document.body.offsetWidth * 0.8,
height: 400,
});

showPip();
}
Expand Down

0 comments on commit daa9f6d

Please sign in to comment.