firmware icon indicating copy to clipboard operation
firmware copied to clipboard

Canned message usability improvements

Open robertfisk opened this issue 1 year ago • 10 comments
trafficstars

This PR fixes some usability issues I've encountered with the canned message module and a standalone keyboard.

  1. The Screen timer jumps away from the CannedMessageModule frame while the user is typing a message. Kinda annoying. Solution: Return early from Screen::handleOnPress if cannedMessageModule->shouldDraw() returns True.

  2. The CannedMessageModule thread was not being scheduled to process the INACTIVATE_AFTER_MS timeout, because CannedMessageModule::runOnce() was running in the caller's context (e.g. the keyboard thread). Solution: Pass the return value of CannedMessageModule::runOnce() to setIntervalFromNow().

  3. Don't reset half-typed messages when timing out back to regular screens, so the user can resume typing later.

  4. Canned message list sometimes fails to timeout. Solution: Change timeout comparison operator from ">" to ">="

  5. Don't inconsistently clear freetext when scrolling canned message list.

  6. Restore old canned message state after displaying popup message (the user might be typing another msg). Also don't clear freetext/state after displaying popup message.

robertfisk avatar Aug 11 '24 12:08 robertfisk

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 11 '24 12:08 CLAassistant

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Aug 11 '24 12:08 CLAassistant

Note: user button will no longer dismiss the canned message frame. Some input methods will need to wait 20 seconds for timeout.

Merge only if this is acceptable.

is there a way to allow the user button to still dismiss the canned message frame? it's a button and it can be easily pressed by mistake. Having to wait 20sec does stop you from looking at other things that may be needed urgently.

HarukiToreda avatar Aug 28 '24 15:08 HarukiToreda

This PR fixes some usability issues I've encountered with the canned message module and a standalone keyboard.

  1. The Screen timer jumps away from the CannedMessageModule frame while the user is typing a message. Kinda annoying. Solution: Return early from Screen::handleOnPress if cannedMessageModule->shouldDraw() returns True.
  2. The CannedMessageModule thread was not being scheduled to process the INACTIVATE_AFTER_MS timeout, because CannedMessageModule::runOnce() was running in the caller's context (e.g. the keyboard thread). Solution: Pass the return value of CannedMessageModule::runOnce() to setIntervalFromNow().
  3. Don't reset half-typed messages when timing out back to regular screens, so the user can resume typing later.
  4. Canned message list sometimes fails to timeout. Solution: Change timeout comparison operator from ">" to ">="
  5. Don't inconsistently clear freetext when scrolling canned message list.
  6. Restore old canned message state after displaying popup message (the user might be typing another msg). Also don't clear freetext/state after displaying popup message.

does this allow the escape button to still clear the message? because having to backspace a whole message may be a huge chore we didn't otherwise have to do before.

HarukiToreda avatar Aug 28 '24 15:08 HarukiToreda

is there a way to allow the user button to still dismiss the canned message frame?

There'd definitely be a way to make that happen. It'd mean suppressing the carousel behavior in a slightly different spot; maybe somewhere like here?

todd-herbert avatar Aug 28 '24 15:08 todd-herbert

This PR fixes some usability issues I've encountered with the canned message module and a standalone keyboard.

1. The Screen timer jumps away from the CannedMessageModule frame while the user is typing a message. Kinda annoying.
   **Solution:** Return early from Screen::handleOnPress if cannedMessageModule->shouldDraw() returns True.

2. The CannedMessageModule thread was not being scheduled to process the INACTIVATE_AFTER_MS timeout, because CannedMessageModule::runOnce() was running in the caller's context (e.g. the keyboard thread).
   **Solution:** Pass the return value of CannedMessageModule::runOnce() to setIntervalFromNow().

3. Don't reset half-typed messages when timing out back to regular screens, so the user can resume typing later.

4. Canned message list sometimes fails to timeout. **Solution:** Change timeout comparison operator from ">" to ">="

5. Don't inconsistently clear freetext when scrolling canned message list.

6. Restore old canned message state after displaying popup message (the user might be typing another msg). Also don't clear freetext/state after displaying popup message.

I'm not seeing a 20 second timeout, or any timeout when I start typing and stop using CardKB. I'm running the 2.5.0 technical preview on a RAK board. Are you using some custom firmware build where this occurs?

tropho23 avatar Aug 28 '24 15:08 tropho23

Here's my point-by-point observation of your observations:

1. The Screen timer jumps away from the CannedMessageModule frame while the user is typing a message. Kinda annoying.

  • I don't experience this.

2. The CannedMessageModule thread was not being scheduled to process the INACTIVATE_AFTER_MS timeout, because CannedMessageModule::runOnce() was running in the caller's context (e.g. the keyboard thread).

  • No comment.

3. Don't reset half-typed messages when timing out back to regular screens, so the user can resume typing later.

  • I don't experience a timeout, and half-typed messages are not reset. Just keep typing, it switches back to the freetext entry screen and you can pick up where you left off.

4. Canned message list sometimes fails to timeout.

  • Again I never experience a timeout at all, so if there is supposed to be one then it is indeed failing.

5. Don't inconsistently clear freetext when scrolling canned message list.

  • I experience clearing of a typed, but not sent message if I start typing then press the up or down key to enter canned messages mode. If I resume typing the previously typed, unsent message has been cleared. This happens every time for me, not inconsistent.

6. Restore old canned message state after displaying popup message (the user might be typing another msg). Also don't clear freetext/state after displaying popup message.

  • This would be nice, I agree. Right now you can resume typing but it's not obvious. If the user presses the Enter key, the half-typed message is sent. If the user presses Esc in an attempt to clear the received message screen, the half-typed message is lost.

tropho23 avatar Aug 28 '24 15:08 tropho23

I'm not seeing a 20 second timeout, or any timeout when I start typing and stop using CardKB. I'm running the 2.5.0 technical preview on a RAK board. Are you using some custom firmware build where this occurs?

I saw the carousel timeout issue when testing with 2.4.2 and 2.4.3 on a RAK4631. Do you have "Auto screen carousel" set to a low number like 10 seconds? If so then I will re-check on 2.5.0

The 20 sec canned message timeout is currently nonfunctional due to a couple of bugs, fixed in this PR.

robertfisk avatar Aug 29 '24 07:08 robertfisk

does this allow the escape button to still clear the message? because having to backspace a whole message may be a huge chore we didn't otherwise have to do before.

Yes, canned message will still close on reception of a meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL message, which is generated by the ESC key

robertfisk avatar Aug 29 '24 07:08 robertfisk

@tropho23 - does this patch break anything for you?

fifieldt avatar Sep 22 '24 02:09 fifieldt

Has anyone found that abnormal behavior cannot be switched when switching target nodes in canned message mode

Dylanliacc avatar Nov 21 '24 01:11 Dylanliacc

There are some good ideas in this PR. How shall we move forward?

fifieldt avatar Mar 15 '25 13:03 fifieldt

Sorry I haven't put much attention into this lately. Does it need splitting up into smaller PRs?

robertfisk avatar Apr 11 '25 09:04 robertfisk

@robertfisk we moved to a completely new UI implementation. Can you please check if any of the usability issues you encountered are left with the new system? if so we'd gladly review a PR again.

caveman99 avatar Jul 13 '25 16:07 caveman99

Thanks for the update. I'll open a new PR if I find anything that needs fixing in the new implementation

robertfisk avatar Jul 22 '25 07:07 robertfisk