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

Add a togglePaneZoom action for zooming a pane #6989

Merged
merged 11 commits into from
Aug 7, 2020

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

zoom-pane-000

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

  • Do we like the zoom icon in the tab?
  • Do we like the borders on all sides?
    • Alternate options discussed:
      • borders on no sides
      • borders only on the sides that the pane normally would have had (as if the border was zoomed as well
      • dotted-line borders

Validation Steps Performed

Zoomed in and out a bunch. Tried closing panes while zoomed. Tried splitting panes while zoomed. Etc.

@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. labels Jul 21, 2020
Sure bot, whatever you say
@miniksa
Copy link
Member

miniksa commented Aug 6, 2020

You owe me tests on all of these commands as soon as I bootstrap the new Helix testing.

src/cascadia/TerminalApp/AppActionHandlers.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Pane.cpp Show resolved Hide resolved
src/cascadia/TerminalApp/Pane.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Pane.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
Copy link
Member

@carlos-zamora carlos-zamora left a 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).

src/cascadia/TerminalApp/TerminalPage.cpp Show resolved Hide resolved
@carlos-zamora
Copy link
Member

FOR DISCUSSION

  • Do we like the zoom icon in the tab?

  • Do we like the borders on all sides?

    • Alternate options discussed:

      • borders on no sides
      • borders only on the sides that the pane normally would have had (as if the border was zoomed as well
      • dotted-line borders

I love the zoom icon in the tab :)
I think the borders on all sides is subtle enough. If we had an animation, I feel like we could get by with borders on no sides and only having the tab icon. I don't feel too strongly about this one though so I'd definitely rely more on others' opinions.

@carlos-zamora carlos-zamora removed their assignment Aug 6, 2020
@DHowett
Copy link
Member

DHowett commented Aug 6, 2020

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 [ ] and []] buttons that mean maximize and restore.

@zadjii-msft
Copy link
Member Author

My only qualm with that is we need an action that just "toggles" the state. togglePaneMaximize?

@zadjii-msft
Copy link
Member Author

@carlos-zamora animation moved to #7216

Copy link
Member

@carlos-zamora carlos-zamora left a 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. :)

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

Love it

@DHowett DHowett changed the title Add togglePaneZoom action for zooming a pane Add a togglePaneZoom action for zooming a pane Aug 7, 2020
@DHowett DHowett merged commit 70fd03f into master Aug 7, 2020
@DHowett DHowett deleted the dev/migrie/f/996-zoom-zoom branch August 7, 2020 23:11
ghost pushed a commit that referenced this pull request Aug 13, 2020
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.
ghost pushed a commit that referenced this pull request Aug 20, 2020
#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.
MichelleTanPY pushed a commit to MichelleTanPY/terminal that referenced this pull request Aug 20, 2020
…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.
@ghost
Copy link

ghost commented Aug 26, 2020

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

Handy links:

@ghost ghost mentioned this pull request Aug 26, 2020
@zadjii-msft zadjii-msft mentioned this pull request Oct 20, 2020
3 tasks
ghost pushed a commit that referenced this pull request Oct 21, 2020
## 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
DHowett pushed a commit that referenced this pull request Oct 27, 2020
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)
@ghost
Copy link

ghost commented Nov 11, 2020

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

Handy links:

@ghost
Copy link

ghost commented Nov 11, 2020

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

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The user should be able to zoom a pane
7 participants