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

Unify splitting panes and creating new tabs #11305

Merged
17 commits merged into from
Nov 4, 2021
Merged

Conversation

PankajBhojwani
Copy link
Contributor

@PankajBhojwani PankajBhojwani commented Sep 22, 2021

Implements _MakePane in TerminalPage, which creates a pane that then can be used to pass into another pane to split or to create a new tab with. Places where we split pane or create a new tab now use _MakePane.

PR Checklist

Validation Steps Performed

Stands up to manual testing with multiple new pane/new tab commands as well as startup actions

@ghost ghost added Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. 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 Sep 22, 2021
@Rosefield
Copy link
Contributor

Rosefield commented Sep 22, 2021

I had also done this, but I based my branch off of #11153 so was waiting for that before making a pr. Rosefield@84beb7a for the commit that does this particular change.

Probably some ideas that can be coalesced between our two implementations.

@PankajBhojwani PankajBhojwani marked this pull request as ready for review September 27, 2021 22:34
src/cascadia/TerminalApp/TerminalTab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalTab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
@@ -21,7 +21,6 @@ namespace winrt::TerminalApp::implementation
struct TerminalTab : TerminalTabT<TerminalTab, TabBase>
{
public:
TerminalTab(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile, const winrt::Microsoft::Terminal::Control::TermControl& control);
Copy link
Member

Choose a reason for hiding this comment

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

Oh man. This is hardcore gonna conflict with @zadjii-msft's warning dialog PR. I'll come back to this once that merges.

Copy link
Member

Choose a reason for hiding this comment

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

I'll probably end up being the one to deal with the merge conflicts 😬

@zadjii-msft
Copy link
Member

zadjii-msft commented Oct 6, 2021

FWIW this fixes #11282 as well

@ghost ghost added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Priority-1 A description (P1) Severity-Crash Crashes are real bad news. labels Oct 6, 2021
@zadjii-msft
Copy link
Member

I IMMEDIATELY take that back, I must have just gotten lucky a couple times

@PankajBhojwani PankajBhojwani removed Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Severity-Crash Crashes are real bad news. labels Oct 7, 2021
@PankajBhojwani PankajBhojwani removed the Priority-1 A description (P1) label Oct 7, 2021
@zadjii-msft
Copy link
Member

before giving this a closer review - I did branch off this for the hackathon for the adaptive cards thing, and it felt good there, so I'm inclined to say this just works

zadjii-msft
zadjii-msft previously approved these changes Oct 26, 2021
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Thank you for doing this 🙌

src/cascadia/TerminalApp/TerminalTab.cpp Outdated Show resolved Hide resolved
@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Oct 26, 2021
@ghost ghost requested review from miniksa, DHowett, leonMSFT and lhecker October 26, 2021 21:32
miniksa
miniksa previously approved these changes Nov 3, 2021
Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

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

This is so nice. I love it.

@zadjii-msft
Copy link
Member

gah you've got another merge conflict so I'll have to give it another pass anyways ;___;

Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

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

:shipit:

@miniksa miniksa added AutoMerge Marked for automatic merge by the bot when requirements are met and removed Needs-Second It's a PR that needs another sign-off labels Nov 4, 2021
@ghost
Copy link

ghost commented Nov 4, 2021

Hello @miniksa!

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 52b4bb7 into main Nov 4, 2021
@ghost ghost deleted the dev/pabhoj/unify_pane_tab branch November 4, 2021 22:30
ghost pushed a commit that referenced this pull request Dec 8, 2021
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 pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. 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.

Unify pane splitting and new tab creation
5 participants