-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JN-1453] Add freetext editor to survey question designer #1349
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, this could probably use a simple frontend test though
Two things tripped me up when using it locally -- I didn't realize that the keyboard was a toggle -- it looked like a tab control. To make it clearer how to switch back, it would be nice to have the icon change (maybe a wand or something for the button to switch back). Then I was thrown that you couldn't switch to JSON view unless you had a stableId (or maybe it's that you can't go direct from typing mode to JSON mode?). This made me think I was trapped after typing in some stuff for a question. Might be nice to either enable the editor switch, or disable it with a note like "you must do to enter JSON mode" |
@devonbush thanks, that's great ux feedback. i'll rework this a bit. throwing into draft in the meantime |
<IconButton icon={showFreetextMode ? faKeyboard : faWandMagicSparkles} | ||
disabled={showJsonEditor} | ||
aria-label={showFreetextMode ? 'Switch to designer' : 'Switch to freetext editor'} | ||
onClick={() => setShowFreetextMode(!showFreetextMode)} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seemed to be some weirdness when I entered freetext mode in a panel where it didn't properly create a stableid and I ended up getting an error preventing me from saving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's how it behaves with regular questions too. We could auto-generate a question stable id, but since it's an identifier for research/operational datasets I think we should force the user to type one out. Of course, always open to changing later if we hear that it's annoying users!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, and I appreciate that it isn't destructive when you change an existing question to freetext mode.
rows={15} | ||
onChange={value => { | ||
setFreetext(value) | ||
const newQuestionObj = questionFromRawText(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, crazy that this function already existed!
ae0845f
to
740a673
Compare
Quality Gate passedIssues Measures |
DESCRIPTION (include screenshots, and mobile screenshots for participant UX)
TO TEST: (simple manual steps for confirming core behavior -- used for pre-release checks)
Go to the survey designer: https://localhost:3000/demo/studies/heartdemo/env/sandbox/forms/surveys/hd_hd_basicInfo
Click the new freetext button
Enter in some text, ensuring it creates text and radio questions correctly