A browserAction button can be "clicked" by a keyboard shortcut, but a composeAction button cannot
Categories
(Thunderbird :: Message Compose Window, enhancement)
Tracking
(thunderbird_esr78 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | wontfix |
People
(Reporter: k-l-p, Assigned: TbSync)
References
Details
Attachments
(2 files, 4 obsolete files)
29.21 KB,
patch
|
darktrojan
:
review+
|
Details | Diff | Splinter Review |
2.37 KB,
patch
|
TbSync
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Steps to reproduce:
in manifest.json:
"commands": {
"_execute_compose_action": {
"suggested_key": {
"default": "Ctrl+Shift+Y"
}
}
}
See also https://thunderbird.topicbox.com/groups/addons/Tf0e478d7b210e4dd
Actual results:
Nothing
Expected results:
composeAction button should be "clicked" by the keyboard shortcut "Ctrl+Shift+Y"
Assignee | ||
Comment 1•3 years ago
|
||
Before working on a test, I would like to know if this is the correct way to fix this.
Comment 2•3 years ago
|
||
Comment on attachment 9192224 [details] [diff] [review]
bug1681153_add_support_for_execute_compose_action_and_execute_message_display_action.patch
Yeah, this is great, it's more-or-less what I was going to suggest anyway. I think there's a test for browserAction already that you can work with.
Assignee | ||
Comment 3•3 years ago
|
||
Now with tests.
Comment 4•3 years ago
|
||
Comment on attachment 9198204 [details] [diff] [review] bug1681153_add_support_for_execute_compose_action_and_execute_message_display_action_v2.patch Review of attachment 9198204 [details] [diff] [review]: ----------------------------------------------------------------- Looking good. I'd just like the tests to cover some more potential cases. ::: mail/components/extensions/test/browser/browser_ext_commands_execute_compose_action.js @@ +9,5 @@ > + applications: { > + gecko: { > + id: "commands_execute_compose_action@mochi.test", > + }, > + }, You don't need an ID unless you're going to look for it later. If you did this after looking at my recent changes, I only changed IDs where there was already one. In other cases a random string is used so no problem with conflicts there. @@ +41,5 @@ > + </html> > + `, > + > + "popup.js": function() { > + console.log("sending from-compose-action-popup"); Use `info` for logging during tests. Console messages show up out-of-sync in test logs which makes them less useful than they could be. @@ +128,5 @@ > +}); > + > +add_task(async function test_execute_compose_action_without_popup() { > + await testExecuteComposeActionWithOptions(); > +}); I'd like this tested with `default_area: "formattoolbar"` too. ::: mail/components/extensions/test/browser/browser_ext_commands_execute_message_display_action.js @@ +131,5 @@ > +}); > + > +add_task(async function test_execute_message_display_action_without_popup() { > + await testExecuteMessageDisplayActionWithOptions(); > +}); Please can we test message displays in a new tab and a new window? It's a bit of extra work but may save regressions in the future. ::: mail/components/extensions/test/browser/head.js @@ +293,5 @@ > + { once: true } > + ); > + }, > + }; > + Services.ww.registerNotification(observer); I know you're just moving this code, but while you're at it can you change it to use a BrowserTestUtils function? `promiseAlertDialogOpen` or `domWindowOpened` with a check on the URL. (It's from the time before I knew about these functions.)
Assignee | ||
Comment 5•3 years ago
|
||
Updated the test.
Comment 6•3 years ago
|
||
Comment on attachment 9198679 [details] [diff] [review] bug1681153_add_support_for_execute_compose_action_and_execute_message_display_action_v3.patch Review of attachment 9198679 [details] [diff] [review]: ----------------------------------------------------------------- You've put the format toolbar option in the wrong test. That's a composeAction thing. Otherwise I think we're okay here. ::: mail/components/extensions/test/browser/browser_ext_commands_execute_message_display_action.js @@ +38,5 @@ > + <meta charset="utf-8"> > + <script src="popup.js"></script> > + </head> > + <body>popup.js</body> > + </html>`, Why does this file differ from the one in the other two tests? ::: mail/components/extensions/test/browser/head.js @@ +313,5 @@ > + ); > + return true; > + } > + ); > + window.MsgOpenNewWindowForMessage(); I recently learned this function takes an optional msgHdr argument and I think in future we should use it wherever possible instead of relying on the currently selected message. Likewise MailUtils.displayMessage instead of MsgOpenSelectedMessages. I'm not going to force you to do it here because these tests don't care what the message is, but something to consider next time.
Assignee | ||
Comment 7•3 years ago
•
|
||
The popup html files are identical now and the formattoolbar thing has been moved to the composeAction test.
I added the msg
parameter to openNewWindowForMessage
and used it in my test.
I did not touch MsgOpenSelectedMessages
. I suggest to open a new bug for that (do you want a wrapper in head.js? How should it be called?) so we do not forget.
Edit: Patch was broken. Ignore.
Assignee | ||
Comment 8•3 years ago
•
|
||
The popup html files are identical now and the formattoolbar thing has been moved to the composeAction test.
I added the msg
parameter to openNewWindowForMessage
and used it in my test.
I did not touch MsgOpenSelectedMessages
. I suggest to open a new bug for that (do you want a wrapper in head.js? How should it be called?) so we do not forget.
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 9•3 years ago
|
||
(In reply to John Bieling (:TbSync) from comment #8)
I did not touch
MsgOpenSelectedMessages
. I suggest to open a new bug for that (do you want a wrapper in head.js? How should it be called?) so we do not forget.
There's nothing that needs to change unless you really want to, just something to think about when writing tests in future.
Assignee | ||
Updated•3 years ago
|
Comment 10•3 years ago
|
||
Please set tracking flags for the branches for what you intend to uplift or not.
Comment 11•3 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/137d5a4c564a
add support for _execute_compose_action and _execute_message_display_action commands in commands API. r=darktrojan
Assignee | ||
Comment 12•3 years ago
|
||
Fails the following test on mac:
mach test comm/mail/components/extensions/test/browser/browser_ext_commands_execute_compose_action.js
Assignee | ||
Comment 13•3 years ago
•
|
||
It looks like the test is delayed at startup, so that it runs into the timeout. But why?
https://treeherder.mozilla.org/logviewer?job_id=328249166&repo=try-comm-central&lineNumber=3850
Comment 14•3 years ago
|
||
The issue here is that the shortcut key needs a variation for macOS.
Alt
on macOS doesn't really exist as it's Option
, so shortcuts should be changed to use Ctrl
which is actually the Command
or metaKey
.
The test pass locally, here's a try run to see if it works: https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=f3f336b153706234cef318d3c74e0b61a55ed4ab
Assignee | ||
Comment 15•3 years ago
|
||
Comment on attachment 9200165 [details] [diff] [review]
1681153-macos-followup.diff
Thanks Alessandro for your help with this. In the long run I need a mac to be able to test locally.
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 16•3 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/f2a474f546d0
Follow up fix test for macOS. r=TbSync
Assignee | ||
Comment 19•3 years ago
•
|
||
Todo: Include shortcuts like _execute_compose_action
in the documentation.
Assignee | ||
Comment 22•3 years ago
|
||
Before requesting uplift, I wanted to make sure it is upliftable, as we have made some serious changes to the tests. I had this scheduled for next week.
Updated•3 years ago
|
Description
•