fix(pad): remove deleted pads from the welcome screen recent list - #8237
JohnMcLear wants to merge 2 commits into
Conversation
When the server disconnects a pad with reason "deleted", remove that pad from the recentPads localStorage list so the homepage stops showing it (and stops offering a link that silently recreates it). Covers the creator delete button, the recovery-token path, and other tabs that were open on the pad. Fixes #8201 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012kA75NPq8nGRidAwhPXeCi
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoRemove deleted pads from the welcome screen recent list
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
Older versions stored URL-encoded pad names in recentPads; normalize each stored name with the same guarded decodeURIComponent the welcome screen uses before comparing, so those entries are removed too (Qodo review). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012kA75NPq8nGRidAwhPXeCi
Fixes #8201
Root cause
The welcome page's "Recent pads" list is rendered purely from the
recentPadsentry inlocalStorage(src/static/skins/colibris/index.js). The pad page adds and updates entries (skins/colibris/pad.js,pad_userlist.ts), but nothing ever removed one. Deleting a pad (creator button or recovery token) redirected to the homepage, which still listed it, and clicking it recreated an empty pad.Fix
In
src/static/js/pad.ts, when the server sends{disconnect: 'deleted'}(broadcast to every socket on the pad byPadMessageHandler.deletePad), the client removes the current pad fromrecentPadsbefore showing the disconnect modal. This handles:The name is derived from the URL path, exactly as the entry was stored, and stored names are also compared after the same guarded
decodeURIComponentthe welcome screen applies (legacy encoded entries); storage access is wrapped in try/catch.Out of scope: a pad deleted via the HTTP API or admin UI while this browser had no tab open will still be listed until visited, since the list is client-side only.
Tests
New Playwright spec
src/tests/frontend-new/specs/recent_pads_delete.spec.ts:#delete-pad-> homepagerecentPadsno longer contains the pad and no.recent-padlink for it is rendered;FRONTEND_TESTS_notes%26ideas_..., as older versions stored) is removed as well (follow-up from Qodo review; fails without the name normalization).Before the fix (develop), both failed:
After the fix: all three pass on chromium and firefox. Related specs (
recent_pads,pad_deletion_token,pad_settings,delete) pass on chromium (16/16).Backend mocha: 1673 passing, 22 pending, 0 failing. Vitest: 840/840 passing.
tsc --noEmitclean for the touched files.🤖 Generated with Claude Code
https://claude.ai/code/session_012kA75NPq8nGRidAwhPXeCi