Repository navigation
Studio: stop empty browser tabs piling up across chats - #17650
Conversation
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25f919eb7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // An untouched new tab is remade on return (`fresh` below), so it isn't kept for every chat visited. | ||
| const blank = left.length === 1 && isBlankTab(left[0]) ? left[0] : null; |
There was a problem hiding this comment.
Preserve closed-panel state after pruning its blank tab
If chat A has only a new tab and the user closes its browser panel, leaving A now removes that tab. The first return correctly restores open: false, but creates no replacement tab; leaving A again then reaches showChat's existing left.length === 0 branch and deletes A's saved panel state. After opening the browser in chat B, the next return to A consequently inherits B's open panel instead of keeping A's panel closed. Preserve the saved panel state for tabless chats created by this pruning so repeated chat switches do not undo the user's close action.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cf91408: the empty tab is only dropped while the panel is open, so a chat closed on an empty tab keeps its tab and its closed state. Added a test that fails without the guard.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf914081fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // An untouched new tab is remade on return (`fresh` below), so it isn't kept for every chat visited. | ||
| // Only with the panel open: a closed panel makes no `fresh`, and the chat would lose its closed state. | ||
| const blank = state.open && left.length === 1 && isBlankTab(left[0]) ? left[0] : null; | ||
| const tabs = blank ? state.tabs.filter((tab) => tab !== blank) : state.tabs; |
There was a problem hiding this comment.
Persist panel settings for chats whose blank tab is pruned
When a saved chat A has only a blank tab, switching away now removes its last tab, but tab-session.ts's kept() serializes panel settings only for chats represented in the remaining tabs. Consequently, A's saved open, fullView, and floating settings disappear on reload. For example, leave A with its panel open in full view, switch to B and close B's panel, then reload: returning to A now leaves its panel closed instead of restoring its previous layout. Preserve tabless chats' panel metadata in session serialization so pruning the placeholder does not discard settings that previously survived reloads.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Intended. An untouched empty tab holds nothing to restore, so after a reload its chat follows the current panel state like any chat without tabs. Persisting a panel record for every chat passed through would bring back the growth this PR removes. Within a session the chat still reopens on a new tab.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## What changed Comment-only follow-up to #17650: the two comment lines above the empty tab check in `store.ts` become one, and a line of test narration is removed. No code changes. ## How it was verified - The diff touches comment lines only. - `npm run typecheck` and `tests/browser-store-chats.test.ts` (7 passed) in `studio/frontend`.
What changed
With the browser panel open, every chat you pass through got a new empty tab, and that tab stayed in the browser's state after you left. Clicking New chat four times left three empty tabs behind for chats that may never be shown again. They are small, but nothing removed them until a reload, and they count toward the 50 tab limit on what a reload restores, so in a long running window they could push real tabs out of the saved session.
Leaving a chat whose only tab is an untouched new tab now drops that tab. The chat still remembers that its panel was open (and full view), so coming back to it looks the same as before: it opens on a new tab. A tab that was renamed or pinned is kept.
How it was verified
tests/browser-store-chats.test.ts; it fails without the change.npm run typecheck,npm test(15882 passed, 0 failed) andnpm run buildinstudio/frontend.Not tested here