# Reopen Closed Tab retention reproduction

Use two clean checkouts, base aa6c98f9351d8c8c91d43092dbf0d78790799963 and head 5b2afce61a436d003e6bc8ad52a4fb3172f484af.
Install each with `vp i`. Start each with `T3CODE_DEV_SEED=0`, its own data directory, and separate ports. Use separate browser profiles to avoid localhost session-cookie collisions. Both browser viewports are 1280 x 800, light theme, Linux Chromium.

In each data directory, set `userdata/settings.json` to:
```json
{"workflowsEnabled":true,"workflowSkippedRunsKept":1}
```
Put the accompanying `report.ts` in its `workflows` directory. This is a real workflow definition; no provider or service is mocked and no database rows are inserted or edited.

With the running server's data directory as DATA:
```sh
node apps/server/src/bin.ts workflow start report --key completed --input '{"title":"Quarterly report","skipped":false}' --base-dir "$DATA" --json
node apps/server/src/bin.ts workflow start report --key skipped-a --input '{"title":"Skipped A","skipped":true}' --base-dir "$DATA" --json
```
Pair each browser with its own server. Open `/workflows`, wait for Quarterly report to complete, click **Close Quarterly report**, click **Show 1 skipped**, open **Skipped A**, and click **Close Skipped A**.
Check browser storage `t3code:closed-views:v2`: newest first is Skipped A, Quarterly report. These entries come entirely from closing the actual tabs.

Start the second skipped run:
```sh
node apps/server/src/bin.ts workflow start report --key skipped-b --input '{"title":"Skipped B","skipped":true}' --base-dir "$DATA" --json
```
Hide skipped runs, then navigate to the chat home. Wait for the real one-hour engine-journal retention window and the next sweep to remove Skipped A. Both sides wait concurrently. Confirm removal with read-only SQLite and the server CLI; leave browser history untouched.

Record the browser, press Ctrl+Shift+T once, and wait for the panel to settle. Base opens the removed Skipped A and says “This run is not here.” Head skips that entry and opens Quarterly report. Inspect the URL, displayed panel, and remaining closed-tab history. Stop the recording and take identical stable screenshots 500 ms apart before choosing a still.
