You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pantry Add item dialog can't create a new section once the pantry has items #628
In the web pantry, once the pantry has at least one item, the Add item dialog can no longer create a new section. The Section list only offers the sections already in pantry.conf, so with a single [fridge] section, every new item has to go to the fridge.
Cause
08233b7 ("fix: use existing sections in pantry Add Item form", for #293) changed the select in templates/pantry.html to:
the five default sections (freezer, fridge, pantry, spices, other) only while the pantry is empty
otherwise, only the existing sections
Showing the user's own sections was right for #293, but there is no longer any way to pick or type a section that isn't in the file. The server is fine: POST /api/pantry/add creates a section that doesn't exist yet.
Steps to reproduce
Start with a pantry.conf containing only [fridge] with one item, or an empty pantry where you add one item to "Fridge".
Open Pantry → Add item.
The Section list offers only "fridge". There's no way to add to a "Spices" or "Wine cellar" section.
Suggested fix
Add a "New section…" option to the list that reveals a text field for the name. Also URL-encode the section in the item edit/delete requests, which currently put it into the path unencoded, so typed names with spaces, / or accents keep working.
Activity
fix(pantry): let the Add item form create a new section
fix(pantry): let the Add item form create a new section
feat(pantry): new sections from Add item, rename sections, edit pantr…