From e08e2d3ebb7a9425f11d49be2ac00126f1e24898 Mon Sep 17 00:00:00 2001 From: majiayu000 <1835304752@qq.com> Date: Wed, 31 Dec 2025 07:37:14 +0800 Subject: [PATCH 1/2] fix: preserve filter state when marking items as read or favourite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When marking an item as read or favourite while the list is filtered, the UI incorrectly showed "No items" because UpdateList() replaced all items and cleared the filter state. This fix updates only the specific item in place using SetItem(), which preserves the active filter and remaining filtered items. Fixes #154 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 Signed-off-by: majiayu000 <1835304752@qq.com> --- internal/commands/list.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/commands/list.go b/internal/commands/list.go index ff2e52f..8259b8a 100644 --- a/internal/commands/list.go +++ b/internal/commands/list.go @@ -213,7 +213,10 @@ func updateList(msg tea.Msg, m model) (tea.Model, tea.Cmd) { if err != nil { return m, tea.Quit } - m.UpdateList() + + // Update item in place to preserve filter state + current.Read = !current.Read + cmds = append(cmds, m.list.SetItem(m.list.Index(), current)) case key.Matches(msg, ListKeyMap.ToggleReads): if m.list.SettingFilter() { @@ -251,7 +254,9 @@ func updateList(msg tea.Msg, m model) (tea.Model, tea.Cmd) { return m, tea.Quit } - cmds = append(cmds, m.UpdateList()) + // Update item in place to preserve filter state + current.Favourite = !current.Favourite + cmds = append(cmds, m.list.SetItem(m.list.Index(), current)) case key.Matches(msg, ListKeyMap.ToggleFavourites): if m.list.SettingFilter() { From bdd13955a124baa1d128c81398590ea6e6234e77 Mon Sep 17 00:00:00 2001 From: lif <1835304752@qq.com> Date: Wed, 31 Dec 2025 23:04:03 +0800 Subject: [PATCH 2/2] fix: refresh list after read/favourite toggle --- internal/commands/list.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/commands/list.go b/internal/commands/list.go index 8259b8a..1de71e7 100644 --- a/internal/commands/list.go +++ b/internal/commands/list.go @@ -214,9 +214,7 @@ func updateList(msg tea.Msg, m model) (tea.Model, tea.Cmd) { return m, tea.Quit } - // Update item in place to preserve filter state - current.Read = !current.Read - cmds = append(cmds, m.list.SetItem(m.list.Index(), current)) + cmds = append(cmds, m.UpdateList()) case key.Matches(msg, ListKeyMap.ToggleReads): if m.list.SettingFilter() { @@ -254,9 +252,7 @@ func updateList(msg tea.Msg, m model) (tea.Model, tea.Cmd) { return m, tea.Quit } - // Update item in place to preserve filter state - current.Favourite = !current.Favourite - cmds = append(cmds, m.list.SetItem(m.list.Index(), current)) + cmds = append(cmds, m.UpdateList()) case key.Matches(msg, ListKeyMap.ToggleFavourites): if m.list.SettingFilter() {