diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-09 01:19:08 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-09 01:19:08 -0700 |
| commit | 75ce40635736260ce5a19b7a33856305ee516ccc (patch) | |
| tree | 9db3931eae3dbd9308bab0e240e7c75950bcbd4c /static/index.html | |
| parent | 3de7c5eed5ba262abf0d746211e33800db6d66df (diff) | |
Simplify pantry UX and persist grocery check state server-side
- Remove quantity, unit, expiry, and category fields from pantry form; auto-detect category via keyword map
- Persist grocery item checked/unchecked state in DB via PATCH /api/grocery/{id}/check-item
- Fix unchecking: previously bailed early and never removed the checked class
- Fix NOT NULL constraint on ingredients.unit by defaulting to empty string
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'static/index.html')
| -rw-r--r-- | static/index.html | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/static/index.html b/static/index.html index d0e0243..ae36a4f 100644 --- a/static/index.html +++ b/static/index.html @@ -33,29 +33,14 @@ <h3>Add Ingredient</h3> <div class="form-row"> <div class="form-group"><label>Name</label><input type="text" id="ing-name" placeholder="e.g. Chicken Breast"></div> - <div class="form-group"><label>Quantity</label><input type="number" id="ing-qty" step="0.1" placeholder="500"></div> - <div class="form-group"><label>Unit</label><input type="text" id="ing-unit" placeholder="grams"></div> - <div class="form-group"><label>Category</label> - <select id="ing-category"> - <option value="">None</option> - <option value="produce">Produce</option> - <option value="protein">Protein</option> - <option value="dairy">Dairy</option> - <option value="pantry">Pantry</option> - <option value="frozen">Frozen</option> - <option value="bakery">Bakery</option> - </select> - </div> - <div class="form-group"><label>Expiry Date</label><input type="date" id="ing-expiry"></div> </div> <div class="form-actions"> <button class="btn btn-primary" id="btn-save-ingredient">Save</button> <button class="btn" id="btn-cancel-ingredient">Cancel</button> </div> </div> - <div id="expiry-warning-banner" class="hidden"></div> <table id="pantry-table"> - <thead><tr><th>Name</th><th>Quantity</th><th>Unit</th><th>Category</th><th>Expires</th><th>Actions</th></tr></thead> + <thead><tr><th>Name</th><th>Category</th><th>Actions</th></tr></thead> <tbody id="pantry-tbody"></tbody> </table> <div id="pantry-empty" class="empty-state hidden">No ingredients yet. Add some to get started.</div> |
