BangleApps icon indicating copy to clipboard operation
BangleApps copied to clipboard

[Touch/Swipe keyboard] Multiple keyboards conflict with each other

Open frigis1 opened this issue 4 years ago • 8 comments

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

  1. Install touch keyboard, and then install swipe keyboard.
  2. Uninstall swipe keyboard.
  3. Use an app that makes use of the keyboard. Instead of a keyboard popping up, there will only be a blank screen.

frigis1 avatar Apr 10 '22 01:04 frigis1

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.

thyttan avatar Apr 10 '22 12:04 thyttan

I cannot reproduce this bug using frigis1's app loader. For me this happens when trying to reproduce:

  1. Install Touch keyboard: Touch keyboard is installed.
  2. Install for e.g. Noteify: Scheduler is installed (dependency). Noteify is installed.
  3. Uninstall Swipe keyboard and attempt to use keyboard in app: No Swipe keyboard to uninstall. Text input works.
  4. 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

thyttan avatar Apr 10 '22 13:04 thyttan

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.

frigis1 avatar Apr 10 '22 19:04 frigis1

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

gfwilliams avatar Apr 19 '22 10:04 gfwilliams

or both apps merges into a single one and you install the different type like e.g. the locale app.

nxdefiant avatar Apr 19 '22 10:04 nxdefiant

@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?

frigis1 avatar Apr 20 '22 05:04 frigis1

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.

gfwilliams avatar Apr 20 '22 07:04 gfwilliams

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.

rigrig avatar Apr 22 '22 14:04 rigrig