Repository navigation
Add saved session navigation and deletion - #336
Conversation
Agents call MCP tools with a session ID, and the server delivers each command to the first tab that opened that session. Each command is one file under apps/server/src/commands, registered once for both the MCP tool and the tab's executor, and replies with the whole session snapshot. Sessions load and save through /api/sessions/:id independently of the command stream, which Settings can turn off. The browser lives at /browser/[sessionId], and Next.js rewrites /api and /mcp to the server in place of the hand-written proxy.
# Conflicts: # apps/server/README.md # apps/server/src/http/routes.ts # apps/server/src/protocol.ts # apps/server/src/storage/sessionRepository.ts # apps/server/src/storage/sqlite.ts # apps/server/test/server.test.ts # apps/web/README.md # apps/web/app/(workspace)/AppProviders.tsx # apps/web/app/(workspace)/browser/SessionPanel.tsx # apps/web/browser/BrowserServer.tsx # apps/web/browser/persistence.ts # apps/web/test/browserSession.test.tsx # apps/web/test/commands.test.tsx
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
|
One blocker from re-checking the latest commits (4a2aec8): deleting a session still doesn't refresh the sessions list. |
Fixed: successful deletion now removes the session from the cache and triggers a fresh GET. Older in-flight responses remain invalidated. |
# Conflicts: # apps/web/browser/BrowserSession.tsx # apps/web/test/persistence.test.tsx
Summary
Add a saved-session list to the browser's Sessions panel. Clicking a name opens
/browser/[sessionId]and restores its saved state. Delete icons remove sessions, whilelocalis protected in both the UI and API. Deleting the current session opens/browser/local.SessionPanel.tsxowns the list and navigation. The server's routes and SQLite repository list and remove saved snapshots.BrowserServer.tsxandpersistence.tspause autosave, wait for any outstanding save before deletion, and resume saving if deletion fails.Workspace verification passed with
pnpm verify --concurrency=1. React Doctor reports 100/100 with no issues. The session list uses SWR for shared caching, focus refresh, and cache updates after deletion. Render budgets are unchanged:Session selection finishes queued and in-flight autosaves through persistence.flush() before replacing the keyed stores. Edits arriving during a PUT receive their own save acknowledgement before navigation. A failed save keeps the current session open with its edits and an error; selecting the destination again retries. Next Link's onNavigate intercepts same-tab navigation while preserving modified-click behavior.
Four integration scenarios cover queued and delayed writes, edits during writes, failure, retry, and restoration after returning. Existing render budgets remain unchanged. New pending-switch budget:
Manual verification
pnpm dev, open/browser/testsessionand/browser/niship, and wait for Saved./browser/localopens. The local session has no delete icon.Reopening the mounted Sessions panel revalidates the saved list, including sessions added or removed in another tab. The session list scrolls within its panel so every saved name and delete button stays reachable.
The regression test toggles the real workspace panel store, verifies no request on closing and one on reopening, checks additions/removals, and confirms the list stays mounted.
Persistence is initialized only after restoration, snapshot capture, and store subscriptions succeed. A regression test covers a schema-valid snapshot with an unregistered track type followed by a failed DELETE: the load error and retries remain active, no PUT overwrites the saved session, and remote commands remain disconnected. Workspace verification passes with this recovery case.
Deletion recovery keeps at most one load in flight and prevents restoration after initialization. Regression coverage reproduces two delayed GET responses with an intervening edit, confirms the redundant GET is prevented and the edit persists, and checks recovery when the first GET finishes during a failed DELETE.
Browser toolbar integration and shared interaction icon presentation are reviewed separately in #340.
Addresses #334