Create a shopping list app #22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rename the 'react' app to 'expenses-react', and reuse it as the starting point for 'shopping-list-react'.
Also rename the other expenses apps to have the 'expenses-' prefix.
This app should explore the use of a hidden 'position' attribute on shopping list items, and the user should be able to drag items up and down in the list. Other than the experiment of how to store an array of items in Nextgraph ORM, this app doesn't need a lot of functionality, you don't need to include the categories that the expenses app has, and a shopping list item can just be a single text field and a 'remove' (-) button.
for the ordering, use drag-and-drop html UI
under last item there should be an empty item where users can add an item, just like in google keep lists
Shopping list screencast: adding items, editing Milk to Oat milk, dragging Apples to the top, removing Bread, and adding Rice.
Watch/download the screencast
Recorded using the app’s in-memory test engine; this demonstrates the UI and ORM integration, not native wallet persistence or network synchronization. Implemented and merged in #25.
Each shopping item is a separate RDF record. The ShEx schema is:
Example:
titleposition"Apples""Oat milk""Coffee"Each record has a unique RDF subject ID (
@id) and belongs to the selected NextGraph graph (@graph). The UI hidespositionand sorts by it. Dragging rewrites positions as consecutive integers through the ORM.If two entries have the same
position(for example after concurrent edits), both remain visible and their RDF subject IDs provide a deterministic tie-breaker: clients with the same records display the same order. Equal positions are not automatically rewritten merely by reading the list. The next actual reorder assigns consecutive positions to all currently visible items; concurrent writes can still introduce ties again.The list is represented by individual records with ordering metadata, rather than an RDF collection or a stored array.
michielbdejong referenced this issue2026-10-12 14:54:23 +02:00