feat(web): show archived banner in-place on live archive (TASK-1833)#736
Merged
Conversation
Follow-up to TASK-1829 (Codex review of #735). When the open item was archived live — via the SSE item_archived handler or the sync-resume deleted path — the detail route redirected back to the collection, so the new in-place Archived banner only appeared on a fresh direct load. Now both handlers re-fetch the item (GET returns soft-deleted items with deleted_at, #733) and render the banner in place. - SSE item_archived: re-fetch and show the banner instead of goto(). - Sync-resume deleted: re-fetch — an archived item (still resolvable, 200) shows the banner; a hard-deleted one (404) still redirects. - Both keep the prior redirect when mid-edit (saveStatus==='saving' || editingTitle): an in-flight save against an archived row would fail and a re-fetch would clobber the editor (the original Codex-round-2 reasoning). - Race guards mirror the handlers' existing pattern (capture item id before await, bail if navigated away). The actor's own archive still navigates via handleDelete's goto; this only changes the someone-else-archived-it case. svelte-check + web build green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes TASK-1833 (the deferred Codex-High from #735, folded in per request). Completes the in-place archived flow: when the OPEN item is archived live (another tab/user, or a sync resume), the detail route now shows the in-place Archived banner instead of redirecting back to the collection.
Before this, the in-place banner (from #735) only appeared on a fresh direct load of an already-archived item — the SSE
item_archivedand sync-resumedeletedhandlers stillgoto()'d away.Changes (one file: the detail route
+page.svelte)item_archived: re-fetch the item (GET returns soft-deleted items withdeleted_at, fix(items): surface archived items instead of masking them as missing (BUG-1791) #733) and show the banner in place, instead ofgoto().deleted: re-fetch — an archived item (still resolvable, 200) shows the banner; a hard-deleted one (404) still redirects. This distinguishes archive from hard-delete without parsing the sync lists.saveStatus === 'saving' || editingTitle || editorStore.dirty. TheeditorStore.dirtycheck is the key correctness bit — content edits set dirty immediately but the save is debounced 1.2s, so without it a live archive in that window would re-fetch and clobber unsaved content (Codex P1, round 1).handleDelete'sgoto; this only changes the someone-else-archived-it case.Tests
cd web && npm run check(svelte-check): 0 errors.make web) green.Final piece of the BUG-1791 follow-through (#733 / #734 / #735 + this).