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

Update app menu to add item for history #2870

Merged

Conversation

PikachuEXE
Copy link
Collaborator

@PikachuEXE PikachuEXE commented Nov 16, 2022

Update app menu to add item for history

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

#1869 Partially

Description

Update app menu to add item for history
with keyboard shortcut

Screenshots

image

Testing

  • Use new menu item to navigate to history view
  • Use new keyboard shortcut (Ctrl/Cmd + U) to navigate to history view

Desktop

  • OS: MacOS
  • OS Version: 12.6
  • FreeTube version: 2cc5c2e

Additional context

The namespace for translation entries used in history view needs to be updated to avoid key conflict

@absidue
Copy link
Member

absidue commented Nov 16, 2022

Pretty sure you didn't need to update the translation keys, as the menu items don't get translated anyway at the moment.
I think this should be two separate shortcuts:

  • cmd + Y on macOS as that's what the issue requestor wants
  • ctrl + H on Windows and Linux, as CTRL + Y is the keyboard shortcut for redo (the opposite of CTRL + Z to undo), CTRL + H is also the shortcut for opening the history on Firefox and Chromium browsers on Windows

@PikachuEXE
Copy link
Collaborator Author

PikachuEXE commented Nov 16, 2022

Too complicated to have different keywords, I will just update it to Ctrl/Cmd + H

Update 1: Crap Cmd+H on MacOS = hide window zzzz
Update 2: Update to CmdOrCtrl+U

{ type: 'separator' },
{
label: 'History',
accelerator: 'CmdOrCtrl+U',
Copy link
Member

@absidue absidue Nov 18, 2022

Choose a reason for hiding this comment

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

It wouldn't be too hard to have a separate shortcut on macOS and have a meaningful one on Windows and Linux

Suggested change
accelerator: 'CmdOrCtrl+U',
accelerator: process.platform === 'darwin' ? 'Cmd+Y' : 'Ctrl+H',

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cmd+Z? Cmd+Y?

Copy link
Member

Choose a reason for hiding this comment

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

What's the standard shortcut for history in apps on macOS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cmd+Y I guess

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated but still need to be tested on windows

Choose a reason for hiding this comment

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

Thank you for implementing shortcuts! Once a menu item, a shortcut can be customised in macOS, so anything is good with me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Once a menu item, a shortcut can be customised in macOS, so anything is good with me.

I didn't know that~

Choose a reason for hiding this comment

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

Yep, like this:
Screenshot 2022-11-21 at 8 00 25

yarn.lock Outdated
@@ -7133,11 +7133,6 @@ sax@^1.1.3, sax@^1.2.4:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==

sax@~0.6.0:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I keep getting this on MacOS after running yarn install

@absidue absidue mentioned this pull request Nov 20, 2022
1 task
@@ -33,7 +33,7 @@ module.exports = {

rules: {
'space-before-function-paren': 'off',
'comma-dangle': ['error', 'never'],
'comma-dangle': ['error', 'only-multiline'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think multiline should allow (but not enforce) last comma

@@ -997,7 +997,23 @@ function runApp() {
{ role: 'zoomout' },
{ role: 'zoomout', accelerator: 'CmdOrCtrl+numsub', visible: false },
{ type: 'separator' },
{ role: 'togglefullscreen' }
{ role: 'togglefullscreen' },
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Allowing last comma on multiline makes duplicating last code and modifying it much easier, also no more diff on N-1th line

@@ -119,7 +120,7 @@ User Playlists:
it listed here
Empty Search Message: There are no videos in this playlist that matches your search
Search bar placeholder: Search in Playlist
History:
History Page:
Copy link
Member

Choose a reason for hiding this comment

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

Why rename this?
$t("History.History") would have gotten the history value before the update.

Also all locales that already have the History translated will need to update to "History Page" in order to not use the english translations

Copy link
Collaborator Author

@PikachuEXE PikachuEXE Nov 23, 2022

Choose a reason for hiding this comment

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

According to the comment # Webkit Menu Bar those entries are for Webkit Menu Bar and seems that they can only be placed on top level
I have no idea if that's true or not
Let me know?

The commit for that comment and many other entries are from a commit 2 years ago

Update 1: Found a tutorial about menu I18n

Copy link
Member

Choose a reason for hiding this comment

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

At the moment the menu doesn't get translated at all, so the translation change is not necessary yet, until someone decides to setup translations for the menu.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK I will revert the change
Confusing!

@PikachuEXE
Copy link
Collaborator Author

translation namespace changes reverted

@FreeTubeBot FreeTubeBot merged commit 2ad4316 into FreeTubeApp:development Nov 24, 2022
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 24, 2022
@PikachuEXE PikachuEXE deleted the feature/shortcuts/history branch November 25, 2022 01:48
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.

None yet

6 participants