[Touch/Swipe keyboard] Multiple keyboards conflict with each other
Affected hardware version
Bangle 2
Your firmware version
2v13
The bug
Describe the bug
When installing multiple keyboards - let's say you install touch keyboard first, then swipe keyboard next - swipe keyboard overrides touch keyboard. But if you then uninstall swipe keyboard, no keyboard pops up. In order to get touch keyboard again, one must delete and re-install touch keyboard from the app loader.
Expected behavior
When multiple keyboards are installed, and then the one being currently used gets uninstalled, Bangle should default to the one still installed. Alternatively, is it possible to allow users to select which keyboard to use?
Steps to reproduce
- Install touch keyboard, and then install swipe keyboard.
- Uninstall swipe keyboard.
- Use an app that makes use of the keyboard. Instead of a keyboard popping up, there will only be a blank screen.
I just verified the following: Keyboard apps write their lib.js (app/library code) to the file 'textinput'. If installing a second one, 'textinput' is overwritten. If one of the keyboard apps is deleted then so is 'textinput'. So even though a keyboard-corresponding .info file exists, there is no functionality left.
If one wanted to handle this differently than above a backup of the first installed 'textinput' could be made before it's overwritten which is then restored when the second installed keyboard is uninstalled.
I cannot reproduce this bug using frigis1's app loader. For me this happens when trying to reproduce:
- Install Touch keyboard: Touch keyboard is installed.
- Install for e.g. Noteify: Scheduler is installed (dependency). Noteify is installed.
- Uninstall Swipe keyboard and attempt to use keyboard in app: No Swipe keyboard to uninstall. Text input works.
- Delete and re-install Touch Keyboard: Not necessary in this case.
I.e. for me it works as one would expect it to.
Bangle.js2, FW 2v13
Thank you for your feedback! I factory reset my watch, updated the firmware, and as thyttan said everything works as expected. If nobody minds, I'll edit the original post as installing multiple keyboards is still an issue.
Thanks. I guess this is a more generic issue actually - the App Loader is going to have to check whether an app of the same type is currently installed. Any thoughts on whether it should:
- Silently delete the other app
- Refuse to install the new app with a message explaining why
- Prompt about what to do
or both apps merges into a single one and you install the different type like e.g. the locale app.
@gfwilliams Of the three choices, perhaps a message warning that installing another keyboard will delete the currently installed keyboard. Also, in cases where a user uninstalls all keyboards and then uses an app that requires a keyboard - instead of a blank screen, would it be possible to have a message instructing the user to install a keyboard?
in cases where a user uninstalls all keyboards and then uses an app that requires a keyboard
I think that one's too hard to do, however each app could check itself. I guess the best option is to check when uninstalling an app (like keyboard) if any existing apps require it, and warn if so.
a message warning that installing another keyboard will delete the currently installed keyboard
The problem is that it only overwrites the one file, but you also want to clean up the rest of the files.
I think the nicest solution would be prompting with a choice of
- Replace existing app: uninstall the other app before installing new one
- Keep existing app: do nothing
- Overwrite conflicting files anyway: resulting in breakage
I think that one's too hard to do
Maybe we could have a visible error when apps try to use missing modules? Making the built-in behaviour work like
global.require = (_r=>function(m) {
if (!_r("Storage").list(m).length) E.showMessage(`Module ${m} not found`);
return _r(m);
})(require);
Apps would still break, but at least the problem would be clearer to users.