fix(tabs): keep the tab in front after a save prompt and dim tab navigation it cannot use - #3073
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully deployed
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
Four defects in tab selection and window key state, found while investigating #2524. Builds on #3061 (merged), which touched the same menu validation and connection-switch code.
Fixes
MainContentCommandActionsso the paths are tested without a modal.isConnectedalone, and quietly changed the selected tab behind the conversation (the strip is not drawn there).MainContentCommandActions.openTabCount, which existed and was unused) and the numbered item's own tag.isKeyWindowafter the first switch away from it.applySelectedWorkspaceresignedlastActiveCoordinator, which only a switch sets, while the first connection is made key by the window itself. So the first switch had nothing cached to resign, the outgoing coordinator never scheduled the eviction that frees its row buffers, and its row data stayed in memory. The switch now resigns every other coordinator that still reports itself key.Tests
CommandActionsCloseSelectionTests: Don't Save and Cancel on a background tab keep the tab in front; a tab picked while the close was pending stays in front; closing the tab in front still lands on its neighbour. The dirty fixture is an emptied file, not a reopen candidate, so the suite never writes to the Recently Closed Tabs history of whoever runs it (a precondition asserts that).TabNavigationMenuValidationTests: stepping needs two tabs and browse mode; Select Tab N needs an Nth tab, and Select Tab 1 (the real menu item's tag) dims with one tab.WorkspaceSwitchKeyStateTests: the first switch resigns the first connection and schedules its eviction; switching back hands key status back.Each new test fails against the code before the fix: without the restore, Don't Save selects the neighbour; without the new arms, the items stay enabled; without the resign loop, the first coordinator stays key.