-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Add a togglePaneZoom
action for zooming a pane
#6989
Conversation
…es, but it works _pretty_ well
…om-zoom # Conflicts: # src/cascadia/TerminalApp/Tab.cpp
Sure bot, whatever you say
You owe me tests on all of these commands as soon as I bootstrap the new Helix testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking over the one comment I have below.
It'd also be nice if we had an animation. Idk if you want that to be a part of #1001 though. If you do punt on the animation, could you just add a note on that issue (or open a new one).
I love the zoom icon in the tab :) |
FWIW: i prefer maximize/restore. we are almost an MDI right now. if we ever add the pane sub-titlebar people occasionally ask for, it will have the |
My only qualm with that is we need an action that just "toggles" the state. |
@carlos-zamora animation moved to #7216 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, slept on the design a little bit, and I think I'm ok with this. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it
togglePaneZoom
action for zooming a panetogglePaneZoom
action for zooming a pane
This is a minor fix from #6989. If there's only one pane in the Terminal, then we'd still "zoom" it and give it a border, but all the borders would be black. A single pane is already "zoomed", so it doesn't really make sense to try and zoom if there's only one.
#6989 forgot to add `togglePaneZoom` to the schema, so this does that. WHILE I'M HERE: * The action names in the schema and the actual source were both in _random_ order, so I sorted them alphabetically. * I also added an unbound `togglePaneZoom` command to defaults.json, so users can use that command from the cmdpal w/o binding it manually.
…osoft#7346) microsoft#6989 forgot to add `togglePaneZoom` to the schema, so this does that. WHILE I'M HERE: * The action names in the schema and the actual source were both in _random_ order, so I sorted them alphabetically. * I also added an unbound `togglePaneZoom` command to defaults.json, so users can use that command from the cmdpal w/o binding it manually.
🎉 Handy links: |
## Summary of the Pull Request Fixes the bug where `exit`ing inside a closed pane would leave the Terminal blank. Additionally, removes `Tab::GetRootElement` and replaces it with the _observable_ `Tab::Content`. This should be more resilient in the future. Also adds some tests, though admittedly not for this exact scenario. This scenario requires a cooperating TerminalConnection that I can drive for the sake of testing, and _ain't nobody got time for that_. ## References * Introduced in #6989 ## PR Checklist * [x] Closes #7252 * [x] I work here * [x] Tests added/passed 🎉 * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments From notes I had left in `Tab.cpp` while I was working on this: ``` OKAY I see what's happening here the ActivePaneChanged Handler in TerminalPage doesn't re-attach the tab content to the tree, it just updates the title of the window. So when the pane is `exit`ed, the pane's control is removed and re-attached to the parent grid, which _isn't in the XAML tree_. And no one can go tell the TerminalPage that it needs to re set up the tab content again. The Page _manually_ does this in a few places, when various pane actions are about to take place, it'll unzoom. It would be way easier if the Tab could just manage the content of the page. Or if the Tab just had a Content that was observable, that when that changed, the page would auto readjust. That does sound like a LOT of work though. ``` ## Validation Steps Performed Opened panes, closed panes, exited panes, zoomed panes, moved focus between panes, panes, panes, panes
Fixes the bug where `exit`ing inside a closed pane would leave the Terminal blank. Additionally, removes `Tab::GetRootElement` and replaces it with the _observable_ `Tab::Content`. This should be more resilient in the future. Also adds some tests, though admittedly not for this exact scenario. This scenario requires a cooperating TerminalConnection that I can drive for the sake of testing, and _ain't nobody got time for that_. * Introduced in #6989 * [x] Closes #7252 * [x] I work here * [x] Tests added/passed 🎉 * [n/a] Requires documentation to be updated From notes I had left in `Tab.cpp` while I was working on this: ``` OKAY I see what's happening here the ActivePaneChanged Handler in TerminalPage doesn't re-attach the tab content to the tree, it just updates the title of the window. So when the pane is `exit`ed, the pane's control is removed and re-attached to the parent grid, which _isn't in the XAML tree_. And no one can go tell the TerminalPage that it needs to re set up the tab content again. The Page _manually_ does this in a few places, when various pane actions are about to take place, it'll unzoom. It would be way easier if the Tab could just manage the content of the page. Or if the Tab just had a Content that was observable, that when that changed, the page would auto readjust. That does sound like a LOT of work though. ``` Opened panes, closed panes, exited panes, zoomed panes, moved focus between panes, panes, panes, panes (cherry picked from commit ccf9f03)
🎉 Handy links: |
🎉 Handy links: |
Summary of the Pull Request
This PR adds the
togglePaneZoom
action, which can be used to make a pane expand to fill the entire contents of the window.References
PR Checklist
Additional comments
FOR DISCUSSION
Validation Steps Performed
Zoomed in and out a bunch. Tried closing panes while zoomed. Tried splitting panes while zoomed. Etc.