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

Consolidate Scrolling actions #8466

Open
carlos-zamora opened this issue Dec 2, 2020 · 3 comments
Open

Consolidate Scrolling actions #8466

carlos-zamora opened this issue Dec 2, 2020 · 3 comments
Labels
Area-Settings Issues related to settings and customizability, for 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.
Milestone

Comments

@carlos-zamora
Copy link
Member

Description of the new feature/enhancement

After #8459, we'll have the following scroll actions:

  • scrollUp
  • scrollDown
  • scrollUpPage
  • scrollDownPage
  • scrollToTop
  • scrollToBottom

This seems to be a case of us introducing new actions when we should be introducing new arguments instead. I propose the following designs:

Design 1: 3 args

  • action: scroll
  • arguments:
    • direction: up|down
    • mode: system|page|buffer
    • rowsToScroll: <optional int>

Personally dislike that rowsToScroll only works if you're in "system" mode. But it avoids the override in Design 2.

Design 2: Override mode

  • action: scroll
  • arguments:
    • direction: up|down
    • mode: system|page|buffer|<int>

This is basically Design 1, except rowsToScroll is embedded inside mode. If we go with this approach, maybe mode should be renamed to something like "amount"?

Open to discussion. Go!

@carlos-zamora carlos-zamora added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels Dec 2, 2020
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 2, 2020
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 3, 2020
@DHowett DHowett added this to the Terminal v2.0 milestone Dec 3, 2020
@DHowett
Copy link
Member

DHowett commented Dec 3, 2020

@zadjii-msft 2.0 -- fair?

@zadjii-msft
Copy link
Member

Well, we've got an open PR here with #8459. Are we expecting to resolve this design before we merge that PR? IMO That PR seems perfectly sensible, and I'd merge it as-is. I do get the push to make it a parametrized action - it's the switchToTab1, switchToTab2 thing all over again.

What if it was

{ "command": { "action": "scroll", "direction":"up" } }, // defaults to the system number of lines
{ "command": { "action": "scroll", "direction":"up", "amount": 5 } },
{ "command": { "action": "scroll", "direction":"up", "amount": "page" } },
{ "command": { "action": "scroll", "direction":"up", "amount": "buffer" } },

Which is like design 2, but without the "system" enum value. Though, I really hate sticking the 5 in the enum.

{ "action": "scroll", "direction":"up" }, // defaults to the system number of lines
{ "action": "scroll", "direction":"up", "amount": 5 }, // defaults to lines
{ "action": "scroll", "direction":"up", "mode": "page" },
{ "action": "scroll", "direction":"up", "mode": "page", "amount": 5 }, // up 5 pages
{ "action": "scroll", "direction":"up", "mode": "buffer" },
{ "action": "scroll", "direction":"up", "mode": "buffer", "amount": 5  }, // sure, 5 buffers up. It's still the top.

Okay I think I like design 1 more

@carlos-zamora
Copy link
Member Author

Well, we've got an open PR here with #8459. Are we expecting to resolve this design before we merge that PR? IMO That PR seems perfectly sensible, and I'd merge it as-is. I do get the push to make it a parametrized action - it's the switchToTab1, switchToTab2 thing all over again.

I'm ok with merging #8459. Mainly because idk when we/somebody would get around to implementing this.

What if it was

{ "command": { "action": "scroll", "direction":"up" } }, // defaults to the system number of lines
{ "command": { "action": "scroll", "direction":"up", "amount": 5 } },
{ "command": { "action": "scroll", "direction":"up", "amount": "page" } },
{ "command": { "action": "scroll", "direction":"up", "amount": "buffer" } },

So the default would be?:

{ "command": { "action": "scroll", "direction":"up", "amount": "system" } },

Which is like design 2, but without the "system" enum value. Though, I really hate sticking the 5 in the enum.

{ "action": "scroll", "direction":"up" }, // defaults to the system number of lines
{ "action": "scroll", "direction":"up", "amount": 5 }, // defaults to lines
{ "action": "scroll", "direction":"up", "mode": "page" },
{ "action": "scroll", "direction":"up", "mode": "page", "amount": 5 }, // up 5 pages
{ "action": "scroll", "direction":"up", "mode": "buffer" },
{ "action": "scroll", "direction":"up", "mode": "buffer", "amount": 5  }, // sure, 5 buffers up. It's still the top.

So the default would be?:

{ "action": "scroll", "direction":"up", "mode": "line", "amount": "system" }, 

I'm fine with either. I agree that your design 1 seems cleaner though. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for 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

No branches or pull requests

3 participants