Skip to content

feat(KeyboardShortcuts): add customizable shortcuts for common actions - #5097

Closed
maxpatiiuk wants to merge 18 commits into
mainfrom
keyboard-shortcuts
Closed

maxpatiiuk wants to merge 18 commits into
mainfrom
keyboard-shortcuts

Conversation

@maxpatiiuk

@maxpatiiuk maxpatiiuk commented Jul 14, 2024

Copy link
Copy Markdown
Member

Begins to fix: #1746

Checklist

  • Self-review the PR after opening it to make sure the changes look good
    and self-explanatory (or properly documented)
  • Add automated tests
  • Add relevant issue to release milestone

Testing instructions

  • Added Keyboard Shortcuts item to User tools - verify it looks good
  • For each shortcut on the Keyboard Shortcuts page that has a default value assigned, make sure that the default keyboard shortcuts we have set do not already have an action assigned to them (we don't want to overwrite default browser or OS actions, unless we really have to, or unless user would expect us to do so)
    • i.e open any non-specify webpage (google.com) and see if this key does anything (this needs to be verified in non-specify pages because if specify collides with a system shortcut, specify will take priority, and so you may not even know that it collides)
    • Verify this on Windows in Chrome and Firefox
    • Verify this on macOS in Chrome and Safari
    • (if possible) Verify this on Linux in Firefox
  • Check if any other common action is missing a keyboard shortcut that you believe we should add
  • Verify the ability to set a keyboard shortcut to any page (see feat(KeyboardShortcuts): add customizable shortcuts for common actions #5097 (comment))

@maxpatiiuk maxpatiiuk self-assigned this Jul 14, 2024
@maxpatiiuk maxpatiiuk changed the title Keyboard shortcuts feat(KeyboardShortcuts): add customizable shortcuts for common actions Jul 14, 2024
@maxpatiiuk
maxpatiiuk force-pushed the keyboard-shortcuts branch from d19d3ec to d3623a8 Compare July 14, 2024 02:37
@maxpatiiuk
maxpatiiuk force-pushed the keyboard-shortcuts branch from d3623a8 to aa3beed Compare July 21, 2024 21:47
@grantfitzsimmons

Copy link
Copy Markdown
Member

CSIRO mentioned users are having repetitive strain injuries due to this not being implemented

@maxpatiiuk

maxpatiiuk commented Dec 15, 2024

Copy link
Copy Markdown
Member Author

Bugs:

  • Can add same shortcut twice for the same action
  • When adding the keyboard shortcut, can't reach the "Remove" button with keyboard alone

maxpatiiuk added a commit to maxpatiiuk/calendar-plus that referenced this pull request Dec 22, 2024
The original keyboard shortcuts handling code was used as a basis for
specify/specify7#5097, but then, on that PR I
made logic more robust and added features.

Now backporting the code from that PR back into calendar-plus.

Fixes #255
maxpatiiuk added a commit to maxpatiiuk/calendar-plus that referenced this pull request Dec 23, 2024
The original keyboard shortcuts handling code was used as a basis for
specify/specify7#5097, but then, on that PR I
made logic more robust and added features.

Now backporting the code from that PR back into calendar-plus.

Fixes #255
@maxpatiiuk

Copy link
Copy Markdown
Member Author

Added ability to set shortcut to any URL:

out.mp4

Use cases:

  • can set a keyboard shortcut to any menu item/user tool
  • can set a keyboard shortcut to a record set/query that you use often
  • can set a keyboard shortcut to an external website (morphosource/gbif/...)
    • this was trivial to implement, and makes the feature much more powerful - will see how it will end up being used
  • brings us closer to Implement Workspaces #5686

By default, I only included keyboard shortcut to open the keyboard shortcut viewer, and will add shortcut to go to the home page. For the rest, we can let people set those to what makes sense to them (I avoided setting too many be default as things can conflict with os/browser/browser extensions, unless we go for 3-4 key shortcuts)

TODO:

  • come up with a default keyboard shortcut to go to the home page

@maxpatiiuk
maxpatiiuk marked this pull request as ready for review January 27, 2025 01:14
@maxpatiiuk
maxpatiiuk requested review from a team, emenslin and lexiclevenger January 27, 2025 01:21
@CarolineDenis CarolineDenis added this to the 7.11 milestone Feb 4, 2025

@emenslin emenslin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we make the save button orange or something in the shortcuts to url dialog? I think if you're editing a url it can be easy to not click the save button assuming that when you close out of the dialog the bigger save button will be orange. Or we could also consider having some sort of blocker or dialog if that would make more sense. I feel like when first testing the dialog I didn't even notice the save button appeared next to it but that could just be me.

02-07_12.11.mp4

On top of that if you create a new shortcut and don't press the gray save button, close the dialog, the save button on the naviagation menu turns orange but if you click that and go back to the shortcut it says 'No key binding assigned'

02-07_12.38.mp4

If you add a shortcut and then try to add another without saving the dialog freaks out

02-07_11.57.mp4

Also I feel like this layout can be a little confusing with the buttons and the spacing. Is the intention of the add button after a shortcut has been made for people to be able to add multiple shortcuts to one URL? And if that is the case could they all be in one line instead of having the add button below the shortcut and add button?
image

Also is there a plan to add more to this in the future? I feel like it looking just like preferences but only having the keyboard shortcuts looks a little odd especially considering the keyboard shortcuts opens a separate dialog so it just feels a little bare and confusing.
image

@CarolineDenis

Copy link
Copy Markdown
Contributor

@maxpatiiuk, is this PR waiting on final testing or there are still some code changes needed?

@CarolineDenis CarolineDenis modified the milestones: 7.12.0, 7.13+ Jun 12, 2025
- Replace "show nodes with children only" checkbox with a toggle button.
  Reasons:
  - The checkbox was the only thing below the tree viewer - occupying
    an entire line of horizontal space.
  - Because of how Tab and Shift+Tab keys are used in the tree viewer,
    moving focus to elements below the tree viewer is not possible - you
    can only move above the tree viewer. That made this checkbox
    inaccessible from keyboard
  - The label for this checkbox is long, adding visual noise - it's
    cleaner as a small tidy button
- Don't display split view controls if split view is not enabled to
  reduce visual clutter
@maxpatiiuk
maxpatiiuk force-pushed the keyboard-shortcuts branch from 6e9b479 to 580584e Compare July 26, 2025 15:53
@maxpatiiuk

Copy link
Copy Markdown
Member Author

Can we make the save button orange or something in the shortcuts to url dialog?

Great point. Fixed

On top of that if you create a new shortcut and don't press the gray save button, close the dialog, the save button on the naviagation menu turns orange

Fixed. The button no longer turns orange unless you hit "Save" inside the dialog

If you add a shortcut and then try to add another without saving the dialog freaks out

Ah, geez. Fixed!

Now, as soon as you start editing any keyboard shortcut, all others become disabled - leaving you with only 2 options - complete entering the shortcut and hit "Save" or hit "Remove"

image

Also is there a plan to add more to this in the future? I feel like it looking just like preferences but only having the keyboard shortcuts looks a little odd especially considering the keyboard shortcuts opens a separate dialog so it just feels a little bare and confusing.

Hmm, not sure now you got the page to look this way.

The keyboard shortcuts page should look more complete:

Screenshot 2025-07-26 at 08 51 40

It is possible that the page failed to render after this bug happened:

If you add a shortcut and then try to add another without saving the dialog freaks out


Merge conflicts resolved. Ready for testing.

@maxpatiiuk
maxpatiiuk requested a review from emenslin July 26, 2025 15:53

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

something is wrong with weblate integration? it is not supposed to commit double-quoted strings

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added brief docs on adding new keyboard shortcuts
cc @grantfitzsimmons @CarolineDenis in case you will need to add new shortcuts

@grantfitzsimmons grantfitzsimmons modified the milestones: 7.13+, 7.12.0 Sep 12, 2025
@grantfitzsimmons

grantfitzsimmons commented Sep 12, 2025

Copy link
Copy Markdown
Member

@maxpatiiuk Is this something you are interested in continuing or would our team be needed to finish this?

@CarolineDenis CarolineDenis removed this from the 7.12.0 milestone Sep 23, 2025
@maxpatiiuk

Copy link
Copy Markdown
Member Author

Is this something you are interested in continuing or would our team be needed to finish this?

I am not aware of any outstanding issues
It just needs testing
And once again, merge conflicts

@grantfitzsimmons

Copy link
Copy Markdown
Member

Closing this in favor of #8521

@github-project-automation github-project-automation Bot moved this from Dev Attention Needed to ✅Done in General Tester Board Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

Add keyboard shortcuts for common actions

5 participants