diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-09-20 07:47:48 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-09-20 07:47:48 +0000 |
| commit | c5ab2f9a7f6a0b1e456e13934268d1509504c55a (patch) | |
| tree | bc1e74b6b07341246aaa71ee498b6c3513e2231d /web | |
| parent | b970be11ee895c34e019231022e9e5244e4aec2f (diff) | |
Drop Trello as a shopping source, importing the two groups worth keeping
The Trello "Shopping" board had become a dumping ground: of 24 cards, 13 had no
list at all (rendering as "Uncategorized"), and the rest were spread across
Costco, Hardware Store, "Perennial " (trailing space, so a separate store from
"Perennial") and online. Its items were read-only in doot — no rename, no move,
no delete, only hide — and its list names were doubling as an accidental store
registry, which is the only reason stores like Hardware Store existed at all.
Migration 032 imports the two groups asked for, Hardware Store and the unlisted
cards, into user_shopping_items. Costco, Perennial and online cards are left
behind. Nothing is destroyed: the cards remain in Trello, this only stops doot
displaying them. Imported rows become ordinary user items, so they also become
editable, which Trello-sourced items never were.
Trello remains the source for the other eight boards; this is only the Shopping
board feeding the shopping list.
Also updated the quick-action modal's Shopping tab, which posted source=trello
with a Trello list_id. Left alone it would have kept creating cards that no
longer appear anywhere. It now posts source=shopping with a store name, handled
by a new case in HandleUnifiedAdd, and its picker reads from a new
/partials/shopping-stores endpoint. The Trello-lists endpoint it used to call
is deleted along with its route.
Note for the edit feature still to come: stores have no existence independent
of items, so a store with nothing in it cannot be chosen. That was previously
masked by Trello's lists persisting. "Move between stores and sections" needs a
real stores/sections table.
Migration tested against a seeded snapshot of the real board, including the
trailing-space store name, other boards, replay safety and the empty-cache
no-op. Two existing tests asserting Trello check-state in shopping mode were
updated to plantoeat, the only remaining external source.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B
Diffstat (limited to 'web')
| -rw-r--r-- | web/templates/index.html | 15 | ||||
| -rw-r--r-- | web/templates/partials/shopping-mode-items.html | 3 | ||||
| -rw-r--r-- | web/templates/partials/shopping-tab.html | 4 |
3 files changed, 12 insertions, 10 deletions
diff --git a/web/templates/index.html b/web/templates/index.html index b11b557..f58c5e1 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -189,14 +189,14 @@ <form hx-post="/unified-add" hx-swap="none" hx-on::after-request="if(event.detail.successful) { this.reset(); closeActionModal(); htmx.trigger(document.body, 'refresh-tasks'); }"> - <input type="hidden" name="source" value="trello"> + <input type="hidden" name="source" value="shopping"> <input type="text" name="title" placeholder="Item name..." class="w-full bg-input border border-white/20 rounded-lg px-3 py-2 text-sm text-white placeholder-white/50 mb-3" required> - <select name="list_id" - id="shopping-list-select" + <select name="store" + id="shopping-store-select" class="w-full bg-input border border-white/20 rounded-lg px-3 py-2 text-sm text-white mb-3" required> <option value="">Loading stores...</option> @@ -244,9 +244,12 @@ } } function loadShoppingLists() { - var select = document.getElementById('shopping-list-select'); + // Stores, not Trello lists: the Shopping board is no longer a + // shopping source, so an item added to a Trello list would not + // have shown up in the list at all. + var select = document.getElementById('shopping-store-select'); if (select.options.length <= 1) { - fetch('/partials/shopping-lists') + fetch('/partials/shopping-stores') .then(function(r) { return r.text(); }) .then(function(html) { select.innerHTML = html; @@ -254,7 +257,7 @@ select.selectedIndex = 0; } }) - .catch(function(e) { console.error('Failed to load shopping lists:', e); }); + .catch(function(e) { console.error('Failed to load shopping stores:', e); }); } } // Keyboard shortcut: Ctrl+K or Cmd+K diff --git a/web/templates/partials/shopping-mode-items.html b/web/templates/partials/shopping-mode-items.html index 5dad772..c49b164 100644 --- a/web/templates/partials/shopping-mode-items.html +++ b/web/templates/partials/shopping-mode-items.html @@ -19,8 +19,7 @@ <!-- Source badge --> <span class="text-xs px-2 py-0.5 rounded flex-shrink-0 - {{if eq .Source "trello"}}bg-blue-900/50 text-blue-300 - {{else if eq .Source "user"}}bg-purple-900/50 text-purple-300 + {{if eq .Source "user"}}bg-purple-900/50 text-purple-300 {{else}}bg-green-900/50 text-green-300{{end}}"> {{.Source}} </span> diff --git a/web/templates/partials/shopping-tab.html b/web/templates/partials/shopping-tab.html index e68876f..9d49122 100644 --- a/web/templates/partials/shopping-tab.html +++ b/web/templates/partials/shopping-tab.html @@ -117,7 +117,7 @@ <li class="flex items-center gap-3 p-3 bg-card bg-card-hover transition-colors rounded-lg border border-white/5"> <span class="flex-1 text-white">{{.Name}}</span> {{if .Quantity}}<span class="text-white/50 text-sm">{{.Quantity}}</span>{{end}} - <span class="text-xs px-2 py-0.5 rounded {{if eq .Source "trello"}}bg-blue-900/50 text-blue-300{{else if eq .Source "user"}}bg-purple-900/50 text-purple-300{{else}}bg-green-900/50 text-green-300{{end}}"> + <span class="text-xs px-2 py-0.5 rounded {{if eq .Source "user"}}bg-purple-900/50 text-purple-300{{else}}bg-green-900/50 text-green-300{{end}}"> {{.Source}} </span> </li> @@ -161,7 +161,7 @@ <span class="text-xs px-2 py-0.5 rounded bg-white/10 text-white/50"> {{.Store}} </span> - <span class="text-xs px-2 py-0.5 rounded {{if eq .Source "trello"}}bg-blue-900/50 text-blue-300{{else if eq .Source "user"}}bg-purple-900/50 text-purple-300{{else}}bg-green-900/50 text-green-300{{end}}"> + <span class="text-xs px-2 py-0.5 rounded {{if eq .Source "user"}}bg-purple-900/50 text-purple-300{{else}}bg-green-900/50 text-green-300{{end}}"> {{.Source}} </span> </li> |
