2 Commits

Author SHA1 Message Date
Devon Bontrager fc88d7ab4b v1.2.0 — Multi-piece, NMFC lookup, PDF export, defaults, CSV history, density gauge + bug fixes
Features added:
- Multi-piece support: add unlimited pieces each with L x W x H x Weight, combined class from total density
- NMFC commodity lookup: 55 bundled items, live search by name or code
- PDF export: branded PDF with piece table, Cu Ft, PCF, freight class via jsPDF
- Default piece preset: save a standard pallet size in Settings > Defaults
- Export/import history as CSV
- Density gauge: color gradient bar with live marker in results panel
- Unit toggle: in/cm and lbs/kg with live conversion across all pieces
- Copy to clipboard, timestamps in history, Enter key shortcut, input validation
- Charcoal dark mode

Bug fixes:
- PDF and Copy now blocked before a calculation is performed
- History restore no longer misconverts values when units differ from stored unit
- History display shows correct unit labels (cm/kg) instead of hardcoded in/lbs
- PDF logo format auto-detected from data URL (fixes silent failure for JPG uploads)
- Removed dead parsedPieces variable; forEach with early return prevents NaN accumulation
- Removed no-op placeholder update in applyUnitToggleUI
- CSV export URL revocation deferred to avoid race condition

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 10:54:52 -04:00
Devon Bontrager 25973cabbc Add Lucide icons, web server, and settings page cleanup
- Replace emoji icons with Lucide SVG icons (moon, sun, settings, x, upload, rotate-ccw, trash-2, save)
- Add Node.js dev server on port 3010 (server.js + npm run serve)
- Redesign settings modal: tabbed layout, styled form fields, Save/Cancel footer
- Fix dark mode: btn-danger hover now uses rgba instead of hardcoded light pink
- Fix stale pendingBranding: history item click now calls revertAndClose()
- Collapse branding header when no name/logo is set
- Move density row inline style to .density-info CSS class
- Normalise all innerText to textContent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 15:57:19 -04:00
3 changed files with 1021 additions and 203 deletions
+985 -202
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -5,7 +5,8 @@
"main": "main.js",
"scripts": {
"start": "electron .",
"build": "electron-builder --win"
"build": "electron-builder --win",
"serve": "node server.js"
},
"author": "",
"license": "ISC",
+34
View File
@@ -0,0 +1,34 @@
const http = require('http');
const fs = require('fs');
const path = require('path');
const PORT = 3010;
const mimeTypes = {
'.html': 'text/html',
'.js': 'application/javascript',
'.css': 'text/css',
'.png': 'image/png',
'.ico': 'image/x-icon',
'.json': 'application/json',
};
const server = http.createServer((req, res) => {
const filePath = path.join(__dirname, req.url === '/' ? 'index.html' : req.url);
const ext = path.extname(filePath);
const contentType = mimeTypes[ext] || 'application/octet-stream';
fs.readFile(filePath, (err, data) => {
if (err) {
res.writeHead(404, { 'Content-Type': 'text/plain' });
res.end('404 Not Found');
return;
}
res.writeHead(200, { 'Content-Type': contentType });
res.end(data);
});
});
server.listen(PORT, () => {
console.log(`Freight Calculator Pro running at http://localhost:${PORT}`);
});