fix(watch-history): profile-pane delete was wired to a no-op (real fix)

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 <[email protected]>
This commit is contained in:
thePR0M3TH3ANandClaude Opus 4.8 committed 2026-06-20 18:40:00 -04:00
1 parent eeacf592dd
commit 4c6415c2c4
1 file changed
+6 -6
+6 -6
View File
@@ -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;