Return to the last visited session instead of the first site#4130
Open
bcotrim wants to merge 3 commits into
Open
Return to the last visited session instead of the first site#4130bcotrim wants to merge 3 commits into
bcotrim wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing 6b53f3a vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
Contributor
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.


Related issues
How AI was used in this PR
The core change was cherry-picked from #3998 (authored there with AI assistance). Claude Code ported it onto trunk, resolved the one merge conflict, and wrote the unit tests for the redirect/validation logic. All code was reviewed and verified locally (lint, typecheck, apps/ui test suite).
Proposed Changes
Studio's agentic UI always lands on the first site's newest session at launch, regardless of where the user was working. This PR makes the app reopen where the user left off:
localStorage./index route redirects back there — after validating against live data. If the last visited session is gone or archived, it falls back to the last visited site's newest active session; if that site is gone too, to the existing default (first site's newest active session).No launch-time cost: the index route already fetched sites and sessions before redirecting; this adds only a synchronous
localStorageread.Notes:
Testing Instructions
Pre-merge Checklist
🤖 Generated with Claude Code