MadeInPierre / MadeInPierre/cuicuit
Shopping cooldown for long-shelf ingredients
Nobody has claimed this yet.
- Dominant language
- Svelte
- Stars
- 49
- Forks
- 0
- Avg merge
- 28m
- Merged PRs (30d)
- 1
Description
Many ingredients can be bought once and then used for several weeks such as salt and spices. Add a constant cooldown number of days for these ingredients database table to avoid seeing them everytime we do groceries. To start, all ingredients categorized as spices using the hierarchy column could get a default 30 days cooldown, with manual adjustments later.
Then, hide these in the shopping list in a muted small collapsible zone titled "+6 you probably have >".
TODO How should the status be calculated? By a query or by the client? Draft proposal:
- Keep the existing "get all shopping items" query
- Add a new "get the last time each ingredient has been bought in this space" query
- Join on the client when generating the shopping list (adds an
at_homefield on each combined shopping item with values such as "home" | "cooldown" | "missing"). "home" would never happen for now as we don't have pantry management, but might in the future if one day we know for sure the user has the ingredient at home. For now only "maybe" and "missing" applies depending on the cooldown. - Hence, ingredients would use the fixed cooldown and the last bought time to guess if a user probably has the ingredient at home or not. If no cooldown, always assume "missing".
I am tempted to let the client join data instead of the database to reduce database pressure and loading latency, but TBD.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing the existing shopping-list query and the client-side shopping-list generation, then resolve how cooldown status should be calculated and joined. Done means spice ingredients use a 30-day cooldown and the shopping list displays matching items in the proposed collapsible muted section.
Written by the indexing model from the issue text.
Assessment
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100