brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Use Ctrl+PageUp/PageDown to traverse files in list order #9803

Open core-ai-bot opened 2 years ago

core-ai-bot commented 2 years ago

Issue by MarcelGerber Saturday Jun 06, 2015 at 22:54 GMT Originally opened as https://github.com/adobe/brackets/pull/11223


For #6273.

This adds a shortcut (Ctrl/Cmd + PageUp/PageDown) to traverse your open files (in all panes) in list order. The shortcut itself is pretty much universal and I found it working like this in Google Chrome, Sublime Text 3 and Notepad++ (all on Windows). If users want, they can remap the existing Ctrl + (Shift) + Tab shortcuts to invoke these new commands.

The command goes through all panes (unlike@peterflynn's extension).

cc@peterflynn (you wrote the original extension)@fgimian (you made me do this)


MarcelGerber included the following code: https://github.com/adobe/brackets/pull/11223/commits

core-ai-bot commented 2 years ago

Comment by fgimian Saturday Jun 06, 2015 at 22:58 GMT


Thanks@MarcelGerber! :smile:

core-ai-bot commented 2 years ago

Comment by TomMalbran Sunday Jun 07, 2015 at 02:11 GMT


Nice.

I think that it would be a lot easier to create a new function MainViewManager.traverseToNextViewByListOrder which basically iterates through all the panes, and then through all the files to create an Array.<{file:File, paneId:string}> and get the index of the current file, so that you can later use ViewUtils.traverseViewArray.

core-ai-bot commented 2 years ago

Comment by prafulVaishnav Friday Jun 12, 2015 at 11:14 GMT


@MarcelGerber Verified the changes. Looks good. As@TomMalbran suggested, can you move this to MainViewManager

core-ai-bot commented 2 years ago

Comment by MarcelGerber Friday Jun 12, 2015 at 21:19 GMT


@prafulVaishnav@TomMalbran Changes pushed. This approach actually looks cleaner to me.

core-ai-bot commented 2 years ago

Comment by TomMalbran Friday Jun 12, 2015 at 21:30 GMT


It does look much cleaner now.

core-ai-bot commented 2 years ago

Comment by nethip Monday Jun 15, 2015 at 06:28 GMT


@MarcelGerber This is a very cool addition.

Does it make sense to do minimal refactoring in the core and bundle the rest as an extension?

Also it would be a good idea to chat about this on our Slack channel. That way we would get to know if users want this in the current form or this needs to be tweaked/customized.

core-ai-bot commented 2 years ago

Comment by TomMalbran Monday Jun 15, 2015 at 15:30 GMT


@nethip I don't think that we should make it an extension, not even a core extension. After refactoring the transverse function, the creating of the command would be trivial, so we might end with an extension of just a few lines. But that would increase the loading time unnecessarily.

I read issues from several people saying that the current tabbing using the MRU order is not intuitive, and would like to use a normal order. So this would be good for those users.

core-ai-bot commented 2 years ago

Comment by MarcelGerber Monday Jun 15, 2015 at 17:44 GMT


@nethip I agree with Tom on this. Notice this is not a behavior change, as the old Ctrl+Tab command still does the same thing as before. It's just that there's a new command bound to Ctrl+PageUp/PageDown that traverses the list in list order.

There has been some confusion about the order Brackets navigates in, as it seemed like an arbitrary order to some.

It's also what Sublime Text does: They have some shortcut for MRU order and another for list order.

core-ai-bot commented 2 years ago

Comment by mackenza Monday Jun 15, 2015 at 17:59 GMT


definitely agree with@MarcelGerber@TomMalbran This is new functionality, not a change in existing functionality, and belongs in core. Things like this, which are small enhancements to non-extension components (in this case the open files list) should be implemented in core.

I think the test should be "would anyone want this turned off at some point?". If the answer is no, it belongs in core and if yes, it belongs in an extension (even though we don't quite have the ability to turn off default extensions... yet ).

core-ai-bot commented 2 years ago

Comment by nethip Tuesday Jun 16, 2015 at 07:35 GMT


I am completely OK having this in core.

@TomMalbran I was thinking from the architecture point of view if there is any thing that needs to be considered there, like going forward do we want to place all these kinds of keyboard commands at one place for better maintenance.

I really like the way Visual Studio solves this problem. Upon doing a Ctrl+Tab, it brings up this nice little window like below.

image

Upon releasing Ctrl+Tab, this popup disappears and the doc switch happens. While this window is up, I could use keyboard up and down keyboard keys to choose between what file I want to switch to. IMO this is by far the most elegant solution so far. I was contemplating on adding something like this to Brackets.

From the Brackets context, this window could list the working files as well as list of all recently opened files(which includes the ones not part of the working set as well). That way we could also solve the problem with "No way to browser through list of recently opened files" problem.

@MarcelGerber About the current file switching order broken, did you get a chance to look at the code to figure out why this is in the broken state. Is there is any scope for improvement there?

core-ai-bot commented 2 years ago

Comment by MarcelGerber Tuesday Jun 16, 2015 at 16:30 GMT


@nethip To clear things up, I'm not saying the current file switching order is broken. It's just that people are not used to having a MRU order, and thus don't get the file they want in some cases. That's clearly easier for other editors, as most use a tab-based navigation model, where anything else than list order doesn't make much sense. It's different with Brackets "Working files" list, which doesn't predetermine a particular navigation model.

I like the approach Visual Studio takes, but I'm not really sure whether it makes sense to include two similar-looking, but different lists in there (navigation between them would probably be done with the left/right arrow keys). It might confuse the user.

core-ai-bot commented 2 years ago

Comment by nethip Wednesday Jun 17, 2015 at 06:08 GMT


@MarcelGerber IMO it makes perfect sense to go VS route on Ctrl-Tab. This is a huge productivity booster for me in VS.

We could probably make it explicit via the UI about working files and the open recent files being listed in the same window. Or chuck out the recent files and stick with just working files, if that makes it really confusing for the users.

About using left/arrow keys in VS, just doing Ctrl-Tab or Ctrl-Shift-Tab is going to traverse forward and backwards respectively, along with a visual feedback on which file is going to be switched to.

The beauty of the way VS handles this is that, the document switch window is sticky and upon doing Ctrl-Tab again, there is a feedback shown to inform the user about the document which is going to be switched to, which the user can override by doing a Ctrl-Tab again.

This kind of solves multiple of our issues/workflows

cc@ryanstewart

core-ai-bot commented 2 years ago

Comment by nethip Wednesday Jun 17, 2015 at 11:01 GMT


This is a screenshot of how Ctrl-Tab has been implemented in Visual Studio Code.

image

core-ai-bot commented 2 years ago

Comment by nethip Wednesday Jun 17, 2015 at 11:05 GMT


I am thinking,changes in this PR can co-exist even if we make any changes to the Ctrl-Tab workflow.

@MarcelGerber Just another thing. I was about to merge this PR but then I realized this PR did not have unit tests. Would you mind adding unit tests to this PR? I could then go about merging this.

core-ai-bot commented 2 years ago

Comment by MarcelGerber Wednesday Jun 17, 2015 at 16:36 GMT


@nethip I added unit tests.

core-ai-bot commented 2 years ago

Comment by MarcelGerber Friday Jun 19, 2015 at 16:22 GMT


@nethip Ready for another review.