fix(workspaces): persist visit recency server-side so sidebar order is stable on refresh - #8284
Conversation
…s stable on refresh
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
All reported issues were addressed across 24 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Fix all with cubic | Re-trigger cubic
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 24 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
…e column for contract
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 24 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 24 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
Summary
workspace_visittable (one row per user + workspace, last visit time);POST /api/workspaces/[id]/visitrecords a visit through a session-onlyworkspaces.visits.recordoperation, replacing the settings write the sidebar made on every visitscope), so rapid switching always leaves the last-opened workspace newestGET /api/workspacesreturns workspaces most recently visited first (then newest first) and deriveslastActiveWorkspaceIdfrom the latest visit, falling back to the legacy settings columnselect), so server render and hydration always agree and the order follows the user across devicesWorkspaceRecencyStorageanduseWorkspaceOrderworkspaces[0](the/workspaceredirect fallback, orphaned-workflow repair) now gets the most recently visited workspace instead of the newestFollow-up (after this is fully deployed): drop
settings.last_active_workspace_idand its settings API fields, once thesettingsfull-row inserts exclude it.Type of Change
Testing
Checklist
🤖 Generated with Claude Code