feat(browser): per-tab persistence + legacy state.json retirement#153
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SQLite-backed persistence for embedded browser panes, replacing the legacy single JSON browser/state.json restore path with per-pane snapshots tied to app-state restoration.
Changes:
- Adds
browser_panesschema/model/migration support and wires browser panes through app-state save/restore. - Updates browser pane/view snapshots to carry stable per-pane session IDs and browser tab state.
- Removes legacy JSON persistence and adds best-effort cleanup for old
browser/state.json.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/persistence/src/schema.rs |
Adds Diesel schema for browser_panes. |
crates/persistence/src/model.rs |
Adds browser pane persistence model and constants. |
crates/persistence/migrations/2026-05-26-160000_add_browser_pane/up.sql |
Creates browser pane persistence table. |
crates/persistence/migrations/2026-05-26-160000_add_browser_pane/down.sql |
Drops browser pane persistence table. |
app/src/workspace/view.rs |
Removes legacy browser restore/write path and creates new pane UUID sessions. |
app/src/persistence/sqlite.rs |
Saves/restores browser panes through app-state SQLite. |
app/src/pane_group/pane/browser_pane.rs |
Snapshots browser panes into app-state. |
app/src/pane_group/mod.rs |
Restores browser panes from app-state snapshots. |
app/src/launch_configs/launch_config.rs |
Excludes browser panes from launch-config conversion. |
app/src/browser/persistence.rs |
Removes legacy JSON persistence implementation. |
app/src/browser/mod.rs |
Removes legacy persistence module export. |
app/src/browser/data_dir.rs |
Adds cleanup for the legacy state file. |
app/src/browser/browser_view.rs |
Stores session IDs in browser views and removes legacy close persistence. |
app/src/app_state.rs |
Adds browser pane snapshot type and marks it persisted. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot stopped work on behalf of
BunsDev due to an error
May 28, 2026 04:12
Persist embedded browser panes in SQLite app state with stable per-pane UUID session IDs, restore them into their owning workspace tabs, and retire the legacy single-pane browser/state.json path. Also validate restored browser session IDs as UUID v4 values before using them as WebKit data-directory path components, regenerating invalid legacy values defensively.
6f50f46 to
d133182
Compare
2 tasks
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.
Summary
Layer C of the per-tab browser work (builds on Layer A
9de9e07visibility fix and Layer Be59094e4per-tab data dir, both already onmain).browser_panestable keyed by stable per-pane UUID;LeafContents::Browser(BrowserPaneSnapshot { session_id, state })is wired through app-state save/restore and launch-config conversion. Browser panes now restore into the same workspace tab they were opened in, with the same intra-pane tab list and WebKit data-dir identity.~/.warp/config/browser/state.jsonJSON path. The old single-pane-into-tab-0 fallback is redundant with SQLite app-state restore and could create duplicate panes if both paths fired; this removes the legacy module, restore/write callsites, and close-time JSON writes.browser/state.json, and restored browser session IDs are validated as UUID v4 values before they can be used as data-dir path components.Test plan
cargo fmt --check./script/check_ai_attribution./script/check_rebrandgit diff --check origin/main...HEADcargo test -p warp-app browser::data_dir --features guicargo check -p warp-app --bin cast-codes --features guiWKWebsiteDataStore.defaultDataStore, but the per-pane directory is created for future plumbing.~/.warp/config/browser/state.jsonpresent, launch once and confirm it is removed; relaunch and confirm the cleanup is idempotent.