feat: revised category icons + unknown type detection #54

Closed
opened 2026-05-31 04:31:24 +00:00 by shawn · 0 comments
Owner

Changes

Cleaner icon definitions

  • Removed dead CATEGORY_MAP entries (Furniture, GF Bev, Snack/bev, Snack/food)
  • Fixed duplicate Food key
  • Added categoryInfo() helper with 3-way fallback: mapped icon, for unmapped, 📦 for null
  • New icons: 🥤 Bev, 🍿 Snack, 🍔 Food, 🔧 Equipment, 🔌 Appliances, 📦 Other
  • Added category icon to detail view, scan result, and OCR result headers

Unknown type detection (main app)

  • Unmapped categories render as with red background instead of first-letter fallback

DB sync

  • Added Equipment/Appliances to categories lookup table with proper icons
  • Removed unused Unknown category
  • Updated seed data in server.py to match real asset categories

Admin server

  • Added category_health field to /api/stats endpoint
  • Category Health card on dashboard (red warning, shown only when unmapped categories exist)

Files

server.py, static/index.html, assets.db

Verification

  • All 6 categories render with correct icons in list, map, and detail views
  • Settings page shows icons for all categories
  • Admin dashboard hides health card when all categories mapped
  • Admin dashboard shows health card with unmapped count when categories are missing from lookup table
## Changes ### Cleaner icon definitions - Removed dead CATEGORY_MAP entries (Furniture, GF Bev, Snack/bev, Snack/food) - Fixed duplicate Food key - Added categoryInfo() helper with 3-way fallback: mapped icon, ❓ for unmapped, 📦 for null - New icons: 🥤 Bev, 🍿 Snack, 🍔 Food, 🔧 Equipment, 🔌 Appliances, 📦 Other - Added category icon to detail view, scan result, and OCR result headers ### Unknown type detection (main app) - Unmapped categories render as ❓ with red background instead of first-letter fallback ### DB sync - Added Equipment/Appliances to categories lookup table with proper icons - Removed unused Unknown category - Updated seed data in server.py to match real asset categories ### Admin server - Added category_health field to /api/stats endpoint - Category Health card on dashboard (red warning, shown only when unmapped categories exist) ## Files server.py, static/index.html, assets.db ## Verification - All 6 categories render with correct icons in list, map, and detail views - Settings page shows icons for all categories - Admin dashboard hides health card when all categories mapped - Admin dashboard shows health card with unmapped count when categories are missing from lookup table
shawn self-assigned this 2026-05-31 04:31:24 +00:00
shawn closed this issue 2026-05-31 04:31:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shawn/canteen-asset-tracker#54