Make Return Value for handleCommand Be Ternary

Right now handleCommand returns a boolean. However, as I modified settings, I realized there may well be three cases:

  1. The current screen handled it, we're good. This is "true" now.
  2. The current screen doesn't know the command, and is delegating to the global. This is "false" now.
  3. The current screen expected a value, but got one it couldn't understand. It has an error message, but it's possible the global handler might be able to do something with this value.

The third one doesn't quite overlap with false; false works in that the global handler will try to do something, but doesn't in that the error message should be from the specific screen if the global one can't handle something.

In particular, the settings screen is a good example - if the users says they want to change a setting, it is expected that they are going to enter a value for that new setting, but they could decide they want to bail instead. With the true/false dichotomy, we can't both show a sensible error message and let them bail out.

Assigned to
1 year, 7 months ago
1 year, 7 months ago
No labels applied.