Skip to content

Adds shortcuts for better navigating editor window#2979

Merged
vadi2 merged 26 commits intoMudlet:developmentfrom
dicene:improveKeyboardNavigation
Aug 20, 2019
Merged

Adds shortcuts for better navigating editor window#2979
vadi2 merged 26 commits intoMudlet:developmentfrom
dicene:improveKeyboardNavigation

Conversation

@dicene
Copy link
Copy Markdown
Contributor

@dicene dicene commented Aug 13, 2019

Brief overview of PR changes/additions

Adds CTRL+Tab and CTRL+SHIFT+Tab shortcuts that enable you to jump from section to section in
the editor window without needing to use your mouse.

Motivation for adding to Mudlet

I personally hate having to use the mouse pretty much ever. When I'm working on coding and the like, I like to be able to navigate with both hands on the keyboard. This change further enables that. Additionally, this will benefit any Visually Impaired users, by reducing the guess-work with tabbing repeatedly, and making it possible to escape the Edbee editor without needing to use a mouse.

Other info (issues closed, discussion etc)

@dicene dicene requested a review from a team as a code owner August 13, 2019 17:28
@dicene dicene requested a review from a team August 13, 2019 17:28
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Aug 13, 2019

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@dicene
Copy link
Copy Markdown
Contributor Author

dicene commented Aug 13, 2019

CTRL+Tab and CTRL+SHIFT+Tab are widely used to jump from one panel to another, and are mentioned for this purpose in the Qt Documentation as well as in Microsoft UI Design Guides.

I tried to select a reasonable tabbing order that brings you quickly through the window to the most used options, with some things needing a combination of this shortcut and normal tab. There are some cases where it might be worth considering adding further stops along the way, like adding a position at the Stylesheet editor for Buttons.

vadi2 and others added 17 commits August 13, 2019 22:25
* WIP

* Const the variables that we can

* Format
* Move declaration of install functions

This allows us to use them singularly in a different context.
Intention is to send all improvements upstream but not be delayed by them getting merged.
…ces (Mudlet#2953)

* Don't show SSL certificate info until we have one & streamline UI

* Remove colorroles
…dlet#2945)

* Add a workaround for mapper creation breaking getMainWindowSize()

* Revert "Fix errors when creating new triggers (Mudlet#2868)"

This reverts commit 0578c61.

* Fix typo
* Raise minimum to Qt 5.11

* Update Travis minimum Qt build
* Replace a couple of cases of std::tie with auto

* A few more
* Update tooltip, more than IRE now provide maps (Mudlet#2668)

* Add autocomplete toggle to profile

* Update to a version of edbee with autocomplete toggle

* Wire in the autocomplete toggle

* Use correct host variable

* Add missing toggle call
@dicene dicene requested review from a team August 13, 2019 20:26
Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

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

Seems to work fine for me, the only concern is that it's a custom shortcut that nobody will know about - need to make it discoverable somehow.

What do you think about the CodeFactor warning?

@dicene
Copy link
Copy Markdown
Contributor Author

dicene commented Aug 16, 2019

Seems to work fine for me, the only concern is that it's a custom shortcut that nobody will know about - need to make it discoverable somehow.

What do you think about the CodeFactor warning?

Well, 1/4 of the issues found is unrelated to mode changes entirely. The other three just say "complex method". I'm not really sure there's much more that I could do to make it better though.

{
switch (mCurrentView) {
case EditorViewType::cmTriggerView:
if (QString("edbee::TextEditorComponent").compare(QApplication::focusWidget()->metaObject()->className()) == 0) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be a QStringLiteral as with others:

Selection_427

Copy link
Copy Markdown
Contributor Author

@dicene dicene Aug 16, 2019

Choose a reason for hiding this comment

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

Fixing in commit.

Didn't fix in both functions, so I'll get another commit in.

return;
}
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you run clang-format on this entire function? Not file. Here's an example of how to use in Qt Creator in case you're not familiar (if you are, ignore!):

Peek 2019-08-16 06-18

Copy link
Copy Markdown
Contributor Author

@dicene dicene Aug 16, 2019

Choose a reason for hiding this comment

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

Done in commit.
Edit: Didn't run the function on both functions(next AND previous), so I'll do that and commit again.

@dicene
Copy link
Copy Markdown
Contributor Author

dicene commented Aug 16, 2019

This is why I like to use my PR's as my daily driver for a while. Turns out if the first trigger pattern you have is a prompt pattern, Ctrl+Tab doesn't do anything if you're in the name field(or the other fields that Ctrl+Tab to the patterns). I'll have to set up some logic to find the first not-prompt pattern field, or to go to the first pattern's drop-down type list instead.

@dicene
Copy link
Copy Markdown
Contributor Author

dicene commented Aug 16, 2019

Also, @vadi2, I share your concern that very few people aside from those that read the updatelog will actually know the shortcut exists, but I'm not entirely sure how we could increase its visibility. We could possibly put them into the "you haven't selected a trigger yet" screen, but I'm not sure that many people read that.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Aug 16, 2019

One thought is those 'New! Now you can do this' context-sensitive bubbles, but we don't have the framework to setup to them. The next best alternative would be tooltip(s) - don't have it much clearer than that tho.

@Mudlet/ui-review ?

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

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

🤷‍♂️ no feedback from there, so let's go with it as-is and add the ideas on discoverability in a later update.

For one https://wiki.mudlet.org/w/Manual:Editor will need to be updated, but I don't remember the website I made it with.

@vadi2 vadi2 merged commit 65ef8d3 into Mudlet:development Aug 20, 2019
@Kebap
Copy link
Copy Markdown
Contributor

Kebap commented Aug 30, 2019

🤷‍♂ no feedback from there, so let's go with it as-is and add the ideas on discoverability in a later update.

For one https://wiki.mudlet.org/w/Manual:Editor will need to be updated, but I don't remember the website I made it with.

I updated that image to be a text instead for a11y reasons.
Also included these new shortcuts (in a new "navigation" section)

  • CTRL+Tab - Focus next section
  • CTRL+SHIFT+Tab - Focus previous section

The word "section" I am not too happy with, maybe "widget" (but technical), maybe "panel" (as named above), maybe other still?

Also I would have naively assumed CTRL + Tab to bring me from trigger editor to alias editor to timer editor, etc. Is that another shortcut still?

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Aug 30, 2019

Thanks for changing it! Much easier to update now, too. I think "section" sounds fine, but if someone has a better term, I wouldn't mind.

Taking you to another editor I don't think was the purpose of this shortcut. It should indeed be a different shortcut.

@dicene dicene deleted the improveKeyboardNavigation branch April 4, 2020 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants