Conversation
Archive opens a draft in the archived thread's project, but while that navigation loaded, the shell stream dropped the archived thread and the route's missing-thread redirect replaced it with the index, which opens a draft in the most recently active project instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The change preserves an in-progress navigation when the open thread becomes missing, keeping archive navigation on the project's draft. Its scope is limited to the client-side fallback redirect, with no changes to stored data or archive behavior. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…ject-draft Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ands first When the shell drops the archived thread before the archive reply arrives, the missing-thread effect replaces the route with / and archive's href check took that as the user leaving, so the index opened the most recently active project's draft. Archive now watches history like delete does: only a non-REPLACE entry during the request counts as the user navigating away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceCreate alpha and its one-message Old alpha thread; then create beta and its newer one-message Recent beta thread. Open alpha directly, right-click its sidebar row, choose Archive thread, wait for the New thread composer and another 1.5 seconds, then inspect the project heading. Environment on both sides: real web dev app, automated Chromium, 1280×800, light theme; fresh synthetic projects and Replay (dev) turns. Scenario: Archiving the open alpha thread keeps the new draft in alphaProven: the scenario fails on base 276d1ee5fa and passes on head f8476b541d.
Not shown:
|





Problem
Archiving the thread you have open is meant to leave you on a new-thread draft in that thread's project. When another project has more recent activity, you land on a draft in that other project instead. If you then type a message, it starts a thread in the wrong project.
Archive starts the draft navigation (
handleNewThreadinuseThreadActions.archiveThread). While that navigation is still loading, the shell stream drops the archived thread. The route matches still name the archived thread, so the missing-thread redirect inThreadRouteViewfires withnavigate({ to: "/", replace: true }). That replaces the in-flight draft navigation, and the index opens a draft in the most recently active project.Change
ThreadRouteViewskips the missing-thread redirect while a navigation is loading (useRouterState({ select: (state) => state.isLoading })).navigatingis in the effect's dependencies, so a thread that is still missing once the navigation settles redirects as before. This covers a direct link to an archived or deleted thread, and a thread deleted from another client.Scope
apps/web, a small fix for an obvious bug, so it needs no issue under CONTRIBUTING.md.Verification
scenarios:provewith the scenario below: the scenario fails on baseb46456401band passes on head74cdfadb49.alphaandbeta. An oldalphathread is open, andbetahas the most recent thread.alphathread from its context menu.beta(expected "beta" to be "alpha"). With the fix it is inalpha.main)vp run check:changedpasses: format, lint, knip, typecheck (2 packages), react compiler.ThreadRouteViewhas no test, anduseThreadActions.undo.test.tsmocks the router, so it can't see the redirect. A browser test would need a real router with a gatedbeforeLoadand about eight mocked entity hooks. I used the real-app scenario as the proof instead. I can add the browser test if you want a regression guard.isLoadingin router-core:onReadyor a redirect, so it can't get stuck and suppress the redirect for good.Scenario source (
scripts/scenarios/archive-open-thread-keeps-its-project.e2e.ts)Written by Claude Opus 5.5 in Claude Code (running in T3 Code), with Claude Fable 5.2 subagents for finding the bug and code review.
🤖 Generated with Claude Code