fix: conserver plein ecran et panneau metadonnees dans la visionneuse d'images (sidebar droite) + lanceur E2E Windows BUG-072
CI / lint (push) Successful in 2m1s
CI / security (push) Successful in 1m23s
CI / test (push) Successful in 4m27s
CI / build (push) Successful in 1m19s
CI / e2e (push) Successful in 17m45s

This commit is contained in:
2026-09-23 13:43:47 -04:00
parent 80852374a8
commit 8264e7ffae
16 changed files with 297 additions and 36 deletions
+28
View File
@@ -95,4 +95,32 @@ test.describe('Image viewer — zoom / pan / navigation (#108)', () => {
await page.locator('#content-area .image-nav-strip img.image-thumb').first().click();
await expect(page.locator('#content-area .image-title')).toBeVisible();
});
test('conserve le plein écran et le panneau métadonnées à la navigation (#BUG-072)', async ({ page }) => {
await login(page);
await openFile(page, 'TestVault', 'sample-image.png');
const container = page.locator('#content-area .image-viewer-container');
const metaPanel = page.locator('#content-area .image-meta-panel');
const title = page.locator('#content-area .image-title');
await expect(container).toBeVisible({ timeout: 10000 });
// Métadonnées : barre latérale à droite de l'image (pas sous la pellicule).
await page.locator('#content-area .image-btn-metadata').click();
await expect(metaPanel).toBeVisible();
const stageBox = await page.locator('#content-area .image-stage').boundingBox();
const metaBox = await metaPanel.boundingBox();
expect(metaBox.x).toBeGreaterThanOrEqual(stageBox.x + stageBox.width - 1);
// Plein écran activé.
await page.locator('#content-area .image-btn-lightbox').click();
await expect(container).toHaveClass(/lightbox/);
// Naviguer (flèche droite) : les deux états doivent survivre au re-render.
const titleBefore = await title.innerText();
await page.keyboard.press('ArrowRight');
await expect(container).toHaveClass(/lightbox/);
await expect(metaPanel).toBeVisible();
await expect(title).not.toHaveText(titleBefore);
});
});
+27
View File
@@ -93,6 +93,20 @@ test("image viewer exposes thumbnail navigation via /api/media thumb", () => {
assert.match(viewer, /siblings = \(res\.items \|\| \[\]\)/);
});
// BUG-072 — lightbox + metadata panel must survive ←/→ (and filmstrip) navigation.
test("image viewer persists lightbox + metadata state across navigation", () => {
assert.match(viewer, /const _imageViewerState = \{ lightbox: false, meta: false \}/);
assert.match(viewer, /let _imageViewerNavPending = false/);
// Both navigation paths flag the next render as an image→image navigation.
assert.match(viewer, /_imageViewerNavPending = true;\s*\n\s*openFile\(vault, siblings\[next\]\.path\)/);
assert.match(viewer, /_imageViewerNavPending = true;\s*\n\s*openFile\(vault, s\.path\)/);
// renderFile resets the state only when the next render is not a carried-over image.
assert.match(viewer, /if \(!data\.is_image \|\| !_imageViewerNavPending\)/);
// The persisted state drives the container class and the panel visibility.
assert.match(viewer, /classList\.toggle\("lightbox", _imageViewerState\.lightbox\)/);
assert.match(viewer, /metaPanel\.hidden = !_imageViewerState\.meta/);
});
// ── Static checks: CSS ─────────────────────────────────────────────────────
test("style.css defines the image viewer layout + lightbox", () => {
assert.match(css, /\.image-stage\s*\{/);
@@ -101,6 +115,19 @@ test("style.css defines the image viewer layout + lightbox", () => {
assert.match(css, /\.image-viewer-container\.lightbox\s*\{/);
});
// BUG-072 — metadata is a right-hand sidebar, not a strip under the filmstrip,
// and it stays visible in lightbox mode.
test("style.css lays the metadata panel out as a right sidebar", () => {
assert.match(css, /\.image-viewer-body\s*\{[\s\S]*?display:\s*flex/);
const meta = /\.image-meta-panel\s*\{([^}]*)\}/.exec(css);
assert.ok(meta, ".image-meta-panel rule not found");
assert.match(meta[1], /border-left:/);
assert.doesNotMatch(meta[1], /border-top:/);
// The lightbox hide rule targets the filmstrip only — not the metadata sidebar.
assert.match(css, /\.image-viewer-container\.lightbox \.image-nav-strip\s*\{/);
assert.doesNotMatch(css, /\.image-viewer-container\.lightbox[^{]*\.image-meta-panel/);
});
// ── Static checks: icon mapping + backend ──────────────────────────────────
test("utils.js maps image extensions to the Lucide 'image' icon", () => {
assert.match(utils, /"\.png": "image"/);