Commit Graph
11 Commits
Author SHA1 Message Date
thePR0M3TH3ANandClaude Opus 4.8 5f19f53670 fix(watch-history): removal must replace the list, not merge it back
Root cause of "watch history delete does not work at all": the removal paths
call watchHistoryService.snapshot(remaining, …), but snapshot published via
updateWatchHistoryList WITHOUT replace:true. The default merges incoming items
with the existing cached list, so the just-removed item was merged straight back
and the deletion silently had no effect. Removing the LAST item was worse: an
empty list fell through to republishing the pending queue instead of clearing.

- snapshot now honors options.replace: forwards it to updateWatchHistoryList,
  treats an explicit empty replace as a clear (publishes empty instead of
  short-circuiting or falling back to the queue), and skips the cached-items
  merge when replacing. Adds (the default) keep merge semantics.
- Both removal call sites (watchHistoryController.handleWatchHistoryRemoval and
  historyView.defaultRemoveHandler) now pass replace:true.

Tests (snapshot at the updateWatchHistoryList boundary): removing an item
publishes the remaining list with replace:true; removing the last item publishes
an empty replace (not a queue republish / no-op); a normal watch-tracking
snapshot still merges (replace not forced). Mutation-verified — dropping the
replace forwarding fails 2 cases and reverting the empty-clear handling fails the
clear case.

Build + full lint green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-20 12:52:15 -04:00
thePR0M3TH3AN a5562b4707 Refactor watch history helpers to new module 2025-10-22 14:08:47 -04:00
thePR0M3TH3AN 26b9bc9dc7 Handle NIP-07 permission failures when loading watch history 2025-10-15 22:51:52 -04:00
thePR0M3TH3AN 0a2a2c4e78 Fix syntax errors blocking app bootstrap 2025-10-15 15:08:55 -04:00
thePR0M3TH3AN 7ae07b1369 refactor: migrate console usage to shared loggers 2025-10-15 14:37:25 -04:00
thePR0M3TH3AN d705cf176b Revert "Refactor logging to centralized logger" 2025-10-15 11:14:10 -04:00
thePR0M3TH3AN 37ba57aa37 Refactor logging to centralized logger 2025-10-15 11:11:14 -04:00
thePR0M3TH3AN 8265f9e2de Add design system feature flag and runtime integration 2025-10-11 16:11:43 -04:00
thePR0M3TH3AN 22cb57ccec Align modals with refactored markup 2025-10-10 13:12:19 -04:00
thePR0M3TH3AN 10751a8fb9 Improve watch history loading responsiveness 2025-10-08 07:33:44 -04:00
thePR0M3TH3AN 9d7efce44e Refactor watch history actions into controller 2025-10-08 07:16:26 -04:00