`/sap.ui5/commands/shortcuts` description insufficient
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 74
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Description
In the topic Descriptor for Applications, Components, and Libraries section sap.ui5/commands, it says
Specifies provided commands with a unique key/alias. Contains:
shortcut: String that describes a key combination. When the user presses the key combination, the command is triggered.
Unfortunately it is not enough to understand how it can be achieved exactly.
- Is the
shortcutvalue space-sensitive or case-sensitive? (Yes and no, according to the current source code) - Are single key commands allowed? (Yes, according to the source code)
- Are commands freely definable or is there a limited set of allowed commands?
- List of already defined shortcuts categorized by UI5 controls: https://help.sap.com/docs/SAPUI5/bc5a64aac808463baa95b4230f221716/144d377d68784689a9b21565dfa14065.html
- List of already defined shortcuts by SAP Fiori elements: https://github.com/SAP-docs/sapui5/blob/main/docs/06_SAP_Fiori_Elements/keyboard-shortcuts-0cd318c.md which states the following restrictions:
-
Don't use a keyboard shortcut for a custom button that is already defined as a standard shortcut by SAP Fiori elements. This results in unexpected behavior.
-
Keyboard shortcuts aren't supported for application-defined inline actions and inline navigation buttons in tables.
-
- As per
sap/ui/core/util/ShortcutHelper:- List of disallowed shortcuts (
mDisallowedShortcuts) - List of valid shortcut string parts (should pass
validateShortcutString)
- List of disallowed shortcuts (
- Other limitations?
- Document: adding
<core:CommandExecution command="MyCommand"/>requires"MyCommand": { "shortcut": "..." }to exist inmanifest.json.Otherwise, this will lead to the following error which prevents the app from being cleaned up:TypeError: Cannot read properties of null (reading 'shortcut')
... and causes the "duplicate id" error when attempting to open the app again.
Fix 1: https://github.com/SAP/openui5-docs/pull/90
Fix 2: https://github.com/SAP/openui5/commit/a500d77e530fc41f58cf8d1c4aded4c88349516b "CommandExecution: Log error when command not found + make destroy fail-safe" - Document: focus-independent or focus-less command execution is not allowed either (Cf. https://github.com/SAP/openui5/issues/2788).
- ...
- Document: adding
- Brief documentation regarding the popup opened by the
sap.ui.core.ShortcutHintsMixinand how the popup's behavior differs from the native tooltip. → There are cases where the native tooltip and the shortcut popup are both shown at the same time. According to some users, it's confusing since the popup and the native tooltip don't differ much in visual design (depending on the OS).
A link pointing to a dedicated topic would be nice so that readers can learn more if they intend to implement commands.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sap.ui5/commands section in Descriptor_for_Applications, Components, and Libraries_be0cf40.md, then read sap/ui/core/util/ShortcutHelper.js and sap/ui/core/ShortcutHintsMixin.js alongside the linked shortcut documentation. Done means a dedicated topic explains shortcut syntax and limitations, focus requirements, command configuration, and the popup-versus-tooltip behavior, with a link from the descriptor section.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100