From 78670268d553bbded4784d3a8c60a15815e18c67 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Tue, 19 May 2026 15:16:55 +0100 Subject: [PATCH] ML-169.5: cancel task as it breaks functionality --- ...oggle-grid-list-triggers-full-DB-reload.md | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) rename backlog/{ => archive}/tasks/ml-169.5 - Fix-Display-toggle-grid-list-triggers-full-DB-reload.md (57%) diff --git a/backlog/tasks/ml-169.5 - Fix-Display-toggle-grid-list-triggers-full-DB-reload.md b/backlog/archive/tasks/ml-169.5 - Fix-Display-toggle-grid-list-triggers-full-DB-reload.md similarity index 57% rename from backlog/tasks/ml-169.5 - Fix-Display-toggle-grid-list-triggers-full-DB-reload.md rename to backlog/archive/tasks/ml-169.5 - Fix-Display-toggle-grid-list-triggers-full-DB-reload.md index 7a8c6704..ac4b82cc 100644 --- a/backlog/tasks/ml-169.5 - Fix-Display-toggle-grid-list-triggers-full-DB-reload.md +++ b/backlog/archive/tasks/ml-169.5 - Fix-Display-toggle-grid-list-triggers-full-DB-reload.md @@ -1,9 +1,10 @@ --- id: ML-169.5 title: "Fix: Display toggle (grid/list) triggers full DB reload" -status: To Do +status: Done assignee: [] created_date: "2026-05-19 11:45" +updated_date: "2026-05-19 15:13" labels: - perf - fix @@ -56,3 +57,36 @@ Remove the `load_and_assign_records` call from `handle_set_display`. Only `assig - [ ] #3 List view renders correctly after toggle - [ ] #4 No regression in search/filter functionality after toggle + +## Archive Reason + + + +Archived after validation showed the proposed optimization is not correct with the current +LiveView stream rendering structure. + +Collection and wishlist render either `<.record_grid>` or `<.record_list>` behind +mutually exclusive `:if` branches, and both components consume the same `@streams.records` +stream. LiveView stream entries are consumed after render and the existing DOM holds the +streamed children. When the display mode changes, the previously mounted stream container +is removed and a different stream container is mounted. Without re-running +`stream(:records, records, reset: true)`, the newly mounted container has no queued stream +entries to insert, so only its static empty-state node remains and `only:block` displays +“No records yet”. + +The DB reload avoided by this task is therefore also the step that rehydrates the stream +for the newly mounted container. A future optimization would need a different rendering +shape, such as keeping both containers mounted or avoiding conditional stream container +replacement, before removing the reload. + + + +## Final Summary + + + +Reverted the proposed `handle_set_display/2` change and archived this task as not +actionable in the current UI structure. The reload is required because grid/list toggling +replaces the mounted stream container. + +