SymDSTools / PluginGenerator

A JavaScript Plugin generator for DroidScript
43 stars 15 forks source link

User can't exit JSPluginGen prompt #3

Open TonyGravagno opened 1 year ago

TonyGravagno commented 1 year ago

The do/while around this prompt() effectively disables the Cancel button and locks the user into a loop if they just want to get out. It's a bad UX. Screenshot_20230321-073720

https://github.com/SymDSTools/PluginGenerator/blob/a76245768ac127008bfe1ab07db3e4a47b44c61a/JSPluginGen/JSPluginGen.js#L129

For anyone stuck in this, I recommend replacing:

do
   conf.name = prompt(
       "How would you like your plugin to be called?",
   "");
while (!conf.name || !conf.name.trim());

with

conf.name = prompt(
    "How would you like your plugin to be called?",
"");
if(conf.name === null) return;

In the bigger picture though, this needs more explanation and a bit of refactoring.

  1. Don't put the prompt() on top of the initial alert().
  2. Open with a clear explanation of how this tool is to be used and what it does.
  3. The Readme text is unclear about what needs to be copied and then what the app does. The prompt() gets a name and then substitutes that name into the. js and html files. It is ALSO a tool to generate and test plugins from that code.
  4. I believe this would be more intuitive with a button to open the prompt, get the name, and do the substitutions. Screenshot_20230321-084149