Skip to content

Configurable estimate settings (F31 follow-up): material, price, and flow on the Print plan card - #156

Merged
ntindle merged 1 commit into
mainfrom
poteto/estimate-settings-20261028-0710
Oct 28, 2026
Merged

ntindle merged 1 commit into
mainfrom
poteto/estimate-settings-20261028-0710

Conversation

@ntindle

@ntindle ntindle commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Configurable estimate settings (F31 follow-up slice, per docs/wireframes/print-and-export.md): the Print plan card's rough-estimate line now follows the user's own filament instead of fixed assumptions.

  • Material (PLA / PETG / ABS) via a segmented control — densities 1.24 / 1.27 / 1.04 g/cm³
  • Filament price ($/kg, clamps to $1–200) and print speed (mm³/s, clamps to 1–50) via commit-on-blur/Enter inputs, with a Reset to defaults button
  • Settings live in a popover on the card ("Estimate settings"), persist as gridfinity_estimateSettings in the shared settings, and are local-only — not in share links (like testFit, so no share-format change)
  • The estimate line shows the chosen material (~4 h 2 min · ~144 g PLA · ~$2.88 by default) and the footnote states the active assumptions
  • Defaults unchanged: PLA, $20/kg, ~8 mm³/s

estimatePrint(parts, settings) takes the settings (default parameter keeps old call sites working); sanitizeEstimateSettings validates stored values (unknown material → PLA, out-of-range numbers clamp, non-objects → defaults).

Why this instead of drawer presets

F12 drawer presets were the first pick this run, but the research killed them: only 1 of 7+ candidates verifies from a primary manufacturer source — IKEA publishes overall dims only (interior dims are community-measured blogs with noted manufacturing variation) and Harbor Freight publishes overall dims + volume only, no interior W×D. The wireframe rule ("Every preset needs a source URL for the inside dimensions; no guessed sizes") blocks shipping presets on those numbers, and a wrong preset prints a wrong baseplate. F44 examples are blocked by the same rule. Recorded in the feature-map honesty log and the backlog.

Tests

  • npm test: 575 passed / 11 skipped (51 files, 13 new tests: settings scaling per material/price/flow, sanitize cases, popover interactions, card recompute)
  • npm run lint, npx tsc --noEmit, npm run build: all green
  • Repo rules: unitMath throughout, @/ imports, zero added comments

Perf vs trunk (same box, local preview, node scripts/measure.mjs)

Metric Branch Trunk
Lighthouse perf 68 73
TTI 3933 ms 3665 ms
Input-to-preview (median) 36.7 ms 43.1 ms
Layout task 4 steps, 553 ms 4 steps, 536 ms
Export task supported supported
Share task 1 click, 85 ms 1 click, 82 ms

No credible regression: the first pair's load-metric gap reproduced in a reversed-order --n=30 --lh=1 pair (71 vs 77, 3732 vs 3499 ms) but flipped in a second --n=15 --lh=3 pair (72 vs 67, 3743 vs 3972 ms) — trunk alone swung Lighthouse 73 → 77 → 67 and TTI 3665 → 3499 → 3972 ms across its three runs. Interaction metrics overlap in every pair. The diff touches no measured code path (drawer-width edit → preview piece list is unchanged; the new work is one persisted settings key, a popover that renders only when opened, and an estimatePrint call that now takes the settings). Full numbers in docs/scoreboard.md.

Bundle delta: index chunk 231,700 → 235,321 B (+1.6%); lazy export chunk unchanged (21,444 B).

Scores

  • Parity: unchanged at 47.0% (22 ✅ + 3 🟡 / 50) — F31 stays ✅; the settings complete the feature rather than adding a row
  • Ease: estimates now match the user's actual filament and speed instead of fixed assumptions
  • Feature-map refresh 2026-10-28: andymai still 4.523.2, gridfinity-label-generator still 3.1.1, automaat still v0.6.0; no F1–F50 cell changes for any tool; no new Gridfinity planner tool found

Verification (for the reviewer / Lane B)

On the deploy preview, with the default 15×12in layout + Bambu Lab A1:

  • Print plan card shows ~4 h 2 min · ~144 g PLA · ~$2.88 with the footnote Rough estimate — PLA at 1.24 g/cm³, $20/kg, ~8 mm³/s.
  • Open "Estimate settings": switch to PETG → the line updates to ~4 h 2 min · ~147 g PETG · ~$2.95 (same time, grams and cost move with density); set price $25 → cost updates; set flow 16 → time halves; reload → settings persist; Reset to defaults → back to PLA / $20 / 8.
  • Core tasks 1–3 still pass; test-fit switch still works.

…flow on the Print plan card

The Print plan card's rough-estimate line now follows the user's own
filament: material (PLA/PETG/ABS), filament price ($/kg), and effective
flow rate (mm3/s) in a settings popover on the card. The line shows the
chosen material and the footnote states the active assumptions; the
settings persist as gridfinity_estimateSettings and are local-only, not
in share links. Defaults unchanged (PLA 1.24 g/cm3, $20/kg, ~8 mm3/s).

estimatePrint takes the settings; sanitizeEstimateSettings validates
stored values (unknown material falls back to PLA, price clamps to
$1-200/kg, flow to 1-50 mm3/s). F31 stays green; parity unchanged at
47.0% (22 green + 3 partial / 50). Perf vs trunk: no credible regression
(three same-day pairs; the first pair's load-metric gap flipped sign in
the third pair, trunk alone swung Lighthouse 73 -> 77 -> 67).

Feature map refreshed 2026-10-28: no competitor cell changes. F12/F44
blocked: drawer-preset research found only 1 of 7+ candidates
verifiable from a primary manufacturer source; IKEA publishes overall
dims only and Harbor Freight overall dims + volume only.
@netlify

netlify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for gridfinity-drawer-planner ready!

Name Link
🔨 Latest commit 71bfd0f
🔍 Latest deploy log https://app.netlify.com/projects/gridfinity-drawer-planner/deploys/6ae1ebacac39a731efb82d3a
😎 Deploy Preview https://deploy-preview-156--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 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.57143% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@fa2ae41). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/hooks/useGridfinitySettings.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #156   +/-   ##
=======================================
  Coverage        ?   93.88%           
=======================================
  Files           ?       71           
  Lines           ?     3567           
  Branches        ?     1050           
=======================================
  Hits            ?     3349           
  Misses          ?      197           
  Partials        ?       21           
Flag Coverage Δ
unittests 93.88% <98.57%> (?)

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 merged commit ffdcb77 into main Oct 28, 2026
33 checks passed
@ntindle
ntindle deleted the poteto/estimate-settings-20261028-0710 branch October 28, 2026 12:47
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