feat(common): Support a generic Keyboard Options user interface
- Dominant language
- Pascal
- Stars
- 534
- Forks
- 143
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 113
Description
Keyboard Options are supported on all platforms, however the options dialog which makes these visible to end users is supported only on Windows and Linux. The existing model of the options dialog is quite complicated to implement, as a separate options.htm file, and has a patchwork of Javascript to make it work.
This proposal is to make a standard options array in .kps files, under the corresponding `` entry. An options array would be a list of options, grouping headers, comments, etc:
## Data Model
### Meta entries
* Heading entry - a bold or enlarged text heading grouping subsequent items
* Text - a plain text entry, multi-line possible
* Link - a link to an external website (`https` prefix required?)
* Image - an image file included in the .kps, filename only allowed (no paths)
* Space - a spacer or blank line
```xml
```
### Option entries
These would reference a store name, and optionally we may include have a 'hidden' flag (useful for experimental options).
* Checkbox - a toggle, on-off. This would have on and off state values
* Select - a list of items, text + corresponding values
```xml
```
## Authoring User Interface
In the Package Editor, a dialog can be opened to edit the options array. The option entries can be populated from the .kmx file by clicking a button (or automatically on opening the dialog?). Users can add, remove, edit, and reorder option items.
The dialog and compiler will both validate that the referenced options exist. (Compiler may hint if an option is missing?)
## App User Interface
Keyman for Windows and Keyman for Linux would continue to support the options.htm model for now. All platforms will add an options dialog for a selected keyboard, if the keyboard has 1 or more options declared in the .kmp. The dialog will render the list of option entries from the data model above, and follow the system paradigm on instant update vs OK/Cancel buttons, etc.
## Earlier discussions
* Brainstorming Document: https://docs.google.com/document/d/1dgj5-gpD-hiiSFsrFXOICQCurePAgFxp-XaNzYLFu7U/edit
* Previously: As mentioned in keymanapp/help.keyman.com#97, `if()` statement is incomplete on Mac because the options.htm form is not supported.
Contributor guide
Assessment
This issue has not been assessed yet.