release: v0.12.0 (#520)

Forty-one commits since v0.11.0. See CHANGELOG.md for the full list and the upgrade notes.
This commit is contained in:
Ralksta
2026-08-23 23:18:14 +02:00
committed by GitHub
parent 2f546f440d
commit 10ec68f493
119 changed files with 6888 additions and 758 deletions

View File

@@ -0,0 +1,64 @@
import { test, expect } from '@playwright/test';
/**
* `f` is only worth having if it reaches the real Fullscreen API — a CSS
* overlay already covered the viewport before this, and the whole point is the
* browser chrome that CSS cannot touch. So these assert on
* `document.fullscreenElement`, not on a class name.
*/
test.describe('Lightbox fullscreen', () => {
const GRID_URL = '/deutschland/kloster-chorin';
/** Open the first photo and wait for the viewer. */
async function openLightbox(page: import('@playwright/test').Page) {
await page.goto(GRID_URL);
const item = page.locator('.photo-grid .photo-grid__item').first();
await item.scrollIntoViewIfNeeded();
await item.click();
await expect(page.getByRole('dialog')).toBeVisible();
}
const fullscreenTag = (page: import('@playwright/test').Page) =>
page.evaluate(() => document.fullscreenElement?.tagName ?? null);
test('f enters fullscreen and f leaves it again', async ({ page }) => {
await openLightbox(page);
expect(await fullscreenTag(page)).toBeNull();
await page.keyboard.press('f');
await expect.poll(() => fullscreenTag(page)).toBe('DIV');
await page.keyboard.press('f');
await expect.poll(() => fullscreenTag(page)).toBeNull();
});
test('Esc leaves fullscreen before it closes the viewer', async ({ page }) => {
await openLightbox(page);
await page.keyboard.press('f');
await expect.poll(() => fullscreenTag(page)).toBe('DIV');
await page.keyboard.press('Escape');
await expect.poll(() => fullscreenTag(page)).toBeNull();
// One layer at a time: the viewer is still open.
await expect(page.getByRole('dialog')).toBeVisible();
await page.keyboard.press('Escape');
await expect(page.getByRole('dialog')).toHaveCount(0);
});
test('closing the viewer does not strand the page in fullscreen', async ({ page }) => {
await openLightbox(page);
await page.keyboard.press('f');
await expect.poll(() => fullscreenTag(page)).toBe('DIV');
await page.getByRole('button', { name: /close/i }).click();
await expect(page.getByRole('dialog')).toHaveCount(0);
await expect.poll(() => fullscreenTag(page)).toBeNull();
});
test('the shortcut panel advertises the key', async ({ page }) => {
await openLightbox(page);
await page.keyboard.press('?');
await expect(page.getByText(/fullscreen|vollbild/i).first()).toBeVisible();
});
});

View File

@@ -0,0 +1,55 @@
import { test, expect } from '@playwright/test';
/**
* The shortcut panel is deliberately unadvertised: no button, no first-run
* nudge. These pin both halves of that — the keys work, and nothing is on
* screen until one of them is pressed.
*/
test.describe('Lightbox shortcuts', () => {
const GRID_URL = '/deutschland/kloster-chorin';
async function openLightbox(page: import('@playwright/test').Page) {
await page.goto(GRID_URL);
const item = page.locator('.photo-grid .photo-grid__item').first();
await item.scrollIntoViewIfNeeded();
await item.click();
await expect(page.getByRole('dialog')).toBeVisible();
}
const panel = (page: import('@playwright/test').Page) => page.locator('#lightbox-shortcuts');
test('nothing advertises the panel', async ({ page }) => {
await openLightbox(page);
await expect(panel(page)).toHaveCount(0);
// The old trigger and its one-time nudge are gone for good.
await expect(page.getByRole('button', { name: /keyboard shortcuts/i })).toHaveCount(0);
await expect(page.getByText(/press \? for keyboard shortcuts/i)).toHaveCount(0);
});
test('? opens it and closes it again', async ({ page }) => {
await openLightbox(page);
await page.keyboard.press('?');
await expect(panel(page)).toBeVisible();
await page.keyboard.press('?');
await expect(panel(page)).toHaveCount(0);
});
test('h opens it too', async ({ page }) => {
await openLightbox(page);
await page.keyboard.press('h');
await expect(panel(page)).toBeVisible();
});
test('Esc closes the panel before the viewer', async ({ page }) => {
await openLightbox(page);
await page.keyboard.press('h');
await expect(panel(page)).toBeVisible();
await page.keyboard.press('Escape');
await expect(panel(page)).toHaveCount(0);
await expect(page.getByRole('dialog')).toBeVisible();
await page.keyboard.press('Escape');
await expect(page.getByRole('dialog')).toHaveCount(0);
});
});