FEATURE: allow plugins to specify keyboard shortcuts for hidden toolbar items (#28456)

Previous to this change there is no clean way to apply keyboard shortcuts
to things such as "add poll" and other hidden options in the toolbar

This allows shortcuts to be specified similar to how they are on the toolbar



Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is contained in:
Sam
2024-08-23 09:28:28 +10:00
committed by GitHub
parent 02af4fb5b8
commit 7ab7e6bb23
11 changed files with 165 additions and 36 deletions

View File

@ -13,7 +13,6 @@ import {
query,
} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import I18n from "discourse-i18n";
acceptance("Discourse Presence Plugin", function (needs) {
needs.user({ whisperer: true });
@ -83,7 +82,7 @@ acceptance("Discourse Presence Plugin", function (needs) {
const menu = selectKit(".toolbar-popup-menu-options");
await menu.expand();
await menu.selectRowByName(I18n.t("composer.toggle_whisper"));
await menu.selectRowByName("toggle-whisper");
assert.strictEqual(
count(".composer-actions svg.d-icon-far-eye-slash"),