Skip to content

add position panel left - #84477

Merged
SteVen Batten (sbatten) merged 2 commits into
microsoft:masterfrom
VeloPayments:GH-37877-position-panel-left
Dec 18, 2019
Merged

SteVen Batten (sbatten) merged 2 commits into
microsoft:masterfrom
VeloPayments:GH-37877-position-panel-left

Conversation

@AlexFell-Velo

Copy link
Copy Markdown
Contributor

This PR fixes #37877

Enable the layout service to handle the Position.Left enum.
It removes the TogglePanelPositionAction as this is now replaced by 3 distinct actions:

  • PositionPanelLeftAction
  • PositionPanelRightAction
  • PositionPanelBottomAction

Isidor Nikolic (@isidorn) I saw you assigned this to yourself a few days ago, however I'd previously taken a look at this and am fine for you to shepard this across as required.

@msftclas

Microsoft Contribution License Agreements (msftclas) commented Nov 11, 2019 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@isidorn

Copy link
Copy Markdown

I know SteVen Batten (@sbatten) recently was looking into making the panel position more configurable with the new layout. Due to that assigning first to him. Feel free to assign back to me and I can review.

@sbatten

Copy link
Copy Markdown
Member

Isidor Nikolic (@isidorn) Alexander Fell (@AlexFell-Velo) I have no issues with taking this. The PR appears well done and it does not conflict in any major way with the current thinking going forward. I am testing the branch for any caveats that could have been missed and reviewing the code.

I am assigning you as well Isidor Nikolic (@isidorn) indicating that you can review whenever.

@isidorn

Isidor Nikolic (isidorn) commented Nov 14, 2019 •

Copy link
Copy Markdown

The PR looks good overall. However if we plan to introduce a more flexible workbench layout in the future then I am not sure how much this makes sense as a temporary solution.
If the flexible workbench layou is not in our 6 month plan then I would merge this in. Otherwise I would wait for the right solution.

Since the implementation looks good, I am approving this. However please note that I did not intesively test this and if we merge this in it would be nice if we have a test plan item to cover it.
Thanks!

@bpasero

Copy link
Copy Markdown
Contributor

Feedback from testing:

  • the menu seems to show all actions now:
    image
  • panel.border does not work when panel is left, it should work to get a border between panel and editor
    image
  • changing the location and reloading the window does not persist the location, it goes back to bottom

@sbatten

Copy link
Copy Markdown
Member

I see all of the same issues Benjamin Pasero (@bpasero) has mentioned. I tested in High Contrast theme as it makes it easy to catch theme issues. Additionally, the chevron is incorrect when panel is on the left.
image

@isidorn

Copy link
Copy Markdown

Make sure to update the setting
workbench.panel.defaultLocation so that it can also be left

@AlexFell-Velo
Alexander Fell (AlexFell-Velo) force-pushed the GH-37877-position-panel-left branch 2 times, most recently from 51a4cbb to 1d5bf85 Compare November 15, 2019 12:16
@AlexFell-Velo

Copy link
Copy Markdown
Contributor Author

Thank you for the review and testing on this PR, much appreciated.

I have managed to address:

  • Border appearance
  • Chevron orientation
  • Contextual menu only showing correct items
  • Update of default location setting

However I cannot seem to resolve the default panel location when reloading the window, I understand that this works in the current implementation, any pointers you have would be greatly appreciated.

TIA

@isidorn

Copy link
Copy Markdown

For the default postiion on reload I would put a breakpoint somewhere around here and try to figure out what is going on. Hope that helps

@AlexFell-Velo
Alexander Fell (AlexFell-Velo) force-pushed the GH-37877-position-panel-left branch 2 times, most recently from ed67c04 to 3a8ea45 Compare November 15, 2019 14:43
@AlexFell-Velo

Copy link
Copy Markdown
Contributor Author

Thanks Isidor Nikolic (@isidorn) for the pointer, turns out it was actually and array ordering thing on startup here

I needed [panel, editor] and not the default [editor, panel], so this is now resolved, I'll await the outcome of any further testing.

Thanks

@isidorn

Copy link
Copy Markdown

Thanks. I'll leave it up to SteVen Batten (@sbatten) to merge it in.
I recommend a test plan item, which I can also write. Let me know if you would like me to do that SteVen Batten (@sbatten)

@AlexFell-Velo

Copy link
Copy Markdown
Contributor Author

SteVen Batten (@sbatten) any movement on this one?
It wasn't clear to me what sort of gates you had around test coverage for PR's etc. Because of the way that panelPart and panelActions were linked, I've added two new commits to further separate these entities so that they can become testable via unit tests. All the setup work of registering singletons and actions is now achieved in registerPanel.ts

Hopefully that helps this along a little bit.

@sbatten

Copy link
Copy Markdown
Member

Alexander Fell (@AlexFell-Velo) sorry about not picking this up, that's my fault. Due to the current time for us in the milestone, I'm going to move this to be merged early in December. This will give it plenty of testing in insiders.

@sbatten SteVen Batten (sbatten) added this to the December 2019 milestone Dec 5, 2019
@sbatten

Copy link
Copy Markdown
Member

Alexander Fell (@AlexFell-Velo) while I understand where you were coming from, I don't particularly prefer the new registerPanel.ts file as none of the other parts do this pattern so I'd prefer consistency.

@AlexFell-Velo

Copy link
Copy Markdown
Contributor Author

Alexander Fell (@AlexFell-Velo) while I understand where you were coming from, I don't particularly prefer the new registerPanel.ts file as none of the other parts do this pattern so I'd prefer consistency.

Happy to back out this change, however I'd also have to back out the unit tests, as the current architectural style would require mocking out the DI and registration mechanics before the require/import is made, which seems like a lot of effort for some small tests.

You could argue that the current unit tests that I have written don't really provide any concrete value, so if you are happy for me to back out this change, then I'm happy to do this SteVen Batten (@sbatten) .

@sbatten

Copy link
Copy Markdown
Member

Alexander Fell (@AlexFell-Velo) the unit tests are not a condition for this to be merged IMO as we didn't have these tests before and this is a welcome tweak to an existing function. If you are still interested in keeping the tests, you can look at some other tests as examples to get things set up.

- enable layout code to position panel to the left
@AlexFell-Velo

Copy link
Copy Markdown
Contributor Author

Alexander Fell (@AlexFell-Velo) the unit tests are not a condition for this to be merged IMO as we didn't have these tests before and this is a welcome tweak to an existing function. If you are still interested in keeping the tests, you can look at some other tests as examples to get things set up.

SteVen Batten (@sbatten) I found it easier to remove them. Rebased onto master as before

@sbatten
SteVen Batten (sbatten) merged commit ad0eae3 into microsoft:master Dec 18, 2019
@sbatten SteVen Batten (sbatten) added the verification-needed Verification of issue is requested label Jan 27, 2020
@jasonvarga

Copy link
Copy Markdown

Nice PR - but is there any way to mimic the previous behavior? I loved my single keyboard shortcut to toggle moving bottom/right.

@sbatten

Copy link
Copy Markdown
Member

Jason Varga (@jasonvarga) absolutely

    {
        "key": "<your keybind here>",
        "command": "workbench.action.positionPanelRight",
        "when": "panelPosition == 'bottom'"
    },
    {
        "key": "<your keybind here>",
        "command": "workbench.action.positionPanelBottom",
        "when": "panelPosition == 'right'"
    }

@jasonvarga

Copy link
Copy Markdown

Awesome 🎉 Thanks SteVen Batten (@sbatten)

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

verification-needed Verification of issue is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide workbench.panel.location "left" option

6 participants