phetsims / a11y-research

a repository to track PhETs research into accessibility, or "a11y" for short
MIT License
3 stars 0 forks source link

Dynamic Phrase Builder? #141

Open terracoda opened 5 years ago

terracoda commented 5 years ago

@emily-phet and I have bounced around a few ideas about how to make a simple but effect tool that helps with description design.

Our ideas have ranged from a fully editable A11y-Vew-Type interface to this simple phrase builder that uses the select element to play with phrase parameters.

I'd like to know if this little phrase builder in a very simple form would be something useful to designers and feasible to build in a short amount of time. It doesn't have to be pretty.

I uploaded a sample static HTML file with some potential specs: https://github.com/phetsims/a11y-research/blob/master/tools/phrase-and-parameter-sketcher.html

Here's a snap shot that I made in the W3 School's code builder:

Screen Shot 2019-06-21 at 1 18 57 PM
terracoda commented 5 years ago

Tagging @emily-phet , @jessegreenberg, @zepumph, @twant, @Matthew-phet for potential feedback.

terracoda commented 5 years ago

This issue is related to #136

jessegreenberg commented 5 years ago

@terracoda, this looks really cool! Can you comment on what this will provide that is currently not supported by current design tools like spreadsheets and docs? Is it mostly to help identify the parameters of a phrase and then see the sentence in full with params filled in or are there other things too?

https://github.com/phetsims/a11y-research/blob/master/tools/phrase-and-parameter-sketcher.html gave a good sense of what you are looking for, thanks! I think it would take a few hours to make a prototype.

terracoda commented 5 years ago

@jessegreenberg, this doesn't add a huge amount of functionality that a table in a design document would actually achieve. However, it is surely more interactive than a table in a design doc.

I think a tool like this might aid a designer in playing with the phrase and the parameters to carefully refine wording and perhaps splicing before implementation.

I think by being able to play with the phrase more directly might help find edge cases that require special wording or identify annoying splicing errors.

terracoda commented 5 years ago

@jessegreenberg, I have a feeling that it could potentially make the design and development process more efficient be reducing wording/splicing errors, and reducing the number of required updates to tables of examples or walk-throughs.

It could aid the designer in walking through the idea more completely in a direct way.

If the tool could actually export any useful results of the exploration then it could really reduce the need for a designer to document a robust series of examples. This would make documentation of the design more efficient and less verbose.

terracoda commented 5 years ago

It's taken a long time (various reasons) to get to the final phrase and parameters in the provided example.

terracoda commented 5 years ago

Here's the example in HTML preview: https://htmlpreview.github.io/?https://github.com/phetsims/a11y-research/blob/master/tools/phrase-and-parameter-sketcher.html

zepumph commented 5 years ago

Here is a link that you can use to look at the first prototype:

https://htmlpreview.github.io/?https://github.com/phetsims/a11y-research/blob/master/js/phrase-builder/phrase-builder.html

Basic instructions:

  1. Add your sentence into the first text area, with {{templateVars}} annotated with the double curly braces around the sides. You can only use letters inside the braces, no spaces.
  2. Once complete with the sentence, you can add the options for each var in the text areas below, each option gets its own line, and if you want an option that is blank, you can just include a blank line. Click the button for each templated var to add the options to the output sentence.
  3. The output sentence should have the updated options in the select box.
  4. You can edit the sentence all you want, but note that if you change a variable name, or remove it (even to copy paste it somewhere else), you will lose the options that were associated with that templated var.

Let me know what you think!

zepumph commented 5 years ago

Also assigning @emily-phet if she wants to comment.

terracoda commented 5 years ago

There are some bugs, but looks promising. I added a {{templateVars}} after the original set and I got some weird repetition and no new select box maker-thingy.

Screen Shot 2019-06-26 at 8 47 46 AM
terracoda commented 5 years ago

@zepumph, I'll have to do some more investigation, but I won't have time today, I don't think.

jessegreenberg commented 5 years ago

Really cool @zepumph, I like it a lot. Nice work!

zepumph commented 5 years ago

Sorry if I wasn't clear, it is designed so that each is named differently, like "templateVar1" etc.

terracoda commented 5 years ago

each is named differently, like "templateVar1"

I was wondering about that. I hadn't yet tried it, but will ;-)

zepumph commented 4 years ago

This is becoming a priority again, as much as it is helpful to designers. I think we will work on it more this corner.

Here is a wishlist for me after looking at it again for only a few minutes:

terracoda commented 4 years ago

Other things to keep in mind:

zepumph commented 4 years ago

I got through everything in the above bullets. @terracoda let me know how this looks. I made it so that much more is just done automatically. Please review.

emily-phet commented 4 years ago

@zepumph - where can I find the latest?

zepumph commented 4 years ago

http://htmlpreview.github.io/?https://github.com/phetsims/a11y-research/blob/master/js/phrase-builder/phrase-builder.html

Does this work? Right on we don't have a better way to host it, but I will work on that.

zepumph commented 4 years ago

Also note I just tried opening on a mobile device and it didn't look right. We may need a few changes to be more universal.

terracoda commented 4 years ago

That link no longer looks like what you shared with me last on Slack. The link loads this: Screen Shot 2020-04-14 at 1 36 03 PM

But I expected something like this: Screen Shot 2020-03-30 at 5 51 47 PM

zepumph commented 4 years ago

Me neither! I just made it so that we are hosting that page through github. Please review with this link:

https://phetsims.github.io/a11y-research/js/phrase-builder/

terracoda commented 4 years ago

This is looking awesome @zepumph.

It could be possible to have the same list of parameters show up more than once per sentence. Is it possible to do a sentence like this?

Or is it better to do this:

The reason I was thinking about this was because of phrases in BASE like:

terracoda commented 4 years ago

@zepumph, could you replace the instructional content with a list, so the initial text reads like step-by-step instructions:

Dynamic Phrase Manipulator This phrase creator supports rapid prototyping and verification of dynamic phrases used in dynamic descriptions and responses.

To create a phrase with dynamic parts:

  1. Type in a description phrase in the text area input.
  2. For the dynamic parts of the phrase, create uniquely named variables surrounded by curly braces, e.g. "{{templateVariable}}".
  3. A new text area input is created for each one of these curly-braced variables. In the newly created inputs for each variable, enter the options on a new line.

The output phrase will contain a select box for each variable populated with the entered options.

Refreshing the page will automatically load the most recently auto-saved phrases.

Input raw phrase with uniquely named variables within curly braces, {{exampleVariable}}:

...the rest looks good...

zepumph commented 3 years ago

Because of work done in https://github.com/phetsims/a11y-research/issues/161, I wanted to make sure this component still ran, so I wrote a bit of a build step for it. Please review and test by loading https://phetsims.github.io/a11y-research/js/phrase-builder/build/, which should be the exact same as the above, (before I broke it with the other issue's work).

terracoda commented 3 years ago

@zepumph, I tested a bit, and there are some issues on refreshing. I added a new variable (see resetHintTrue) and it didn't get loaded in the phrase down below. And I deleted a duplicate variable and it didn't get removed from the list (see 2 lightSource variables).

And I noticed an extra curly brace down below. I couldn't find a source from my example description.

terracoda commented 3 years ago

A screen shot may be helpful. Screen Shot 2021-02-01 at 6 26 55 PM

terracoda commented 2 years ago

@zepumph, I need this tool to be named "Phrase Builder".

When it is convenient to do so.

zepumph commented 2 years ago

How's that?

terracoda commented 2 years ago

The url and the title are good, but I would like the H1 to also be "Phrase Builder" in stead of "Dynamic Phrase Manipulator".

zepumph commented 2 years ago

Ahh gotcha, how about that?

terracoda commented 2 years ago

The H1 is great.

I decided to re-write the explanatory text. Let me know if there is a way for me to enter this new content directly.

If not, here's a link to the new content. https://docs.google.com/document/d/1XB7jhgr1ur6hMAh6rZgFYlzev9ALbr6ao_vBwnVqQg0/edit#

I rewrote everything using language we use in the course, and created a numbered list for the steps. I think it reads pretty well.

zepumph commented 2 years ago

I just spoke with @terracoda on slack, she will take a stab at updating https://github.com/phetsims/a11y-research/blob/master/js/phrase-builder/index.html, and then I will come in and ensure that the build still works. Thanks @terracoda!

terracoda commented 2 years ago

Ok, I added all the content for the instructions above where the text areas will begin.

For the first text area image

Change the bold text (the text area label) to: "Your description idea:"

And add the following help text

<p>
Enter your idea for a dynamic description with named parameters in curly braces. For example, "Stars in night sky are {{starBrightness}}.":
</p>

Ideally, the help text goes between the label and the actual text area box, but if that can't happen, the help text can follow the text area.

Then there is a sentence starting with "As template variables are added..." Change this sentence to:

<p>
As the named parameters are added to the description above, a text area for each parameter will be added below. Enter options for each named parameter on a new line.
</p> 

Then, just above this changed sentence add bolded text, the same size as above, and the same size as the "Output sentence", ADD: "Options for named parameters:"

Last, change "Output sentence" to "Output description".

I think that does it.