fix(terminal): renumber auto-named tabs to prevent duplicate labels#447
Merged
Dimillian merged 1 commit intoDimillian:mainfrom Feb 17, 2026
Merged
Conversation
Root cause: createTerminal used existing tab count to assign labels, and closing tabs did not reindex remaining auto-created terminals. After closing Terminal 1, creating another tab could produce duplicate labels such as two Terminal 2 tabs. Implementation: useTerminalTabs now stores internal tab metadata with an autoNamed flag and uses a shared renumberAutoNamedTabs helper. createTerminal appends an auto-named tab and reindexes auto-named labels. closeTerminal reindexes remaining auto-named tabs after removal. ensureTerminalWithTitle marks tabs as custom titled and triggers auto-tab reindexing when converting an existing auto tab to custom. Behavior guarantees: only auto-generated Terminal N tabs are renumbered; custom titles such as Launch and Setup are preserved; numbering of auto tabs ignores custom tabs; active-terminal fallback on close remains unchanged. Tests: expanded useTerminalTabs.test.tsx to cover renumber-on-close, duplicate-prevention after close plus create, mixed custom and auto tab numbering, and conversion of an auto-named tab to a custom title.
Owner
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ 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". |
xiaojiou176
pushed a commit
to xiaojiou176/CodexMonitor
that referenced
this pull request
Feb 17, 2026
…imillian#447) (cherry picked from commit ed76f8d)
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.
Problem
Summary
Terminal 1..N).Launch,Setup) while only renumbering auto-generated tabs.TerminalTabAPI unchanged and track auto-named behavior with internal hook metadata.Testing
npm run test -- src/features/terminal/hooks/useTerminalTabs.test.tsxnpm run testnpm run typecheck(currently fails on pre-existing unrelatedGitLogEntry.refserrors in git/review files)