From 9ab5eb25ea997cdb03068e952ea9bd8549704d26 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 07:45:17 +0000 Subject: [PATCH 1/8] Hold every slotted row in the audit to the bin with no lip and no holes The bin audit's "counted as with no lip" check gave the two slotted rows that ask for holes the bin counted without the lip's rule (lipTaken), which is what dividersBuilt asks itself, so it could not fail on them. Every row is now held to the same bin with no lip and no holes: those two build no holes, as theirs give way to the back slot. It passes here, and on eb32f00 it fails on exactly those two rows, the #58-SF-C bins (1 plate along where 2 fit, and 1 where 4 do), where the old form passed. (#58 nit 1) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- test/bin-audit.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/bin-audit.js b/test/bin-audit.js index e474840..8795fe6 100644 --- a/test/bin-audit.js +++ b/test/bin-audit.js @@ -3593,9 +3593,14 @@ 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. Asked for holes, a bin asked for no lip lays them out with more room, so it is - another bin: there it is this one counted without the lip's rule (lipTaken). */ - const lipless = dividersBuilt(Object.assign({}, cs, cs.insert ? { lipTaken: true } : { lip: false })); + 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. */ + 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`); const why = dividersWhy(cs); From 017b222ce9115a25c7f6c637efecb37cddcd8fd6 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 07:47:25 +0000 Subject: [PATCH 2/8] Drop the Checks reason no slotted bin can reach dividersWhy had 'slot', with its own wording in Checks, for a bin with a finger slot between the plates its lip allows but none between the plates without it, built with the lip's count all the same. No bin can be: the lip stops only plates that would stand under 6 mm apart, and keeps them under 9, where a finger slot needs 15 mm between two plates' rails, so the walls those plates meet have no slot with either count; and all else a slot is settled by is the same with either. None of 900,000 random bins nor 1,020,600 aimed at the lip reached it. The branch and its wording go, dividersWhy's comment and ENGINE.md say why, and a new audit row, "counted with no lip", holds 1,296 slotted bins counted without their lip (160 where the lip would hold their plates) to being built with that count and never put down to the lip; with dividersBuilt made to keep the lip's count where the other leaves a single slot, it finds 112 wrong. (#58 O4) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- docs/ENGINE.md | 4 +++- src/bins/bin.js | 23 ++++++++++++++++------- src/bins/ui.js | 7 ------- test/bin-audit.js | 44 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 62 insertions(+), 16 deletions(-) diff --git a/docs/ENGINE.md b/docs/ENGINE.md index 9e2d245..c41d9bd 100644 --- a/docs/ENGINE.md +++ b/docs/ENGINE.md @@ -322,7 +322,9 @@ construction plus overlapping shells, so none of §2 is reachable. Keep it that plate across a front one. The lip's rule only binds on plates packed a few millimetres apart, with no room for a slot between them, so the walls their ends meet have no slot either way, and the slots - in the others stay where they were, as do the rails beside them. + in the others stay where they were, as do the rails beside them. So a bin with a slot + between the plates its lip allows has one between the plates without its lip as well, + and is built with those: Checks never has a slot to blame for fewer plates. `fingerSlots` hands its answer to `buildBin` and `insertPlan` (`floor`), so the page counts the holes that are built, and to `binVolume`, which weighs the bin from it: no lip, the dips (`area`, the mean of the wall's two faces, times the wall) off the walls, diff --git a/src/bins/bin.js b/src/bins/bin.js index 6d10a90..95298e4 100644 --- a/src/bins/bin.js +++ b/src/bins/bin.js @@ -2622,11 +2622,21 @@ function binDividers(cfg) { and 'crossCorners' when both would. It was asked of as many as the rails allow, and named the plates' keep wherever both went wrong there, whichever stopped one more. A bin with a finger slot built in it has no lip, and is said by the rules it is counted - by without one (countedAs), never the lip's; 'slot' where it is built with the count - its lip would allow all the same, because between more plates no slot would be built, - and it would have its lip. That is a fallback no bin swept has reached: the lip's rule - binds only on plates packed too close for a slot between them, so more of them move no - slot (dividersBuilt). + by without one (countedAs), never the lip's, and it is always built with that count. + The lip stops only plates that would stand under 6 mm apart, so the ones it keeps + stand under 9: its rule and its corners bind where the last plate stands within half + a plate, its clearance and 3.4 mm of the cavity's wall, and the rails let plates stand + that close only where half a plate and its clearance are under 2.2 mm. A finger slot + needs 15 mm between two plates' rails, or a rail and the wall's corner, so the walls + those plates meet have no slot with the lip's count or without it. And all else a + slot is settled by is the same with either: the plates the other way, unless the lip + stopped those as well, which leaves no wall a slot; the scoop; and the shelf, as no + note prints between plates that close. So where a slot is built between + the plates the lip allows, one is built between the plates without it, and the bin is + built with those (dividersBuilt). This had 'slot' for a bin built with the lip's count + all the same, as between more plates no slot would be built, and none of 900,000 + random bins nor of a million aimed at the lip reached it; the audit holds bins to + that ("counted with no lip"). Null where it is built with all it asks for, and where it has no rails at all: a carved shape, a solid block or a floor that fills the bin (plateLayout's railed), or holes across its floor (binDividers). Those are built with none whatever they ask for, @@ -2635,13 +2645,12 @@ function binDividers(cfg) { function dividersWhy(cfg) { const c = Object.assign({}, BIN_DEFAULTS, cfg), built = dividersBuilt(c), out = { divX: null, divY: null }; if (!c.divRemovable || !plateLayout(c, built).railed || (insertOf(c) && insertPlan(c).n)) return out; - const by = countedAs(c), free = by.lipTaken ? dividersCounted(by) : null; + const by = countedAs(c); for (const [key, axis] of [['divX', 'x'], ['divY', 'y']]) { const asked = c[key] || 0; if (built[key] >= asked) continue; const L = railedLimit(by, axis); if (built[key] >= Math.min(asked, L.most)) { out[key] = L.by; continue; } - if (free && built[key] < free[key]) { out[key] = 'slot'; continue; } const P = plateLayout(by, Object.assign({}, built, { [key]: built[key] + 1 })); out[key] = !P.fitsY && !P.corners ? 'crossCorners' : !P.fitsY ? 'cross' : 'lipCorners'; } diff --git a/src/bins/ui.js b/src/bins/ui.js index 91dd994..ded4ea5 100644 --- a/src/bins/ui.js +++ b/src/bins/ui.js @@ -3083,11 +3083,6 @@ function binIssues(b, k, claims) { // both, where one more would go wrong both ways (dividersWhy) crossCorners: (any) => `${any ? 'no more' : 'none'} keep ${PLATE_END} mm of plate where they ${stand}, ` + `and ${any ? 'more' : 'any'} would notch the stacking lip too close to its corners`, - /* A bin with a finger slot has no lip, and is counted without it, but for this: with - more plates it would have no slot, and so its lip, which they would notch too close - to its corners (dividersWhy). A fallback: no bin swept has reached it. */ - slot: (any) => `${any ? 'more' : 'any'} would leave no room for its finger slots, and it would have the ` + - `stacking lip back, which ${any ? 'no more' : 'none'} can have a notch through clear of its corners`, }; const MANY = { lip: 'no more can have a notch through the stacking lip clear of its corners', @@ -3096,8 +3091,6 @@ function binIssues(b, k, claims) { lipCorners: 'more along would notch the stacking lip too close to its corners', crossCorners: `no more along keep ${PLATE_END} mm of plate where they cross the ones across, or stand on the ` + 'scoop, and more would notch the stacking lip too close to its corners', - slot: 'more would leave no room for their finger slots, and they would have the stacking lip back, which ' + - 'no more can have a notch through clear of its corners', }; for (const r of Object.keys(REASON)) { const these = short.filter(([k]) => why[k] === r); diff --git a/test/bin-audit.js b/test/bin-audit.js index 8795fe6..8c29e0a 100644 --- a/test/bin-audit.js +++ b/test/bin-audit.js @@ -9,7 +9,8 @@ const G = require('../src/core.js'); const { buildBin, binVolume, binHeights, SPEC, REQUIRED_CORE, BIN_DEFAULTS, outlineAt, wallSplits, dividerPart, lidPart: lidPartOf, lipHeight: lipHeightOf, LIP_TABLE, holeSites, feetHolesOff, unpackBin, binFeet, dividersBuilt, binDividers, dividerPlates, plateLayout, shelfNote, floorPlan, NOTE_CLEAR, - insertPlan, dividersWhy, railedLimit, HOLES_MAX, fingerSlotPlan } = require('../src/bins/bin.js'); + insertPlan, dividersWhy, railedLimit, HOLES_MAX, fingerSlotPlan, dividersCounted, + countedAs } = require('../src/bins/bin.js'); // the label shelf as built, { top, depth, raised }, depth 0 for none: floorPlan's, which buildBin builds const shelfAs = (c, iw, id, H) => floorPlan(c, iw, id, H).shelf || { top: H, depth: 0, raised: null }; const NOTE_TEXT = require('../src/bins/text.js'); @@ -3622,6 +3623,47 @@ console.log('\nfinger slots'); /* Opt-in, and only where one can be built: every other bin is built to the byte as it was, whatever its slot settings say, and its plates are counted as they were. Each row + /* A bin counted without its lip, as one with a slot built in it is (countedAs), is built + with that count, never the one its lip would allow: the lip only stops plates standing + a few millimetres apart, where the walls they meet have no room for a slot either way, + so a slot built between the plates the lip allows is built between the ones without + 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. */ + { + let n = 0, marked = 0, bound = 0; + const off = []; + for (const u of [0.5, 1, 2]) for (const v of [0.5, 1, 2]) for (const wall of [0.4, 0.8, 1.2]) + for (const [divT, divClr] of [[0.8, 0], [0.8, 0.25], [1.2, 0.1]]) for (const s of ['f', 'l', 'fl', 'fblr']) + for (const extra of [{}, { scoop: 20, label: 8, labelMode: 1, note: '1' }]) { + const base = Object.assign({ u, v, hUnits: 3, wall, divT, divClr, divRemovable: true, + 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]]) { + const cfg = Object.assign({}, base, { divX, divY }), by = countedAs(cfg); + n++; + if (!by.lipTaken) continue; + marked++; + const lipped = dividersCounted(Object.assign({}, by, { lipTaken: false })), want = dividersCounted(by); + if (lipped.divX !== want.divX || lipped.divY !== want.divY) bound++; + const built = dividersBuilt(cfg), why = dividersWhy(cfg); + if (built.divX !== want.divX || built.divY !== want.divY) + off.push(`${JSON.stringify(cfg)} built with ${built.divX} and ${built.divY}, not ${want.divX} and ${want.divY}`); + else if (Object.values(why).some((w) => /lip|Corners/.test(w || ''))) + off.push(`${JSON.stringify(cfg)}: Checks gives ${JSON.stringify(why)}`); + } + } + console.log(` ${'counted with no lip'.padEnd(22)} ` + (off.length ? `WRONG in ${off.length}: ` + off.slice(0, 3).join('; ') + : `${marked} of ${n} bins counted without their lip, ${bound} where the lip would hold their plates: ` + + 'each built with that count, and none put down to the lip')); + if (off.length || bound < 100) bad++; + } + is a bin that has to come out the same as without them, and the reason fingerSlotPlan gives the page for building none. */ const stl = (cfg) => Buffer.from(G.stlBinary(buildBin(G, cfg).polys, 'b')).toString('base64'); From c9a0437d500c1bf8e0ad09eb208760c9012c128d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 07:48:57 +0000 Subject: [PATCH 3/8] Put the audit's new row after the comment it split The last commit set "counted with no lip" two lines into the comment over the opt-in rows, which left the audit unable to load. It now stands between the rows before and that comment, which is whole again. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- test/bin-audit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bin-audit.js b/test/bin-audit.js index 8c29e0a..0d44e15 100644 --- a/test/bin-audit.js +++ b/test/bin-audit.js @@ -3621,8 +3621,6 @@ console.log('\nfinger slots'); if (faults.length) bad++; } - /* Opt-in, and only where one can be built: every other bin is built to the byte as it - was, whatever its slot settings say, and its plates are counted as they were. Each row /* A bin counted without its lip, as one with a slot built in it is (countedAs), is built with that count, never the one its lip would allow: the lip only stops plates standing a few millimetres apart, where the walls they meet have no room for a slot either way, @@ -3664,6 +3662,8 @@ console.log('\nfinger slots'); if (off.length || bound < 100) bad++; } + /* Opt-in, and only where one can be built: every other bin is built to the byte as it + was, whatever its slot settings say, and its plates are counted as they were. Each row is a bin that has to come out the same as without them, and the reason fingerSlotPlan gives the page for building none. */ const stl = (cfg) => Buffer.from(G.stlBinary(buildBin(G, cfg).polys, 'b')).toString('base64'); From 6b4ab98048bdbf2aa8bd75e34c63474c0ca69f50 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 07:49:03 +0000 Subject: [PATCH 4/8] Say what reads lipTaken, and what each does with it The comments on lipNotched, dividersBuilt and countedAs, and ENGINE.md, said only the lip's rule reads lipTaken. lipNotched does, which drops the lip's rule and its corners from the count and from the reasons dividersWhy gives, as it asks railedLimit and plateLayout of the marked bin; and the page's setDividerLimit reads it to hold the field for the plates across to dividersBuilt's count. Each now says so. Comments only. (#58 nit 2) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- docs/ENGINE.md | 7 ++++++- src/bins/bin.js | 44 +++++++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/docs/ENGINE.md b/docs/ENGINE.md index c41d9bd..8d1b491 100644 --- a/docs/ENGINE.md +++ b/docs/ENGINE.md @@ -312,7 +312,12 @@ construction plus overlapping shells, so none of §2 is reachable. Keep it that `dividersBuilt` counts the plates with the lip's rule and without it, and takes the count without it where a slot is still built between those plates (settled with them, `fingerSlotPlan` given the count), and otherwise keeps the lip and its count. Counted - so, the bin is marked `lipTaken`, which only the lip's rule reads (`lipNotched`): it + so, the bin is marked `lipTaken`. In the engine only `lipNotched` reads it, which + drops the lip's rule and its corners for that bin wherever they are asked: in the + count, and in the reasons Checks gives, as `dividersWhy` asks `railedLimit` and + `plateLayout` of the marked bin. On the page `setDividerLimit` reads it as well, and + holds the field for the plates across to `dividersBuilt`'s count, as the one along + always is, since more plates across can leave no slot and bring the lip back. The bin keeps its lip as asked for all else, and above all for its holes, which are laid out clear of the lip before the slots are settled over them. Asked as a bin with `lip` false, its holes had room it does not give them, and a row that is not built held its diff --git a/src/bins/bin.js b/src/bins/bin.js index 95298e4..aae173c 100644 --- a/src/bins/bin.js +++ b/src/bins/bin.js @@ -2379,14 +2379,19 @@ const wallEdge = (c, k) => (c.edges && c.edges[k] !== undefined ? c.edges[k] : 1 /* Whether a bin's stacking lip is the one notched at its slots, for removable dividers: a lip, over a wall thinner than its base (lipLevels). Over a wall as thick as the base the lip stands on the wall and nowhere over the cavity, so a plate clears it. - None on a bin counted as one whose finger slot takes its lip away (`lipTaken`, - dividersBuilt and countedAs), which keeps its lip as asked for everything else: its - holes across the floor are laid out clear of the lip (holeLayout) before the slots - are settled over them, and so built. Counted with `lip` false, they were laid out - with room the bin does not give them: a 1x0.5x2 with a 0.4 mm wall asking for AAA - cells, none of which fit, was counted as if a row of 3 did, which leaves its back - wall no room for the slot it is built with, and so as if it had the label shelf that - slot takes away: it was built with 1 plate along, not 2. */ + None on a bin counted as one whose finger slot takes its lip away (`lipTaken`, set by + dividersBuilt and countedAs). This is where the engine reads that, and so what drops + the lip's rule from railedLimit and its corners from plateLayout for such a bin, and + from the reasons dividersWhy gives, which asks both of the bin countedAs marks. The + page reads it too (setDividerLimit): a bin so marked has its field for the plates + across held to dividersBuilt's count, as the one along always is, since more plates + across could leave it no slot, and so its lip back. It keeps its lip as asked for + everything else: its holes across the floor are laid out clear of the lip (holeLayout) + before the slots are settled over them, and so built. Counted with `lip` false, they + were laid out with room the bin does not give them: a 1x0.5x2 with a 0.4 mm wall + asking for AAA cells, none of which fit, was counted as if a row of 3 did, which + leaves its back wall no room for the slot it is built with, and so as if it had the + label shelf that slot takes away: it was built with 1 plate along, not 2. */ const lipNotched = (c) => !!c.lip && !c.lipTaken && !c.solid && ['f', 'b', 'l', 'r'].every((k) => wallEdge(c, k) >= 1) && LIP[0][1] - c.wall >= BLOAT; /* The scoop's radius as buildBin builds it, 0 for none: no taller than the front wall it @@ -2563,14 +2568,16 @@ function dividersBuilt(cfg) { const out = dividersCounted(c); /* A finger slot takes the lip away, as a lowered wall does (buildBin), and the notches with it, which railedLimit and plateLayout keep clear of the lip's corners. So a bin - asking for slots is counted without that rule as well (`lipTaken`, which only the - rule reads: its holes are laid out clear of its lip all the same, as they are built, - lipNotched), and built with that count where a slot is still built between the - plates it gives, which can be narrower or stand elsewhere: settled between those - plates (fingerSlotPlan), as buildBin then settles them. Where none would be, the bin - keeps its lip and the count the lip allows. Counted with the lip's rule, a 1x1x3 with - a 0.4 mm wall and a slot in the front was built with 10 plates along where 11 fit, - and Checks put it down to a lip it does not have. */ + asking for slots is counted without that rule as well (`lipTaken`: lipNotched reads + it and drops the rule and the corners, for this count and for dividersWhy's reasons, + and the page's field for the plates across reads it, to be held to what this builds; + its holes are laid out clear of its lip all the same, as they are built), and built + with that count where a slot is still built between the plates it gives, which can + be narrower or stand elsewhere: settled between those plates (fingerSlotPlan), as + buildBin then settles them. Where none would be, the bin keeps its lip and the count + the lip allows. Counted with the lip's rule, a 1x1x3 with a 0.4 mm wall and a slot in + the front was built with 10 plates along where 11 fit, and Checks put it down to a + lip it does not have. */ if (c.divRemovable && c.lip && slotsAsked(c)) { const free = dividersCounted(Object.assign({}, c, { lipTaken: true })); if ((free.divX !== out.divX || free.divY !== out.divY) && fingerSlotPlan(c, free).n) return free; @@ -2599,7 +2606,10 @@ function dividersCounted(c) { in it, which leaves it no lip, the same bin counted without one (`lipTaken`, dividersBuilt). What Checks says stopped the count (dividersWhy) and how many the fields let a bin ask for go by it, so neither says or stops at the lip of a bin that - has none. */ + has none: dividersWhy asks railedLimit and plateLayout of it, which lipNotched then + keeps from the lip's rule and corners, and setDividerLimit holds the fields to + railedMost of it and, where it is marked, the one for the plates across to + dividersBuilt's count too. */ function countedAs(cfg) { const c = Object.assign({}, BIN_DEFAULTS, cfg); return c.divRemovable && c.lip && slotsAsked(c) && fingerSlotPlan(c).n ? Object.assign(c, { lipTaken: true }) : c; From ab564bcf4eacfa4294f7259cfdfb6767a716de9b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 07:49:12 +0000 Subject: [PATCH 5/8] =?UTF-8?q?Say=20in=20the=20audit=20what=20noteShells?= =?UTF-8?q?=20keeps,=20and=20whose=20figure=2015=20=C2=B5m=20is?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since #62 a note's shells are kept 0.02 mm clear of each other's corners in x or y wherever a move allows (NOTE_APART), not "closer than a slicer's weld joins"; and the 15 µm the random notes are held to is the audit's own figure, as noteShells holds its fallback to none. Comments only. (#62 nits) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- test/bin-audit.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/bin-audit.js b/test/bin-audit.js index 0d44e15..dce7ac9 100644 --- a/test/bin-audit.js +++ b/test/bin-audit.js @@ -2707,8 +2707,9 @@ console.log('\nnotes raised on the label shelf'); corners laid before it, and noteShells then keeps the one with the most room, which nothing holds to NOTE_APART. Kept where it started instead, it left 4 of these with two shells' corners under 15 µm apart, two of them 3.5 µm. They are held to 15 µm, - the figure noteShells gives: more than the 10 µm that keeps a 10 µm grid from joining - two at any offset, and than the 14.2 µm a 10 µm cell spans turned any way. */ + a figure of this audit's own, as noteShells holds that fallback to none: more than + the 10 µm that keeps a 10 µm grid from joining two at any offset, and than the + 14.2 µm a 10 µm cell spans turned any way. */ { const HELD = 0.015, DRAWN = 6000; let seed = 62; @@ -3322,8 +3323,9 @@ function weldOpen(polys, tol) { The removable dividers' row is as the table of links from before the feet holes has it: 857e407d on main, 7b838b80 once its rails reached the clearance further (#50), and 576daddc since its lip is notched where its plates go in. The 1x1x3's note was - e43cbc54 until its letters' shells were laid with no two corners closer than a - slicer's weld joins (noteShells), and d3caaa09 since: some of its strokes stop up to + e43cbc54 until its letters' shells were laid with each one's corners 0.02 mm clear, + in x or in y, of the corners of those before it wherever a move allows that + (noteShells, NOTE_APART), and d3caaa09 since: some of its strokes stop up to a few hundredths of a millimetre elsewhere, and nothing else in it changed. The 2x1x2 over screws prints no note (its shelf is too shallow), so it is the same bytes. */ const crypto = require('crypto'); From e465ef73416f6c440cd04fc3dd71426f4f95e54d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 07:49:28 +0000 Subject: [PATCH 6/8] Say 1 unit, not 1 units Where one unit is the tallest bin that fits, the grid summary said "tallest single bin 1 units", and a 1-unit bin's tooltips on the map and in the preview, and the preview's label in focus, said "1 units" too. All four count with plural() now. A new bins.spec test, an 18 mm drawer over a 4.25 mm plate, checks all four; it fails on main. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- src/bins/ui.js | 11 ++++++----- test/ui/bins.spec.js | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/bins/ui.js b/src/bins/ui.js index ded4ea5..b4d6997 100644 --- a/src/bins/ui.js +++ b/src/bins/ui.js @@ -2217,7 +2217,7 @@ function drawMap() { // what makes it safe for the labels to shorten or drop a line in a small bin const tip = document.createElementNS(SVGNS, 'title'); tip.textContent = (b.note ? b.note + ' — ' : '') + - `${b.u}×${b.v}, ${b.hUnits} units (${b.hUnits * SPEC.unitH} mm)`; + `${b.u}×${b.v}, ${plural(b.hUnits, 'unit')} (${b.hUnits * SPEC.unitH} mm)`; r.appendChild(tip); if (issues.length) { const warn = el('text', { class: 'bwarn', x: b.x * S + 13, y: sy(b.y, b.v) + 20 }); @@ -3754,11 +3754,12 @@ function refresh() { (inch ? ` (${gw} × ${gd} mm, ${FIELDS.inchText(gw)} × ${FIELDS.inchText(gd)} in)` : '') + /* With no room there is no tallest bin either, nor with room under a 1-unit bin and its lip: capUnits is never under 1, and it said "tallest single bin 1 units" there - while Checks said no 1-unit bin fits. */ + while Checks said no 1-unit bin fits. Where one unit is the tallest, it is "1 unit", + as Checks says it: it said "1 units" there too. */ (noRoomAbove(g) ? ` · no room above the baseplate, as ${whyNoRoom(also)}` : ` · ${g.avail.toFixed(1)} mm${also(g.avail)} above the baseplate · ` + (unitsUnder(g.avail) < 1 ? `too little for even a 1-unit bin (${SPEC.unitH} mm${also(SPEC.unitH)} + lip)` - : `tallest single bin ${capUnits} units (${capUnits * SPEC.unitH} mm${also(capUnits * SPEC.unitH)} + lip), limited by ${capBy}`)); + : `tallest single bin ${plural(capUnits, 'unit')} (${capUnits * SPEC.unitH} mm${also(capUnits * SPEC.unitH)} + lip), limited by ${capBy}`)); // and the half cell under the size fields, which said 21 mm whatever the drawer was in $('halfCellLen').textContent = `${SPEC.pitch / 2} mm${also(SPEC.pitch / 2)}`; const src = scratch || (selected >= 0 && B()[selected] ? B()[selected] : state); @@ -4422,7 +4423,7 @@ function drawScene() { function sceneLabel(empty, shell, g) { if (fBin()) { const b = fBin(); - return `3D preview: one ${b.u} by ${b.v} bin, ${b.hUnits} units tall, ` + + return `3D preview: one ${b.u} by ${b.v} bin, ${plural(b.hUnits, 'unit')} tall, ` + 'on a baseplate of its own size.'; } if (empty && !shell) @@ -4506,7 +4507,7 @@ function render() { function showTip(e, b, k) { const el = $('tip'); el.textContent = (b.note ? b.note + ' — ' : '') + - `${b.u}×${b.v}, ${b.hUnits} units (${b.hUnits * SPEC.unitH} mm)` + + `${b.u}×${b.v}, ${plural(b.hUnits, 'unit')} (${b.hUnits * SPEC.unitH} mm)` + (k !== undefined && layers.length > 1 ? ` · layer ${k + 1}` : ''); el.style.display = 'block'; const pad = 14; diff --git a/test/ui/bins.spec.js b/test/ui/bins.spec.js index f035c1b..90fe262 100644 --- a/test/ui/bins.spec.js +++ b/test/ui/bins.spec.js @@ -205,6 +205,26 @@ test('room above the baseplate too short for a 1-unit bin is said to be too litt .toHaveText('Grid: 5 × 5 cells · 5.8 mm above the baseplate · too little for even a 1-unit bin (7 mm + lip)'); }); +/* With room for a 1-unit bin and no taller, the panel said "tallest single bin 1 units"; + a 1-unit bin's tooltips on the map and in the preview, and the preview's label with it + on its own, said "1 units" as well. Each says one unit. */ +test('one unit is said as one, in the panel, the tooltips and the preview', async ({ page }) => { + await Promise.all([page.waitForEvent('load'), + page.goto(H.BINS_URL + '#w=230&d=230&dh=18&ph=4.25&bl=0-0-1-1-1-1.2-1.2-0-0-0-1-1-1-1-0-0-0-0-0-0-15')]); + await page.waitForFunction(() => !!document.getElementById('fillmap') && B().length === 1); + await expect(page.locator('#gridSummary')).toHaveText('Grid: 5 × 5 cells · 13.8 mm above the baseplate · ' + + 'tallest single bin 1 unit (7 mm + lip), limited by the drawer'); + const tips = await page.evaluate(() => { + showTip({ clientX: 100, clientY: 100 }, B()[0]); + return [[...document.querySelectorAll('#fillmap title')].map((t) => t.textContent).join(' | '), + document.getElementById('tip').textContent]; + }); + for (const t of tips) expect(t).toContain('1×1, 1 unit (7 mm)'); + await H.clickCell(page, 0, 0); + await page.locator('#focusBin').click(); + await expect(page.locator('#three')).toHaveAttribute('aria-label', /^3D preview: one 1 by 1 bin, 1 unit tall, /); +}); + /* The layout travels in the URL hash; a carved shape has to survive that like anything else, or sharing a link quietly changes what people print. */ test('a carved layout survives a round trip through the url', async ({ page }) => { From e4c8c1d762dd9464c950a9856d64a592802e67df Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 07:52:51 +0000 Subject: [PATCH 7/8] Keep each bin's dividers, and why it has fewer, for the refresh that asks again A refresh asks a bin's dividers (builtDivs) ten times over, for its key, its name, Checks and its compartments, and Checks asks dividersWhy of every bin with removable plates. With 63 such bins with finger slots ticked, dividersBuilt took 60 to 150 ms of an 85 to 180 ms refresh, about three quarters of it, and 20 to 45 of 35 to 85 with no slots; with all 63 asking for more plates than fit, dividersWhy took 20 to 45 more. Both are pure, so the page keeps each answer by the settings that asked it, as it keeps fingerPlan's, and clears the lot past 500. The same refreshes now take 12 to 50 ms, or 30 to 85 with all 63 short. 2,400 bins built at random on the page get the same answer kept as asked fresh. (#58 O5) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- src/bins/ui.js | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/bins/ui.js b/src/bins/ui.js index b4d6997..59b08e2 100644 --- a/src/bins/ui.js +++ b/src/bins/ui.js @@ -194,11 +194,38 @@ const binCfg = (b) => ({ u: b.u, v: b.v, hUnits: b.hUnits, wall: b.wall, bin with holes across its floor, which the holes divide, as buildBin builds it (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. */ + (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 + 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 + the bin has a size of its own, so nothing here changes an answer under its key. */ +const keptDivs = new Map(); const builtDivs = (b) => { const c = Object.assign(binCfg(b), { u: b.u || 1, v: b.v || 1 }); - if (!(b.u && b.v && fingerPlan(b))) return binDividers(c); - return +c.insert > 0 && insertPlanOf(b).n ? { divX: 0, divY: 0 } : dividersBuilt(c); + const key = (b.u && b.v ? '' : '1x1 ') + JSON.stringify(c); + let d = keptDivs.get(key); + if (!d) { + if (keptDivs.size >= 500) keptDivs.clear(); + keptDivs.set(key, (d = !(b.u && b.v && fingerPlan(b)) ? binDividers(c) + : +c.insert > 0 && insertPlanOf(b).n ? { divX: 0, divY: 0 } : dividersBuilt(c))); + } + return { divX: d.divX, divY: d.divY }; +}; +/* And why a removable bin is built with fewer than it asks for (dividersWhy), kept the + same way for `cfg`, the bin's binCfg at its size: Checks asks it of every such bin each + refresh, at 0.3 to 1 ms a bin, and with all 63 asking for more plates than fit it took + 30 to 50 ms of an 80 to 100 ms refresh once their dividers were kept. */ +const keptWhys = new Map(); +const divsWhy = (cfg) => { + const key = JSON.stringify(cfg); + let w = keptWhys.get(key); + if (!w) { + if (keptWhys.size >= 500) keptWhys.clear(); + keptWhys.set(key, (w = dividersWhy(cfg))); + } + return { divX: w.divX, divY: w.divY }; }; // and how many compartments they make, or 0 for a bin with none const compartments = (b) => { @@ -3041,7 +3068,7 @@ function binIssues(b, k, claims) { /* What brought each direction's count down (dividersWhy). The rails' own rules are said together as one note; what stands over a slot, the lip and the shelf, and what the plates keep where they cross or stand on the scoop, each in a note of its own. */ - const why = dividersWhy(cfg); + const why = divsWhy(cfg); /* The rails' own rules, said together as one note (railedLimit): the slots, the corners, and two more. 'lone': room for one divider's slot and a rail either side, but not for the rails the other way beside it, which are kept room for whether or From 3cdf15f4322f8f4b36eac791162f2fb85c739f6e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 07:53:06 +0000 Subject: [PATCH 8/8] Rebuild the pages Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- bins/index.html | 120 ++++++++++++++++++++++++++++++++---------------- sw.js | 2 +- 2 files changed, 81 insertions(+), 41 deletions(-) diff --git a/bins/index.html b/bins/index.html index 33311a4..6b0c824 100644 --- a/bins/index.html +++ b/bins/index.html @@ -10360,14 +10360,19 @@

Your drawers

/* Whether a bin's stacking lip is the one notched at its slots, for removable dividers: a lip, over a wall thinner than its base (lipLevels). Over a wall as thick as the base the lip stands on the wall and nowhere over the cavity, so a plate clears it. - None on a bin counted as one whose finger slot takes its lip away (`lipTaken`, - dividersBuilt and countedAs), which keeps its lip as asked for everything else: its - holes across the floor are laid out clear of the lip (holeLayout) before the slots - are settled over them, and so built. Counted with `lip` false, they were laid out - with room the bin does not give them: a 1x0.5x2 with a 0.4 mm wall asking for AAA - cells, none of which fit, was counted as if a row of 3 did, which leaves its back - wall no room for the slot it is built with, and so as if it had the label shelf that - slot takes away: it was built with 1 plate along, not 2. */ + None on a bin counted as one whose finger slot takes its lip away (`lipTaken`, set by + dividersBuilt and countedAs). This is where the engine reads that, and so what drops + the lip's rule from railedLimit and its corners from plateLayout for such a bin, and + from the reasons dividersWhy gives, which asks both of the bin countedAs marks. The + page reads it too (setDividerLimit): a bin so marked has its field for the plates + across held to dividersBuilt's count, as the one along always is, since more plates + across could leave it no slot, and so its lip back. It keeps its lip as asked for + everything else: its holes across the floor are laid out clear of the lip (holeLayout) + before the slots are settled over them, and so built. Counted with `lip` false, they + were laid out with room the bin does not give them: a 1x0.5x2 with a 0.4 mm wall + asking for AAA cells, none of which fit, was counted as if a row of 3 did, which + leaves its back wall no room for the slot it is built with, and so as if it had the + label shelf that slot takes away: it was built with 1 plate along, not 2. */ const lipNotched = (c) => !!c.lip && !c.lipTaken && !c.solid && ['f', 'b', 'l', 'r'].every((k) => wallEdge(c, k) >= 1) && LIP[0][1] - c.wall >= BLOAT; /* The scoop's radius as buildBin builds it, 0 for none: no taller than the front wall it @@ -10544,14 +10549,16 @@

Your drawers

const out = dividersCounted(c); /* A finger slot takes the lip away, as a lowered wall does (buildBin), and the notches with it, which railedLimit and plateLayout keep clear of the lip's corners. So a bin - asking for slots is counted without that rule as well (`lipTaken`, which only the - rule reads: its holes are laid out clear of its lip all the same, as they are built, - lipNotched), and built with that count where a slot is still built between the - plates it gives, which can be narrower or stand elsewhere: settled between those - plates (fingerSlotPlan), as buildBin then settles them. Where none would be, the bin - keeps its lip and the count the lip allows. Counted with the lip's rule, a 1x1x3 with - a 0.4 mm wall and a slot in the front was built with 10 plates along where 11 fit, - and Checks put it down to a lip it does not have. */ + asking for slots is counted without that rule as well (`lipTaken`: lipNotched reads + it and drops the rule and the corners, for this count and for dividersWhy's reasons, + and the page's field for the plates across reads it, to be held to what this builds; + its holes are laid out clear of its lip all the same, as they are built), and built + with that count where a slot is still built between the plates it gives, which can + be narrower or stand elsewhere: settled between those plates (fingerSlotPlan), as + buildBin then settles them. Where none would be, the bin keeps its lip and the count + the lip allows. Counted with the lip's rule, a 1x1x3 with a 0.4 mm wall and a slot in + the front was built with 10 plates along where 11 fit, and Checks put it down to a + lip it does not have. */ if (c.divRemovable && c.lip && slotsAsked(c)) { const free = dividersCounted(Object.assign({}, c, { lipTaken: true })); if ((free.divX !== out.divX || free.divY !== out.divY) && fingerSlotPlan(c, free).n) return free; @@ -10580,7 +10587,10 @@

Your drawers

in it, which leaves it no lip, the same bin counted without one (`lipTaken`, dividersBuilt). What Checks says stopped the count (dividersWhy) and how many the fields let a bin ask for go by it, so neither says or stops at the lip of a bin that - has none. */ + has none: dividersWhy asks railedLimit and plateLayout of it, which lipNotched then + keeps from the lip's rule and corners, and setDividerLimit holds the fields to + railedMost of it and, where it is marked, the one for the plates across to + dividersBuilt's count too. */ function countedAs(cfg) { const c = Object.assign({}, BIN_DEFAULTS, cfg); return c.divRemovable && c.lip && slotsAsked(c) && fingerSlotPlan(c).n ? Object.assign(c, { lipTaken: true }) : c; @@ -10603,11 +10613,21 @@

Your drawers

and 'crossCorners' when both would. It was asked of as many as the rails allow, and named the plates' keep wherever both went wrong there, whichever stopped one more. A bin with a finger slot built in it has no lip, and is said by the rules it is counted - by without one (countedAs), never the lip's; 'slot' where it is built with the count - its lip would allow all the same, because between more plates no slot would be built, - and it would have its lip. That is a fallback no bin swept has reached: the lip's rule - binds only on plates packed too close for a slot between them, so more of them move no - slot (dividersBuilt). + by without one (countedAs), never the lip's, and it is always built with that count. + The lip stops only plates that would stand under 6 mm apart, so the ones it keeps + stand under 9: its rule and its corners bind where the last plate stands within half + a plate, its clearance and 3.4 mm of the cavity's wall, and the rails let plates stand + that close only where half a plate and its clearance are under 2.2 mm. A finger slot + needs 15 mm between two plates' rails, or a rail and the wall's corner, so the walls + those plates meet have no slot with the lip's count or without it. And all else a + slot is settled by is the same with either: the plates the other way, unless the lip + stopped those as well, which leaves no wall a slot; the scoop; and the shelf, as no + note prints between plates that close. So where a slot is built between + the plates the lip allows, one is built between the plates without it, and the bin is + built with those (dividersBuilt). This had 'slot' for a bin built with the lip's count + all the same, as between more plates no slot would be built, and none of 900,000 + random bins nor of a million aimed at the lip reached it; the audit holds bins to + that ("counted with no lip"). Null where it is built with all it asks for, and where it has no rails at all: a carved shape, a solid block or a floor that fills the bin (plateLayout's railed), or holes across its floor (binDividers). Those are built with none whatever they ask for, @@ -10616,13 +10636,12 @@

Your drawers

function dividersWhy(cfg) { const c = Object.assign({}, BIN_DEFAULTS, cfg), built = dividersBuilt(c), out = { divX: null, divY: null }; if (!c.divRemovable || !plateLayout(c, built).railed || (insertOf(c) && insertPlan(c).n)) return out; - const by = countedAs(c), free = by.lipTaken ? dividersCounted(by) : null; + const by = countedAs(c); for (const [key, axis] of [['divX', 'x'], ['divY', 'y']]) { const asked = c[key] || 0; if (built[key] >= asked) continue; const L = railedLimit(by, axis); if (built[key] >= Math.min(asked, L.most)) { out[key] = L.by; continue; } - if (free && built[key] < free[key]) { out[key] = 'slot'; continue; } const P = plateLayout(by, Object.assign({}, built, { [key]: built[key] + 1 })); out[key] = !P.fitsY && !P.corners ? 'crossCorners' : !P.fitsY ? 'cross' : 'lipCorners'; } @@ -12526,11 +12545,38 @@

Your drawers

bin with holes across its floor, which the holes divide, as buildBin builds it (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. */ + (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 + 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 + the bin has a size of its own, so nothing here changes an answer under its key. */ +const keptDivs = new Map(); const builtDivs = (b) => { const c = Object.assign(binCfg(b), { u: b.u || 1, v: b.v || 1 }); - if (!(b.u && b.v && fingerPlan(b))) return binDividers(c); - return +c.insert > 0 && insertPlanOf(b).n ? { divX: 0, divY: 0 } : dividersBuilt(c); + const key = (b.u && b.v ? '' : '1x1 ') + JSON.stringify(c); + let d = keptDivs.get(key); + if (!d) { + if (keptDivs.size >= 500) keptDivs.clear(); + keptDivs.set(key, (d = !(b.u && b.v && fingerPlan(b)) ? binDividers(c) + : +c.insert > 0 && insertPlanOf(b).n ? { divX: 0, divY: 0 } : dividersBuilt(c))); + } + return { divX: d.divX, divY: d.divY }; +}; +/* And why a removable bin is built with fewer than it asks for (dividersWhy), kept the + same way for `cfg`, the bin's binCfg at its size: Checks asks it of every such bin each + refresh, at 0.3 to 1 ms a bin, and with all 63 asking for more plates than fit it took + 30 to 50 ms of an 80 to 100 ms refresh once their dividers were kept. */ +const keptWhys = new Map(); +const divsWhy = (cfg) => { + const key = JSON.stringify(cfg); + let w = keptWhys.get(key); + if (!w) { + if (keptWhys.size >= 500) keptWhys.clear(); + keptWhys.set(key, (w = dividersWhy(cfg))); + } + return { divX: w.divX, divY: w.divY }; }; // and how many compartments they make, or 0 for a bin with none const compartments = (b) => { @@ -14549,7 +14595,7 @@

Your drawers

// what makes it safe for the labels to shorten or drop a line in a small bin const tip = document.createElementNS(SVGNS, 'title'); tip.textContent = (b.note ? b.note + ' — ' : '') + - `${b.u}×${b.v}, ${b.hUnits} units (${b.hUnits * SPEC.unitH} mm)`; + `${b.u}×${b.v}, ${plural(b.hUnits, 'unit')} (${b.hUnits * SPEC.unitH} mm)`; r.appendChild(tip); if (issues.length) { const warn = el('text', { class: 'bwarn', x: b.x * S + 13, y: sy(b.y, b.v) + 20 }); @@ -15373,7 +15419,7 @@

Your drawers

/* What brought each direction's count down (dividersWhy). The rails' own rules are said together as one note; what stands over a slot, the lip and the shelf, and what the plates keep where they cross or stand on the scoop, each in a note of its own. */ - const why = dividersWhy(cfg); + const why = divsWhy(cfg); /* The rails' own rules, said together as one note (railedLimit): the slots, the corners, and two more. 'lone': room for one divider's slot and a rail either side, but not for the rails the other way beside it, which are kept room for whether or @@ -15415,11 +15461,6 @@

Your drawers

// both, where one more would go wrong both ways (dividersWhy) crossCorners: (any) => `${any ? 'no more' : 'none'} keep ${PLATE_END} mm of plate where they ${stand}, ` + `and ${any ? 'more' : 'any'} would notch the stacking lip too close to its corners`, - /* A bin with a finger slot has no lip, and is counted without it, but for this: with - more plates it would have no slot, and so its lip, which they would notch too close - to its corners (dividersWhy). A fallback: no bin swept has reached it. */ - slot: (any) => `${any ? 'more' : 'any'} would leave no room for its finger slots, and it would have the ` + - `stacking lip back, which ${any ? 'no more' : 'none'} can have a notch through clear of its corners`, }; const MANY = { lip: 'no more can have a notch through the stacking lip clear of its corners', @@ -15428,8 +15469,6 @@

Your drawers

lipCorners: 'more along would notch the stacking lip too close to its corners', crossCorners: `no more along keep ${PLATE_END} mm of plate where they cross the ones across, or stand on the ` + 'scoop, and more would notch the stacking lip too close to its corners', - slot: 'more would leave no room for their finger slots, and they would have the stacking lip back, which ' + - 'no more can have a notch through clear of its corners', }; for (const r of Object.keys(REASON)) { const these = short.filter(([k]) => why[k] === r); @@ -16093,11 +16132,12 @@

Your drawers

(inch ? ` (${gw} × ${gd} mm, ${FIELDS.inchText(gw)} × ${FIELDS.inchText(gd)} in)` : '') + /* With no room there is no tallest bin either, nor with room under a 1-unit bin and its lip: capUnits is never under 1, and it said "tallest single bin 1 units" there - while Checks said no 1-unit bin fits. */ + while Checks said no 1-unit bin fits. Where one unit is the tallest, it is "1 unit", + as Checks says it: it said "1 units" there too. */ (noRoomAbove(g) ? ` · no room above the baseplate, as ${whyNoRoom(also)}` : ` · ${g.avail.toFixed(1)} mm${also(g.avail)} above the baseplate · ` + (unitsUnder(g.avail) < 1 ? `too little for even a 1-unit bin (${SPEC.unitH} mm${also(SPEC.unitH)} + lip)` - : `tallest single bin ${capUnits} units (${capUnits * SPEC.unitH} mm${also(capUnits * SPEC.unitH)} + lip), limited by ${capBy}`)); + : `tallest single bin ${plural(capUnits, 'unit')} (${capUnits * SPEC.unitH} mm${also(capUnits * SPEC.unitH)} + lip), limited by ${capBy}`)); // and the half cell under the size fields, which said 21 mm whatever the drawer was in $('halfCellLen').textContent = `${SPEC.pitch / 2} mm${also(SPEC.pitch / 2)}`; const src = scratch || (selected >= 0 && B()[selected] ? B()[selected] : state); @@ -16761,7 +16801,7 @@

Your drawers

function sceneLabel(empty, shell, g) { if (fBin()) { const b = fBin(); - return `3D preview: one ${b.u} by ${b.v} bin, ${b.hUnits} units tall, ` + + return `3D preview: one ${b.u} by ${b.v} bin, ${plural(b.hUnits, 'unit')} tall, ` + 'on a baseplate of its own size.'; } if (empty && !shell) @@ -16845,7 +16885,7 @@

Your drawers

function showTip(e, b, k) { const el = $('tip'); el.textContent = (b.note ? b.note + ' — ' : '') + - `${b.u}×${b.v}, ${b.hUnits} units (${b.hUnits * SPEC.unitH} mm)` + + `${b.u}×${b.v}, ${plural(b.hUnits, 'unit')} (${b.hUnits * SPEC.unitH} mm)` + (k !== undefined && layers.length > 1 ? ` · layer ${k + 1}` : ''); el.style.display = 'block'; const pad = 14; diff --git a/sw.js b/sw.js index b7bd8ec..2a47a53 100644 --- a/sw.js +++ b/sw.js @@ -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 = "922acce9ef1e"; +const VERSION = "f14226fad998"; const FILES = [ "./", "bins/",