From 4c6415c2c406573c4e59c4047a9217cb7e6c34ae Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 20 Jun 2026 18:40:00 -0400 Subject: [PATCH] fix(watch-history): profile-pane delete was wired to a no-op (real fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit THE root cause of "watch history delete does nothing / card vanishes then pops back": the profile modal's history renderer overrode `remove` to route through onHistoryReady -> app.handleProfileHistoryEvent(), which is a stub that just `return null`. So deleting an item in the profile history pane published NOTHING — the card was removed optimistically, then the refresh re-rendered the full list and it reappeared. No publish, no logs, no relay change. This explains why earlier fixes (replace semantics, newest-per-d-tag read, empty-month publish) didn't help — they were all on the standalone history path / the publish layer, but the profile pane never reached any of them. The override was almost certainly a placeholder left over from the synced-vs-local history refactor that was never implemented. Fix: drop the broken `remove` override so the profile history pane falls through to the renderer's working default (defaultRemoveHandler -> snapshot + updateWatchHistoryList with replace:true) — the same path the standalone view uses. Validated manually (UI wiring); regression test to backfill. Build + full lint green. Co-Authored-By: Claude Opus 4.8 --- js/ui/profileModalController.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/ui/profileModalController.js b/js/ui/profileModalController.js index 47877445..d44ed442 100644 --- a/js/ui/profileModalController.js +++ b/js/ui/profileModalController.js @@ -957,12 +957,12 @@ export class ProfileModalController { sessionWarningSelector: "#profileHistorySessionWarning", emptyCopy: "You haven’t watched any videos yet.", variant: "modal", - remove: (payload) => - this.callbacks.onHistoryReady({ - ...(typeof payload === "object" && payload ? payload : {}), - controller: this, - renderer: this.profileHistoryRenderer, - }), + // NOTE: do NOT override `remove` here. The previous override routed removal + // to onHistoryReady -> app.handleProfileHistoryEvent(), which is a no-op + // stub — so deleting an item in the profile history pane published nothing + // (the card vanished optimistically then reappeared on refresh). Falling + // through to the renderer's default `remove` uses the working + // defaultRemoveHandler (publishes the reduced list with replace:true). }; return this.profileHistoryRendererConfig;