Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually close tabs when they're closed while dragging them #5883

Merged
1 commit merged into from
May 14, 2020

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

When we're dragging the tab around, if you execute a ClosePane/CloseTab, then we should make sure to actually activate a new tab, so that focus doesn't just fall into the void.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

We suppress _OnTabItemsChanged events during a rearrange, so if a tab is closed while we're rearranging tabs, the we don't fire the SelectionChanged event that we usually do during a close that would select the new tab.

Validation Steps Performed

  • Tested manually
    • Confirmed that tragging a tab out, closing it, then dragging it back in does nothing.

  ## Summary of the Pull Request

  When we're dragging the tab around, if you execute a `ClosePane`/`CloseTab`, then we should make sure to actually activate a new tab, so that focus doesn't just fall into the void.

  ## References

  * This is almost exactly #5799, but with rearranging tabs

  ## PR Checklist
  * [x] Closes #5559
  * [x] I work here
  * [ ] Tests added/passed
  * [n/a] Requires documentation to be updated

  ## Detailed Description of the Pull Request / Additional comments
  We suppress `_OnTabItemsChanged` events during a rearrange, so if a tab is closed while we're rearranging tabs, the we don't fire the `SelectionChanged` event that we usually do during a close that would select the new tab.

  ## Validation Steps Performed
  * Tested manually
    - Confirmed that tragging a tab out, closing it, then dragging it back in does nothing.
@ghost ghost added Area-Input Related to input processing (key presses, mouse, etc.) Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels May 13, 2020
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm scared about how this actually works -- the currently dragging tab gets removed from the list, and everything is just.. okay?

@zadjii-msft
Copy link
Member Author

the currently dragging tab gets removed from the list, and everything is just.. okay?

Shockingly, yea. I bet the whole drag-drop is managed by something like sihost or OLE, and the "tab view item" that's being dragged gets cloned to that process, and then when we remove it on our side, it just, doesn't exist anymore. It worked better than I expected.

@DHowett-MSFT DHowett-MSFT added the AutoMerge Marked for automatic merge by the bot when requirements are met label May 14, 2020
@ghost
Copy link

ghost commented May 14, 2020

Hello @DHowett-MSFT!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 1422714 into master May 14, 2020
@ghost ghost deleted the dev/migrie/b/5559-why-would-you-ever-do-this branch May 14, 2020 01:47
jelster pushed a commit to jelster/terminal that referenced this pull request May 28, 2020
…t#5883)

## Summary of the Pull Request

When we're dragging the tab around, if you execute a `ClosePane`/`CloseTab`, then we should make sure to actually activate a new tab, so that focus doesn't just fall into the void.

## References

* This is almost exactly microsoft#5799, but with rearranging tabs

## PR Checklist
* [x] Closes microsoft#5559
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments
We suppress `_OnTabItemsChanged` events during a rearrange, so if a tab is closed while we're rearranging tabs, the we don't fire the `SelectionChanged` event that we usually do during a close that would select the new tab.

## Validation Steps Performed
* Tested manually
  - Confirmed that tragging a tab out, closing it, then dragging it back in does nothing.
@ghost
Copy link

ghost commented Jun 18, 2020

🎉Windows Terminal Preview v1.1.1671.0 has been released which incorporates this pull request.:tada:

Handy links:

DHowett pushed a commit that referenced this pull request Jun 24, 2020
## Summary of the Pull Request

When we're dragging the tab around, if you execute a `ClosePane`/`CloseTab`, then we should make sure to actually activate a new tab, so that focus doesn't just fall into the void.

## References

* This is almost exactly #5799, but with rearranging tabs

## PR Checklist
* [x] Closes #5559
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments
We suppress `_OnTabItemsChanged` events during a rearrange, so if a tab is closed while we're rearranging tabs, the we don't fire the `SelectionChanged` event that we usually do during a close that would select the new tab.

## Validation Steps Performed
* Tested manually
  - Confirmed that tragging a tab out, closing it, then dragging it back in does nothing.

(cherry picked from commit 1422714)
DHowett pushed a commit that referenced this pull request Jun 24, 2020
## Summary of the Pull Request

When we're dragging the tab around, if you execute a `ClosePane`/`CloseTab`, then we should make sure to actually activate a new tab, so that focus doesn't just fall into the void.

## References

* This is almost exactly #5799, but with rearranging tabs

## PR Checklist
* [x] Closes #5559
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments
We suppress `_OnTabItemsChanged` events during a rearrange, so if a tab is closed while we're rearranging tabs, the we don't fire the `SelectionChanged` event that we usually do during a close that would select the new tab.

## Validation Steps Performed
* Tested manually
  - Confirmed that tragging a tab out, closing it, then dragging it back in does nothing.

(cherry picked from commit 1422714)
@ghost
Copy link

ghost commented Jun 30, 2020

🎉Windows Terminal v1.0.1811.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-UserInterface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows Terminal blocks user input after a tab is removed
3 participants