Skip to content

Lids for bins (F16): flat cover lid for every placed bin STL - #160

Merged
ntindle merged 1 commit into
mainfrom
poteto/lids-20261031-0710
Oct 31, 2026
Merged

ntindle merged 1 commit into
mainfrom
poteto/lids-20261031-0710

Conversation

@ntindle

@ntindle ntindle commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Lids for bins (F16): flat cover lid for every placed bin STL

Bin options gains a "Lids for bins" switch. When on, every placed bin gains a
flat 3 mm cover lid as its own STL in the Download files zip: one lid per
distinct bin footprint, shared across heights, counted in the Print plan
card and in the print estimates, with its own 3MF lid plates. The lid sits
on the stacking lip; it has no snap lip, hinge, or handle. Persisted as
gridfinity_lids, local-only, not in share links (same precedent as
labelTabs, dividers, and testFit).

Geometry

  • Lid mesh: a flat box spanning the bin outer footprint
    (binOuterSize, the same dims the bin part itself uses), 3 mm thick
    (LID_THICKNESS_MM). 12 triangles, bounds exactly
    [0, 0, 0]–[width, depth, 3], signed volume exactly width × depth × 3.
  • Lid/tab interplay: the label tab protrudes 1.2 mm past the bin's front
    face, outside the lid footprint (they touch only at the front plane), so
    a lid laid on the stacking lip sits flat and does not intersect a tab,
    and the tab still rises above the lid. Lids are separate STLs, not merged
    into bin meshes, so tabs and dividers are undisturbed.
  • Lid/height: lids are keyed by footprint only (lid:<cellSize>:<w>x<d>),
    so the same footprint at different heights shares one lid with summed
    counts. Skipped bins get no lid; counts multiply by the drawer count.
    Half-grid lids stay distinct (half-grid qualifier in key, stem, label).

Wiring

  • useGridfinitySettings adds gridfinity_lids (new key only, default
    false; legacy migration untouched). GridfinityCalculator drills lids
    to BinOptions, DownloadButton (→ createPrintFiles), and
    PrintPlanCard (→ collectPrintParts → part rows + estimatePrint).
  • exportFiles routes lids to their own 3mf/plate-N-lids.3mf plates
    (never mixed into bin/baseplate plates) and adds the README lid note
    plus the lid size line. Test-fit logic is untouched (baseplate/spacer
    stems only). Share format untouched (shareLayout.ts not modified).

Tests (repo config: vitest --config vite.config.test.js)

  • Full suite: 52 files, 616 passed / 11 skipped (was 603 passed; +13 new).
  • New: lidMesh bounds/volume/triangle-count/rejection (5),
    printParts lid grouping/counts/skipped/multi-drawer (4),
    printEstimates lid volume == lid mesh volume (1), exportFiles lid
    STL + lid 3MF plate + README note/line (1), BinOptions switch (1),
    PrintPlanCard lid row on/off (1).
  • Lint clean (--max-warnings 0), tsc --noEmit clean, build green
    (index chunk 237,001 → 237,798 B, +0.3%; lazy export chunk
    22,830 → 23,535 B, +3.1%).

Perf vs trunk (same box/day, local preview, node scripts/measure.mjs --n=15 --lh=3, two pairs)

Metric Branch Trunk
Parity 51.0% (23 ✅ + 5 🟡 / 50) 50.0%
Lighthouse perf 68 / 77 77 / 72
TTI 3958 / 3479 ms 3514 / 3724 ms
Input-to-preview (median) 41.9 / 32.7 ms 40.2 / 186.5 ms
Layout task 4 steps, 490 / 503 ms 4 steps, 496 / 795 ms
Share task 1 click, 83 / 79 ms 1 click, 117 / 73 ms

Verdict: no credible regression. Pair 1's load gap did not reproduce in
the reversed-order pair; within-side swings exceed any branch-trunk gap.
Pair 2's trunk interaction outliers (186.5 / 795 ms) ran while the
reviewer's test run shared the box, and they favor the branch anyway.
The diff touches no measured code path.

Live verification (Lane B — run on the deploy preview)

Core tasks 1–3, plus the lids feature, exact steps:

  1. Default layout (15×12 in, Bambu Lab A1): results + preview render.
  2. Half-size toggle on → finer grid, off → restored exactly.
  3. Download files + Share link + Bin labels + Print plan present.
  4. Find the "Lids for bins" switch with the description "Every printed
    bin gets a flat 3 mm cover lid that sits on the stacking lip. Lids
    have no snap lip, hinge, or handle." Confirm OFF persists across
    reload.
  5. Place a bin (drag-draw, e.g. Bin 4 × 3 · 3u). Read the estimate line
    with lids OFF, then turn lids ON: the estimate must increase by
    exactly the lid volume — footprint × 3 mm per lid (for a 4 × 3 bin:
    167.5 × 125.5 × 3 = 63,064 mm³ → about +2 h 11 min, +78 g PLA,
    +$1.56 at the default PLA/$20/kg/~8 mm³/s assumptions, for one bin
    in one drawer). Confirm ON persists across reload.
  6. Confirm the Print plan card gains a lid row and the bin plate rows are
    otherwise unchanged, and Download files reports the lid STL in the
    toast (e.g. lid-4x3-x1.stl).

Trunk expectations: everything above except step 4–6 (no lids switch,
no lid STL, no lid row); the estimate line must not change when the
switch is absent.

Review trail

  • Independent review of the code commit: code SHIP-ready; one docs-only
    blocker (missing scoreboard entry), fixed by a docs-only amend.
  • Docs-delta re-review: SHIP IT on the amend (scoreboard numbers match
    all four perf JSONs; feature-map line 12 corrected). One reviewer
    wording nit (Lighthouse "wider" phrasing) fixed with a docs-only prose
    amend after the verdict; no numbers changed.
  • Feature map: F16 ❌→🟡 (flat cover only, limits stated); F15 clause
    updated ("separate flat cover lids; no scoops or magnets yet").
    Parity 50.0% → 51.0%.
  • Still open (not this PR): snap lip / hinge / handle lids; configurable
    divider counts and positions; half-grid lid stem distinctness test
    (behavior verified by construction, no dedicated test yet).

Bin options gains a Lids switch. When on, every placed bin gains a flat
3 mm cover lid as its own STL in the Download files zip, one per
distinct bin footprint shared across heights, counted in the Print plan
card and estimates, with its own 3MF lid plates. The lid sits on the
stacking lip; it has no snap lip, hinge, or handle. Persisted as
gridfinity_lids, local-only, not in share links. Estimates include the
lid volume; the Download files README notes the lid and its limits.
Feature map: F16 not present to partial, parity 50.0% to 51.0%.
@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for gridfinity-drawer-planner ready!

Name Link
🔨 Latest commit be5e979
🔍 Latest deploy log https://app.netlify.com/projects/gridfinity-drawer-planner/deploys/6ae5fcf6f9b516b8a28e0561
😎 Deploy Preview https://deploy-preview-160--gridfinity-drawer-planner.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

PR Quality Report 📊

Check Status
TypeScript ✅
ESLint ✅
Tests ✅
Build ✅

View detailed results

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@3822f6d). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #160   +/-   ##
=======================================
  Coverage        ?   94.05%           
=======================================
  Files           ?       72           
  Lines           ?     3684           
  Branches        ?     1076           
=======================================
  Hits            ?     3465           
  Misses          ?      198           
  Partials        ?       21           
Flag Coverage Δ
unittests 94.05% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntindle

ntindle commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Lane B PASS on the deploy preview (https://deploy-preview-160--gridfinity-drawer-planner.netlify.app, head be5e979) — all 8 steps, no page errors:

  • Core tasks: 15x12 + Bambu Lab A1 -> "4 baseplates · 5 spacers", preview rendered; half-size on -> finer 12x12 grid, off -> restored exactly; Download files + Share link + Bin labels + Print plan present.
  • "Lids for bins" switch found with the exact description text; OFF persists across reload.
  • Placed "Bin 4 x 3 · 3u"; estimate OFF exactly "~8 h 59 min · ~321 g PLA · ~$6.42" -> ON exactly "~11 h 11 min · ~399 g PLA · ~$7.98" (+78 g, +$1.56 — exactly the 167.5 x 125.5 x 3 = 63,064 mm3 lid volume; the displayed time delta of +2 h 12 min vs the lid-only +2 h 11 min 23 s is rounding of the two totals to whole minutes, not a volume error).
  • ON persists across reload; Print plan shows "1x Lid 4 x 3" with bin plate rows otherwise unchanged.
  • Download toast: "Downloaded gridfinity-15x12in.zip 11 parts as STL files and 4 prints as 3MF plates" (10 parts without lids -> 11 with lids).
  • Independently confirmed from the downloaded zip: stl/lid-4x3-x1.stl present, 3mf/plate-4-lids.3mf present, README lid line "167.5 x 125.5 x 3 mm".

Merge gates: CI 31/31 green, perf no-regression (two pairs), independent review SHIP IT + docs-delta SHIP IT, scoreboard updated, RUNLOG trail present. No claude-review check on this head (no exception needed).

@ntindle
ntindle merged commit 4b6fc86 into main Oct 31, 2026
33 checks passed
@ntindle
ntindle deleted the poteto/lids-20261031-0710 branch October 31, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant