debugger icon indicating copy to clipboard operation
debugger copied to clipboard

ContextMenus should show keyboard shortcuts

Open jasonLaster opened this issue 9 years ago • 15 comments

The old debugger used to show keyboard shortcuts. It would be nice to have this behavior as well as it's a good education

New Debugger

screen shot 2017-07-06 at 10 26 13 pm

Old Debugger

screen shot 2017-07-06 at 10 19 47 pm

jasonLaster avatar Aug 15 '17 18:08 jasonLaster

If the acceltext attribute is set on the <menuitem> then it will print it out with native styling. For instance, acceltext="⌘P". However, in order for this to happen automatically the menuitem has to have a key attribute pointing to a xul key.

The acceltext could potentially be generated explicitly via ShortcutUtils.jsm from a <key> element, and the old debugger does do that for things like tooltips. If we want to avoid using <key> elements altogether then we could modify that module a bit to accept metadata.

How do we do keyboard shortcut handling in the debugger, again?

bgrins avatar Aug 15 '17 20:08 bgrins

We use key-shortcuts via a shortcuts context: https://github.com/devtools-html/debugger.html/blob/master/src/components/Editor/index.js#L207

jasonLaster avatar Aug 15 '17 20:08 jasonLaster

OK, and how is the menu that ultimately calls onToggleBreakpoint constructed?

bgrins avatar Aug 15 '17 20:08 bgrins

I think I'd modify KeyShortcuts.stringify function to more closely match ShortcutUtils.prettifyShortcut, and then manually set the acceltext to that value whenever the menuitem is created

bgrins avatar Aug 15 '17 20:08 bgrins

/claim

lukaszsobek avatar Dec 02 '17 21:12 lukaszsobek

Thanks for claiming the issue! :wave:

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Dec 02 '17 21:12 claim

/unclaim

lukaszsobek avatar Dec 12 '17 08:12 lukaszsobek

Done :+1:

claim avatar Dec 12 '17 09:12 claim

/claim

lukaszsobek avatar Mar 02 '18 04:03 lukaszsobek

Thanks for claiming the issue! :wave:

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Mar 02 '18 04:03 claim

@lukaszsobek I'm un-assigning you as it's been two weeks and this is a panel bug. Feel free to re-claim

jasonLaster avatar Mar 12 '18 21:03 jasonLaster

This potentially is not that important in comparison to other things, but I've been wanting this forever. I'm sure I made other issues for this also. But I seem to remember there was something blocking it.. Anyways, claiming it.

jbhoosreddy avatar Sep 05 '18 00:09 jbhoosreddy

/claim

jbhoosreddy avatar Sep 05 '18 00:09 jbhoosreddy

Thanks for claiming the issue! :wave:

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Sep 05 '18 00:09 claim

I should have a PR for the Panel by tomorrow

jbhoosreddy avatar Sep 12 '18 04:09 jbhoosreddy