Grocery Lists - JRAdams472/LENA2 GitHub Wiki
Grocery Lists
Grocery lists turn a meal plan into a shopping trip — generated automatically, checked off as you shop. No plan? A list works on its own too.
Creating a list
Three ways:
- From a weekly meal plan page — Generate Grocery List (web)
- From the Grocery Lists page — Create and pick a plan from the dropdown (web and mobile both offer the same picker)
- From the Grocery Lists page — Create and leave the default Manual list (no meal plan) selected
A manual list starts empty — type staples, a hardware run, whatever isn't food on a plan. Manual and generated lists sit side by side on the index, labeled by their source plan's name or "Manual list".

Generating for a plan that already has a list updates that list in place — the generated lines are recomputed against the current plan and pantry stock, and anything you added manually stays. You won't end up with two lists for the same week. Your store layout and manual ordering also survive regeneration — they live outside the list's rows.

Each line keeps a source note — whether it came from the meal plan, a restock suggestion you tapped Add on, or something you typed in yourself — but the list's grouping comes from store routing (below), not the source.

Store routing
Pick a store in the header and the list groups itself into that store's aisles, in walk order — the route you'd naturally take through the store. Items with no aisle land in Other items at the bottom.
- Edit aisles (web) — name and order the store's aisles to match how you actually walk it.
- Rearrange — web: drag the handle on the left of a row; mobile: drag within an aisle, or use the row's menu to move between aisles. Dropping an item into a different aisle's group assigns it there. Your arrangement is saved on the server and survives list regeneration — the phone shows the same order as the web.
- Learning — the order you check items off is remembered per store, so over time the generated order converges on your real route. Items the system has only guessed an aisle for show a "suggested aisle" hint; dragging or assigning them makes it permanent.



New lists inherit the store your household used most recently — set it once and routing just applies.
Time to restock
Below the list proper, the Time to restock card proposes pantry items that are at or under their minimum quantity, ranked by how often your household uses them. Tap Add to drop one onto the list — it lands in the unassigned group, and since it's now on the list it stops being suggested.
Items you never engage with don't clutter the section: a suggestion needs both low stock and household usage signals.
Shopping with the list
Open the list and check items off as you go — each check saves immediately, so if your partner is holding the same list on their phone, they see the check appear.
- Check/uncheck — tap the checkbox
- Delete a line — trash icon, for things you decided not to buy
- Add a manual item — name, quantity, and unit; lands in the unassigned group until you give it an aisle
If you're both shopping at once, keep the list open — checks sync in real time.
Shop with Instacart
When the server has a shopping provider configured, a Shop with Instacart button appears in the list header. Tap it and LENA pushes the list's unchecked lines to Instacart, then shows you a shareable link — open it in a new tab to pick a store and check out on Instacart's site, or copy it to send to whoever's doing the shop. Nothing is silently added to a cart: the link opens a shopping list on the provider's side, and the purchase decision stays yours.

Lines named by a catalog item or remembered usual brand carry UPCs and a brand filter, so the link lands on the right product more often than not. Checked lines are left off the link by default — if your list had any when you pressed the button, the dialog says so.

The button only renders when shopperProviders reports a configured provider (server-side LENA_INSTACART_API_KEY), so deployments without a key never show a dead action.
Ingredients and usual brands
Lines that came from ingredient-keyed recipe lines display the ingredient name rather than a product — garlic instead of Ahold Garlic Salt. Lines with a remembered brand show a "usually buys …" caption so you know which product to grab.
The first time you check off an ingredient-only line, LENA asks which brand you bought — pick it and the pantry is credited with that item, and it becomes your household's usual brand for that ingredient. After that, the line checks straight off. You can also check off without a brand to stay generic.

Lines that conflict with a household member's allergy records carry a warning chip too — check it before something risky ends up in the cart.
What's on the list vs. in the pantry
The generator already subtracts your pantry stock from each recipe's needs — if the plan needs 2 lb of potatoes and you have 2 lb on hand, the line never appears. So the more honest your pantry counts are, the shorter and more accurate your list gets. Stock recorded in a different unit is converted when the units are compatible; when they aren't, the full amount stays on the list.
After the trip
Checked items stay checked as a record of the trip. When you unpack, open the mobile app's Scan tab and scan barcodes to add purchases to pantry stock — that's what keeps the stock subtraction accurate next week.