Skip to content

feat(web): show archived banner in-place on live archive (TASK-1833)#736

Merged
xarmian merged 1 commit into
mainfrom
feat/task-1833-inplace-archive-banner
Jun 15, 2026
Merged

feat(web): show archived banner in-place on live archive (TASK-1833)#736
xarmian merged 1 commit into
mainfrom
feat/task-1833-inplace-archive-banner

Conversation

@xarmian

@xarmian xarmian commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

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_archived and sync-resume deleted handlers still goto()'d away.

Changes (one file: the detail route +page.svelte)

  • SSE item_archived: re-fetch the item (GET returns soft-deleted items with deleted_at, fix(items): surface archived items instead of masking them as missing (BUG-1791) #733) and show the banner in place, instead of goto().
  • Sync-resume 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.
  • Mid-edit guard: both keep the prior redirect when saveStatus === 'saving' || editingTitle || editorStore.dirty. The editorStore.dirty check 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).
  • 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.

Tests

  • cd web && npm run check (svelte-check): 0 errors.
  • Production web build (make web) green.
  • Codex review loop: CLEAN (round 1 → widen the mid-edit guard to include the editor dirty flag).

Final piece of the BUG-1791 follow-through (#733 / #734 / #735 + this).

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.
@xarmian
xarmian merged commit 8c8e858 into main Jun 15, 2026
4 checks passed
@xarmian
xarmian deleted the feat/task-1833-inplace-archive-banner branch June 15, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant