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
4 changes: 2 additions & 2 deletions bins/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12546,8 +12546,8 @@ <h2 id="drawersTitle">Your drawers</h2>
(binDividers, which asks the holes as holesIn does), with the new-bin settings at a
1x1 as these are. A bin with finger slots ticked asks the holes of its kept plan
(insertPlanOf), as binDividers would ask them of the slots all over again.
Kept by the settings that asked, as fingerPlan is: a refresh asks this of each bin ten
times over, for its key, its name, Checks and its compartments, and 63 bins with
Kept by the settings that asked, as fingerPlan is: a refresh asks this of each bin about
fifteen times over, for its key, its name, Checks and its compartments, and 63 bins with
removable plates spent 60 to 150 ms of an 85 to 180 ms refresh in dividersBuilt with
finger slots ticked, about three quarters of it, and 20 to 45 of 35 to 85 without;
kept, the whole refresh takes 12 to 50. Everything it goes by is binCfg's, and whether
Expand Down
4 changes: 2 additions & 2 deletions src/bins/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ const binCfg = (b) => ({ u: b.u, v: b.v, hUnits: b.hUnits, wall: b.wall,
(binDividers, which asks the holes as holesIn does), with the new-bin settings at a
1x1 as these are. A bin with finger slots ticked asks the holes of its kept plan
(insertPlanOf), as binDividers would ask them of the slots all over again.
Kept by the settings that asked, as fingerPlan is: a refresh asks this of each bin ten
times over, for its key, its name, Checks and its compartments, and 63 bins with
Kept by the settings that asked, as fingerPlan is: a refresh asks this of each bin about
fifteen times over, for its key, its name, Checks and its compartments, and 63 bins with
removable plates spent 60 to 150 ms of an 85 to 180 ms refresh in dividersBuilt with
finger slots ticked, about three quarters of it, and 20 to 45 of 35 to 85 without;
kept, the whole refresh takes 12 to 50. Everything it goes by is binCfg's, and whether
Expand Down
2 changes: 1 addition & 1 deletion sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
load from this site, and the app's icons and manifest, as paths from the root. VERSION
is a hash of all of those files, names and bytes, and of this script as it is served,
FILES filled in and everything else but VERSION itself. */
const VERSION = "f14226fad998";
const VERSION = "adc911090779";
const FILES = [
"./",
"bins/",
Expand Down
26 changes: 14 additions & 12 deletions test/bin-audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3596,13 +3596,13 @@ console.log('\nfinger slots');
if (shelved >= built.divY) faults.push(`fixture: ${shelved} plates along in front of the shelf, no fewer`);
/* No lip, so counted as the bin with none, and Checks puts the count down to something
it has: never to the lip's notches. With its lip, the same bin is counted by their
rule. The rows asking for holes build none, as their holes give way to the back slot,
so each is the bin with no lip and no holes as well. Counted as asking for holes with
no lip, as before #58-SF-C was fixed, such a bin laid them out with more room than it
gives them: a row fitted, held the back wall too low for a slot and kept a plate in
front of a shelf that is not built. Held to itself counted without the lip's rule
(lipTaken), these two rows were held to what dividersBuilt asks of itself, and could
not fail. */
rule. The rows asking for holes build none, as their holes give way to the back slot
(and on the 2.5 x 0.5 to the front one too), so each is the bin with no lip and no
holes as well. Counted as asking for holes with no lip, as before #58-SF-C was fixed,
such a bin laid them out with more room than it gives them: a row fitted, held the
back wall too low for a slot and kept a plate in front of a shelf that is not built.
Held to itself counted without the lip's rule (lipTaken), these two rows were held to
what dividersBuilt asks of itself, and could not fail. */
const lipless = dividersBuilt(Object.assign({}, cs, { lip: false, insert: 0 }));
if (built.divX !== lipless.divX || built.divY !== lipless.divY)
faults.push(`${built.divX} across and ${built.divY} along, where ${lipless.divX} and ${lipless.divY} fit with no lip`);
Expand Down Expand Up @@ -3630,10 +3630,12 @@ console.log('\nfinger slots');
it, and dividersBuilt builds those. Checks had a reason of its own for a bin that broke
this, 'slot', which no bin reached, and which is gone; were one to break it, Checks
would put its plates down to the lip it does not have, and so this asks that too. Thin
walls and thin plates, where the lip binds, both counts at what fits without it and
one of them at less, slots on one wall, two and all four, plain and with a scoop and a
note raised on a shelf; and a hundred or more where the lip would hold the plates, or
the grid has stopped aiming at it. */
walls and thin plates, where the lip binds, both counts at what fits without it, one
of them at less, one of them at one more, and 40 each way: Checks gives a reason only
for a count put down, so without the counts past what fits, a reason asked of the
wrong bin passed here. Slots on one wall, two and all four, plain and with a scoop and
a note raised on a shelf; and a hundred or more where the lip would hold the plates,
or the grid has stopped aiming at it. */
{
let n = 0, marked = 0, bound = 0;
const off = [];
Expand All @@ -3644,7 +3646,7 @@ console.log('\nfinger slots');
fingerSlots: Object.fromEntries([...s].map((k) => [k, true])) }, extra);
const fit = (axis) => railedLimit(Object.assign({ lipTaken: true }, base), axis).most;
const fx = fit('x'), fy = fit('y');
for (const [divX, divY] of [[fx, fy], [fx, 1], [1, fy], [fx, 0], [0, fy]]) {
for (const [divX, divY] of [[fx, fy], [fx, 1], [1, fy], [fx, 0], [0, fy], [fx + 1, 0], [0, fy + 1], [40, 40]]) {
const cfg = Object.assign({}, base, { divX, divY }), by = countedAs(cfg);
n++;
if (!by.lipTaken) continue;
Expand Down
37 changes: 23 additions & 14 deletions test/ui/estimate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ test.afterEach(async ({ page }) => {
});

/* A bins layout small enough to be quick and big enough to need several plates: a
4 × 4 drawer of 1×1 bins on a 120 mm bed, which takes four bins a plate. */
async function binsJob(page) {
page.__errors = await H.openBins(page);
4 × 4 drawer of 1×1 bins on a 120 mm bed, which takes four bins a plate. `url` for
the page served rather than opened from disk. */
async function binsJob(page, url) {
page.__errors = await H.openBins(page, url);
await H.setField(page, 'drawerW', 168);
await H.setField(page, 'drawerD', 168);
await H.setField(page, 'bedPreset', 'custom');
Expand Down Expand Up @@ -129,18 +130,26 @@ test.describe('the price', () => {
expect(t, 'money left behind after the price was cleared').not.toMatch(MONEY);
});

/* Over HTTP, as the next test is. From file:// this failed once under load and passed
when run again; the likeliest cause is the one serveRoot describes, the browser now
and then losing from file:// what a page stored before it. */
test('a price survives a reload, and is kept under one key as JSON', async ({ page }) => {
await binsJob(page);
await H.setField(page, 'filPrice', '18.99');
await H.setField(page, 'filSym', '€');
expect(JSON.parse(await page.evaluate((k) => localStorage.getItem(k), KEY)))
.toEqual({ price: 18.99, sym: '€', speed: 'auto' });
await page.reload();
await page.waitForFunction(() => !!document.getElementById('fillmap'));
await page.waitForTimeout(400);
await expect(page.locator('#filPrice')).toHaveValue('18.99');
await expect(page.locator('#filSym')).toHaveValue('€');
await expect(page.locator('#totals')).toContainText(/about €\d+\.\d\d/);
const srv = await H.serveRoot();
try {
await binsJob(page, srv.base + 'bins/');
await H.setField(page, 'filPrice', '18.99');
await H.setField(page, 'filSym', '€');
expect(JSON.parse(await page.evaluate((k) => localStorage.getItem(k), KEY)))
.toEqual({ price: 18.99, sym: '€', speed: 'auto' });
await page.reload();
await page.waitForFunction(() => !!document.getElementById('fillmap'));
await page.waitForTimeout(400);
await expect(page.locator('#filPrice')).toHaveValue('18.99');
await expect(page.locator('#filSym')).toHaveValue('€');
await expect(page.locator('#totals')).toContainText(/about €\d+\.\d\d/);
} finally {
await srv.close();
}
});

/* One key, both tools: a price typed on the baseplates page is the bins page's price
Expand Down
Loading