Skip to content

Added 'Open External' keyboard shortcut#497

Merged
RvanderLaan merged 5 commits into
allusion-app:masterfrom
Krakor92:master
Aug 6, 2022
Merged

Added 'Open External' keyboard shortcut#497
RvanderLaan merged 5 commits into
allusion-app:masterfrom
Krakor92:master

Conversation

@Krakor92

Copy link
Copy Markdown
Contributor

Hello,

Following this issue I recently opened (#495), I added the keyboard shortcut "Open external" to the list of already existing shortcuts.
I set the default key combination to "Ctrl + Enter", I also thought of setting "Ctrl + Space" but after trying it, I found the former more natural.
Also, compared to the default "Right Click -> Open External" on a single entry, this shortcut opens all selected files.

As I did not find a contribution section, neither in the readme nor in the wiki, I do not know if you accept such pr. If not, I'm sorry for the inconvenience.

@RvanderLaan RvanderLaan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PRs are most certainly welcome, thanks for taking the time! We should indeed add docs about contributing

You could also replace the function on the "Open External" menu item (frontend/containers/ContentView/menu-items.tsx) to use your function, so the hotkey and menu item behave the same, that would be more natural too

Besides that and one other possible tweak, it's looking good - nice work! 👍

Comment thread src/frontend/stores/UiStore.ts
@Krakor92

Krakor92 commented Aug 2, 2022

Copy link
Copy Markdown
Contributor Author

Instead of limiting to a certain threshold, I think it is better to let the user decide. So I added a little warning dialog when there are at least 10 files selected before doing the Open external command.

Image 5

However, if you think it is still too dangerous, I can force the opening to stop after the 25th file (I should then add this info to the warning text of the dialog).

  • I'm not sure about the title and description of the warning though. Definitly change them if you have better ideas.
  • I've fixed the menu-item function, now it calls the UiStore function instead of implementing its own
  • (I also just realized that I didn't push on a new branch when making this pr, i'm sorry for that ^^')

I thought of moving the SubLocationExclusion component from RemovalAlert.tsx to this new WarningAlert.tsx file since its type is "warning" but I don't know if it's a good decision.

I also wanted to give another class to the div with the filenames instead of deletion-confirmation-list but I'm not sure if it makes sense in this case

Finally, It's out of the scope of this pr but my last commit fixes a bug i've encountered while trying to delete files. Basicly, I couldn't exit the removal dialog box saying "Are you sure you want to delete" after pressing Esc key (which deselects all files)
However, to fix the bug properly: key presses should focus on the visible dialog instead of keeping the focus on the gallery (I don't know how to do that right now).

@Krakor92 Krakor92 requested a review from RvanderLaan August 2, 2022 21:24

@RvanderLaan RvanderLaan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's even better, I was thinking this approach that after I posted that last suggestion 👏

Just left some suggestions for the textual content, the implementation looks good!

That SubLocationExclusion component indeed doesn't belong there with the current naming. They're all basically just confirmation modals, it needs some more thorough refactoring. That also goes for deletion-confirmation-list. Better to leave that for later, thanks for pointing it out 👍

I'll take a look at that Esc listener issue this weekend, we've had some issues with some events being listened globally for various reasons..

Comment thread src/frontend/components/WarningAlert.tsx Outdated
Comment thread src/frontend/components/WarningAlert.tsx Outdated
@RvanderLaan RvanderLaan merged commit 388d3b2 into allusion-app:master Aug 6, 2022
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.

2 participants