Commit Graph

7 Commits

Author SHA1 Message Date
iterminate 270acc0430 Fix XSS, CSRF, input validation, and related security issues 2026-04-14 16:00:50 -05:00
iterminate 60a8d64fbc Add PWA icons and favicon from source image 2026-04-14 02:19:48 -05:00
iterminate 39b52a3fa4 Replace browser confirm() dialogs with custom modal; add live label preview on battery add form
- base.html: add CSS/HTML/JS for styled in-app confirmation modal (dark-mode compatible via CSS vars)
- device_list, battery_detail: convert onsubmit confirm() to declarative data-confirm attributes
- dashboard: convert bulk Delete/Install buttons to use modal helpers (submitWithAction pattern)
- app.py: pass brand_counts dict to battery_add template
- battery_add.html: show live "Will create: Brand 001 → Brand 003" preview as brand/quantity change
- tests: add two tests covering brand_counts server-side rendering
2026-04-13 09:53:21 -05:00
iterminate 65596eee2b Add PWA support — installable as home screen app
Adds Web App Manifest, a minimal Service Worker, and Apple/Android meta
tags so the app can be added to a phone home screen and opens full-screen
in standalone mode (no browser chrome).

- static/manifest.json: name, short_name, display=standalone, icons
- static/sw.js: minimal SW served at /sw.js (root scope) via new Flask route
- static/icon-192.png, icon-512.png: generated by sbin/gen_icons.py (stdlib only)
- base.html: manifest link, theme-color, apple-mobile-web-app-* tags, SW registration
2026-04-13 04:28:11 -05:00
iterminate 768f83f63a Add dark mode, simplify nav, and UI polish
- Dark mode via prefers-color-scheme: pure CSS, no JS, follows OS setting
- CSS custom properties for all colors; dark palette redefines variables
- Nav: brand is now a home link, Dashboard link removed, nowrap keeps
  it single-line on mobile; compact padding at 640px breakpoint
- Battery health % uses CSS classes (health-good/warn/bad) instead of
  inline Jinja colors — readable in both light and dark modes
- Stat card counts use CSS color variables for dark mode support
- Fix duplicate display:none on bulk toolbar
- input[type=date] added to themed input selector
2026-04-12 22:55:23 -05:00
iterminate 3bc897c1e5 Add device_type field, mobile-friendly improvements, and device filtering
- Device model: add device_type column (String 50, nullable)
- Device add/edit: type select with presets + custom entry
- Device detail: show type in info card; new Edit Device form
- Device list: Type column + client-side filter bar (type + text search)
- Mobile: card-style responsive tables on dashboard and device list,
  form-grid-2col collapse, larger tap targets, stacked form-actions,
  column picker viewport fix, filter bar full-width controls
- Assign page: larger radio touch targets (min-height 44px)
- 3 new acceptance tests for device_type (45 total)
2026-04-12 22:02:29 -05:00
iterminate 6ea3eae981 Initial commit: Flask battery tracker app
- Flask + SQLAlchemy (MariaDB-compatible schema) battery tracking web app
- 40 pre-seeded batteries (Eneloop, BONAI, Energizer NiMH) across 5 devices
- Business rules: block retired assignment, brand-mix warnings, capacity checks
- Mobile-friendly Jinja2 templates with inline CSS
- waitress WSGI server via systemd user service (sbin/install-service.sh)
- SQLite → MariaDB migration script (migrate_to_mariadb.py)
- 26 passing acceptance tests (pytest + Flask test client)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 22:38:16 -05:00