Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion apps/desktop/e2e/attachment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,19 @@ test('a mixed attachment send has the Astryx message hierarchy', async ({ window
expect(imageBox!.y + imageBox!.height).toBeLessThanOrEqual(bubbleBox!.y);

await image.getByRole('button').click();
await expect(page.locator('.astryx-lightbox')).toBeVisible();
const lightbox = page.locator('.astryx-lightbox');
await expect(lightbox).toBeVisible();

// The lightbox close button lands inside the titlebar's drag rect, where the
// OS eats clicks unless the modal is `no-drag`. The overlap is asserted first —
// without it the app-region check would guard nothing.
const titlebar = page.locator('.maka-window-titlebar');
const [titlebarBox, lightboxBox] = await Promise.all([titlebar.boundingBox(), lightbox.boundingBox()]);
expect(titlebarBox).not.toBeNull();
expect(lightboxBox).not.toBeNull();
expect(lightboxBox!.y).toBeLessThan(titlebarBox!.y + titlebarBox!.height);
await expect(lightbox).toHaveCSS('-webkit-app-region', 'no-drag');

await page.keyboard.press('Escape');
await expect(page.locator('.astryx-lightbox')).not.toBeVisible();
});
7 changes: 7 additions & 0 deletions apps/desktop/src/renderer/styles/shell-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@
-webkit-app-region: drag;
}

/* Drag regions are hit-tested from element rects, and the top layer is invisible
to that pass: a `showModal()` dialog paints over the titlebar, but its controls
inside the titlebar rect still reach the OS as window drags. */
dialog:modal {
-webkit-app-region: no-drag;
}

.maka-shell-topbar-rail {
display: flex;
align-items: center;
Expand Down
Loading