-
Notifications
You must be signed in to change notification settings - Fork 893
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
Make it possible to view all commands in Brave, and their shortcuts #16845
Conversation
723bb2e
to
23b415f
Compare
23b415f
to
f2b5a87
Compare
A Storybook has been deployed to preview UI for the latest push |
std::string GetKeyName(ui::KeyboardCode code); | ||
std::vector<std::string> GetModifierName(ui::KeyEventFlags flags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we can use Accelerator::GetShortcutTexts() instead of managing all the characters. There could have problems like
- We might have to split the shorcut text with +
- We might have to distinguish which one is modifier - maybe we could consider names longer than 1 as modifiers. or hardcode modifiers but hope this could be fewer than all characters
I'm kind of prefer this version, as there're tons of characters, and we might need to consider localization per contries's keyboard layout when we manage them by ourselves 😹 But it's totally your call!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had a play with changing it over, and it's quite a bit worse - there are a bunch of missing keys, and a bunch of keys which are displayed wrong:
- All function keys are missing
- Special keys are mislabelled (
Keyboard back/forward
isArrow left/right
) - Cmd modifier doesn't seem to show up on Linux
I think longer term it might be good to try and fix the GetShortcutsText function (maybe upstream...) but for now this produces much better results :'(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(maybe upstream...)
Yeah, I don't want you to go through that tough way haha. Maybe we can wrap the GetShortcutText() and fix up some of the results later on.
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
67c46b1
to
a147bcc
Compare
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
6aefebc
to
3f2fdb4
Compare
A Storybook has been deployed to preview UI for the latest push |
3f2fdb4
to
b5d6f44
Compare
@rillian I accidentally committed |
A Storybook has been deployed to preview UI for the latest push |
@fallaciousreasoning dismissed |
f479497
to
3a18b17
Compare
A Storybook has been deployed to preview UI for the latest push |
3a18b17
to
880aa41
Compare
A Storybook has been deployed to preview UI for the latest push |
880aa41
to
1b8906a
Compare
A Storybook has been deployed to preview UI for the latest push |
@fallaciousreasoning Worked on the design here, it's a simple restyling for now to just use Brave's flavors: |
source_set("browser_tests") { | ||
testonly = true | ||
|
||
if (!is_android && !is_ios) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I realize this is an old PR, but I'm trying to understand this part. Is it intentional to only build this browser test on desktop? Unless I'm not understanding, this browser test is definitely meant to run on Android at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the code doesn't run on Android/iOS at all, so the test only runs on desktop too - it should probably have its own buildflag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think you're saying that command_utils_browsertest
isn't supported on Android. But this change also prevents brave_main_delegate_browsertest
from running on Android (even though it was previously supported there). Maybe I'm not understanding though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a PR that's addressing this, just trying to figure out if it was intentional. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That probably was not intentional 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, no problem! I'm moving the feature tests into a unit test and also making them run on Android in this PR: #22516.
Fixes brave/brave-browser#28329
This PR makes it possible to view the available commands in Brave on the
brave://commands
page when thebrave://flags/#brave-commands
flag is on.