fix(library): a server's frames stand at the shape the server stated, not at a guess
This commit is contained in:
@@ -228,8 +228,11 @@ await context.route('**/api/**', (route) => {
|
||||
id: a.id,
|
||||
name: a.name,
|
||||
takenAt: '2026-04-01T10:00:00.000Z',
|
||||
width: 6000,
|
||||
height: 4000,
|
||||
// Portrait, and deliberately unlike the square thumbnail above it: a wall
|
||||
// laid out off the server's own numbers and a wall laid out off the pictures
|
||||
// it is handed read as two different shapes here.
|
||||
width: 2000,
|
||||
height: 3000,
|
||||
size: 12345678,
|
||||
}));
|
||||
return send(200, { ok: true, page, size, total: rows.length, hasMore: items.length === size, items });
|
||||
@@ -382,6 +385,27 @@ step(
|
||||
`${firstLook.size} frames minted, ${await stored()} of ${await tiles()} tiles kept`
|
||||
);
|
||||
|
||||
// The shape a row is laid at. A row is justified to the wall's own width, which is
|
||||
// a sum of the shapes of the frames in it, and the wall takes those shapes off the
|
||||
// row Immich listed — `width` and `height` come with every frame — rather than
|
||||
// standing a whole node at one guessed rectangle and laying the shelf out again
|
||||
// picture by picture as the pictures arrive, which is every row below the one that
|
||||
// landed moving and the ruler's needle moving with them. The fixture says 2000x3000
|
||||
// where the thumbnail it hands out is square, so a wall measured off the pictures
|
||||
// reads as 1.00 here and a wall standing on the guess reads as 1.50.
|
||||
const statedAr = 2000 / 3000;
|
||||
const rowArs = await page.$$eval('.lib-tile', (els) =>
|
||||
els.map((e) => {
|
||||
const r = e.getBoundingClientRect();
|
||||
return r.height ? +(r.width / r.height).toFixed(2) : 0;
|
||||
})
|
||||
);
|
||||
step(
|
||||
'and a frame stands at the shape the server stated, not at the guess nor at the picture',
|
||||
rowArs.length > 0 && rowArs.every((ar) => Math.abs(ar - statedAr) < 0.1),
|
||||
`${rowArs.slice(0, 5).join(', ')} — the server states ${statedAr.toFixed(2)}`
|
||||
);
|
||||
|
||||
// The visit after — the page again, on the same wall. Every tile the visit before
|
||||
// drew is in this machine's store by now, so every tile is drawn out of it and the
|
||||
// backend is not asked for one of them a second time.
|
||||
@@ -447,7 +471,7 @@ step(
|
||||
// albums. It is probed before it is stored, so a key that does not answer is a
|
||||
// dialog still open on a node unchanged.
|
||||
await editDialog('Immich');
|
||||
await page.fill('[data-key="immich-newkey"]', 'not-the-key');
|
||||
await page.fill('[data-key="immich-key"]', 'not-the-key');
|
||||
await page.click('[data-key="immich-save"]');
|
||||
await page.waitForSelector('[data-key="immich-error"]', { timeout: 5_000 }).catch(() => {});
|
||||
step(
|
||||
@@ -456,7 +480,7 @@ step(
|
||||
(await page.$('[data-key="immich-modal"]')) !== null,
|
||||
await page.$eval('[data-key="immich-error"]', (e) => e.textContent).catch(() => 'no word said')
|
||||
);
|
||||
await page.fill('[data-key="immich-newkey"]', 'good-key');
|
||||
await page.fill('[data-key="immich-key"]', 'good-key');
|
||||
await page.click('[data-key="immich-save"]');
|
||||
await page.waitForSelector('[data-key="immich-modal"]', { state: 'detached', timeout: 10_000 }).catch(() => {});
|
||||
await settle('Immich', 5);
|
||||
|
||||
Reference in New Issue
Block a user