-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 the ability to interact with subtrees of panes #11153
Add the ability to interact with subtrees of panes #11153
Conversation
- Add `parent` and `child` movement directions to move up and down the tree respectively - When a parent pane is selected it will have borders all around it in addition to any borders the children have. - Fix focus, swap, split, zoom, and move to all handle interacting with more than one pane. - This technically leaves control focus on the first control in the focused subtree because panes aren't proper controls themselves.
src/cascadia/TerminalApp/Pane.cpp
Outdated
@@ -646,13 +720,13 @@ std::pair<Pane::PanePoint, Pane::PanePoint> Pane::_GetOffsetsForPane(const PaneP | |||
|
|||
if (_splitState == SplitState::Horizontal) | |||
{ | |||
secondOffset.y += (1 - _desiredSplitPosition) * parentOffset.scaleY; | |||
secondOffset.y += _desiredSplitPosition * parentOffset.scaleY; |
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.
So, this is a bug in preview that directional movement will be broken during startup if you use splits that aren't 50%, but amplified with #11046 by removing the actual size logic.
…the parent. this allows us to maintain focus on the correct terminal and also go back down the correct path with the child navigation.
… change always occurs.
…t overwrite them if the two parents are related.
This comment has been minimized.
This comment has been minimized.
OH MY GOD IT IS HAPPENING DOT GIF |
for the record this is incredible. My apologies if this takes us a while to get to - we've got quite the backlog building up (which is a good thing), there's just too much amazing stuff landing all in this one release |
No worries, I know I have like 6 open PRs right now in addition to all the work everyone else is doing. |
No comments so far, but I still have to review Don't forget to update the docs repo though. |
Videos removed from body of future commit message (some focus issues were fixed after these videos were taken) 2021-09-05.21-12-16.mp4Also splitting and toggling 2021-09-05.21-18-52.mp4Lastly resizing 2021-09-05.21-34-05.mp4 |
(We do want to do this at some point -- there was a refactor in progress to make pane clearer/less clear/make it a control -- we just haven't landed it. If you are interested in horriffic, terrible upheaval and working on such a change . . . I wouldn't call it out-of-scope!) |
As much as I enjoy breaking things, I've read through the leaf/parent pane refactor PR before and I'm not quite in the mood for that much responsibility. That and reconciling it with my wake of carnage through pane.cpp from the last 2 months. |
Whoops. I just launched Terminal into space by trying to move to the parent pane of the tab's root pane. (Also, alt+[] are great bindings for parent/child. We may eventually choose to bind them by default, but probably not today!) |
Oops. When I added the previous child focus tracking I forgot that I needed to start checking for null. |
…t-subtree-panes Conflicts: src/cascadia/TerminalApp/Pane.cpp src/cascadia/TerminalApp/TerminalTab.cpp
- font size changing, closing, read-only, clear buffer, changing color scheme all updated for parent panes - Make the WalkTree function more ergonomic to use, so in the default case you don't have to return a bool
Huh, is there any kind of stack I could get you or anything I can do to help? Repros 100% of the time on my machine, surprisingly. |
I think I found how the retro effects get broken in #11153 (comment) and then in #11153 (comment) I tried to fix it, but found that there were still cases where |
With adding an additional retry for setting up the shader effects things work, but it is a rather brutish approach Rosefield@dab423f so I'm just leaving it off branch until someone else confirms that that is an acceptable fix (I suspect not). Specifically, just the changes in |
I can actually get this bug to reproduce on the preview build. Repro steps:
2021-09-24.17-44-29.mp4 |
…t-subtree-panes Conflicts: src/cascadia/TerminalApp/Pane.cpp
…otherwise they hold onto buffer references that break resizing
With the last commit I think I invalidate my previous comment(s), and found a minimal change that fixes the retro effects issue completely. |
Made color schemes preview on all panes. |
Woah, never seen that before. I'd guess it's just out of memory? But really no idea 🤷 |
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.
Tested this in today's bug bash. The crash, retro effects bug, and previewable color scheme bug got fixed! Works excellent! Thank you!!
Hello @carlos-zamora! Because this pull request has the 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 (
|
🎉 Handy links: |
Some changes I had sitting around after working on #11153 that weren't appropriate to put in that pr. Each commit should be independent if particular ones are unwanted. Slight overlap with #11305. There is some more code removal that can be done after that is merged, specifically `AttachPane` can be deleted once `SplitPane` handles adding multiple panes at once correctly. ## Details - Makes `WalkTree` more useful, and closer to a real iterator. Add a convenient `_FindPane` built on top of that. - Coalesces `PrecalculateAutoSplit` and `PreCalculateCanSplit` since they are basically identical logic. - `Pane::Relayout` functionally did nothing because sizing was switched to `star` sizing at some point in the past, so it was just deleted. ## Validation Quick smoke test to make sure automatic splitting works, focus movement still works correctly.
This commit adds the ability to interact with subtrees of panes.
Have you ever thought that you don't have enough regression testing to
do? Boy do I have the PR for you! This breaks all kinds of assumptions
about what is or is not focused, largely complicated by the fact that a
pane is not a proper control. I did my best to cover as many cases as I
could, but I wouldn't be surprised if there are some things broken that
I am unaware of.
Done:
parent
andchild
movement directions to move up and down thetree respectively
addition to any borders the children have.
all handle interacting with more than one pane.
buffer, and changing color scheme will distribute to all children.
focused subtree because panes aren't proper controls themselves. This
is also used to make sure we go back down the same path with the
child
movement.sub-panes and it won't unzoom you until you use moveFocus or another
action. This wasn't explicitly programmed behavior so it is probably
buggy (I've quashed a couple at least). It is a natural consequence of
showing multiple terminals and allowing you to focus a terminal and a
parent separately, since changing the active pane directly does not
unzoom. This also means there can be a disconnect between what pane is
zoomed and what pane is active.
Validation Steps Performed
Tested focus movement, swapping, moving panes, and zooming.
Closes #10733