-
Notifications
You must be signed in to change notification settings - Fork 30
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
Classifier Dropdown Task (v3) - Simple Dropdown #1772
Conversation
packages/lib-classifier/src/plugins/tasks/SimpleDropdownTask/models/SimpleDropdownAnnotation.js
Outdated
Show resolved
Hide resolved
PR UpdateThis PR is now ready for review. I've added additional notes, stating that when a Simple Dropdown Task has no value selected, it should submit I'm thinking of folding the |
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.
I have some initial comments and recommendations on just an initial read through of the code
packages/lib-classifier/src/plugins/tasks/SimpleDropdownTask/models/SimpleDropdownAnnotation.js
Outdated
Show resolved
Hide resolved
packages/lib-classifier/src/plugins/tasks/SimpleDropdownTask/models/SimpleDropdownAnnotation.js
Outdated
Show resolved
Hide resolved
packages/lib-classifier/src/plugins/tasks/SimpleDropdownTask/models/SimpleDropdownAnnotation.js
Outdated
Show resolved
Hide resolved
packages/lib-classifier/src/plugins/tasks/SimpleDropdownTask/models/SimpleDropdownTask.spec.js
Outdated
Show resolved
Hide resolved
PR UpdateThanks to @srallen for spotting the major error with This branch has been updated with the following:
StatusReady for re-review! |
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.
Looks good to me. Can the nested ternary operators be split up? I find them very hard to read.
I'm a bit confused by the Other option. It's disabled, and has no tests, so I wonder if we should remove it from this iteration of the dropdown task?
packages/lib-classifier/src/plugins/tasks/SimpleDropdownTask/components/SimpleDropdownTask.js
Outdated
Show resolved
Hide resolved
Thanks Jim! The disabled 'Other' option has been detailed in the README.md, and the discussions of whether to snip the code out together was discussed in the v2 thread (sorry, that's a long haul). But the TL;DR is that the work was done and we probably will want to support it eventually, so might as well keep it as a simple toggle. I'll have to fix those ternary operators if they're hard to read, brb. |
These changes have been addressed.
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.
One blocking issue:
- Left an inline note on the usage of the
disabled
prop. You can see this working with the other task stories like the single task or multiple choice task. If you use a knob to change the subject loading state to loading, then you're unable to select an option. For the simple dropdown, if I set it to loading, I can still use the dropdown select.
Then a couple of non-blocking comments:
- I can use the
Select
with keyboard and pick an option using enter, but not space. I'm not sure if we want it working with space, but we've been customizing other task types to work with spacebar I think? Maybe @eatyourgreens has thoughts on this. - And yes, just for clarification, we're unsure if we're continuing to support the free text option here, but since Shaun already coded it, it has been left in with a few things still left to do like the tests. We have stats that show that a lot of project builders have enabled it, but it's unclear if it is actually being used. Analyzing classifications would be a lot of work, so that's why we don't know yet.
return ( | ||
<Box | ||
className={className} | ||
disabled={disabled} |
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.
Grommet's Box
doesn't take a disabled
prop, so I'm not sure what this does here.
packages/lib-classifier/src/plugins/tasks/SimpleDropdownTask/components/SimpleDropdownTask.js
Show resolved
Hide resolved
WebAIM says Spacebar for selecting options. That said, I think I usually use Enter when selecting an option with a native control, like the language menu in PFE projects. EDIT: WebAIM says Spacebar to expand the menu. I should have read it more closely. |
I've tested with the English/German language menu on Every Name Counts, which is a HTML |
06d22a1
to
8a026e6
Compare
Add disabled to the Select menu and test a disabled task.
I've added |
Trying this task out in the dev classifier, I'm finding that the classifier crashes when you submit a classification. #1830 (comment) EDIT: I see the same crash with a single choice question, so it's nothing to do with the dropdown task. I think this is ok to merge. |
PR UpdateI've updated this PR to match master and performed some extra checks to ensure functionality still looks legit.
Note: this PR will have #1830 merged on top of it. Again, much thanks to Jim for fixing that |
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.
I don't think I have anything else for this. LGTM. We do need to update the associated ADR with examples that are still missing for it...
I don't think this needs to be an experimental tool. This is essentially simplified / restricted version of the existing PFE task that comes as a result of known uses and lessons learned from that version. If there is an experiment that can be defined, I'd be happy to have it organizationally moved. This is in contrast to the transcription task, which is still an experiment, and I'm working with Sam right now to setup a test project re-running ASM data so we can compare the resulting classifications to make sure it works as we expect.
I had a look at https://local.zooniverse.org:8080/?env=production&project=12754&workflow=16106&subjectSet=85771 and the stories in storybook and the task appears to function as defined with tests passing.
Note: one non-blocking request would be to update the story for the task to be similar to the other task stories where we have a storybook-knob toggle to toggle the required state. I manually tested the required state by changing the task required state in the code and refreshing.
This adds an adapter (and tests) for the simple dropdown task, so that we can test it out in staging. Dropdown tasks are converted to simple dropdown tasks if they contain only one select menu. More complex tasks are not transformed, and should throw an error in the classifier.
Shaun's on leave now so I'm gong to merge this. |
PR Overview
Package:
lib-classifier
Associated issues: #1767 (ADR), #1679 (RFC)
Associated Project: Engaging Crowds
This PR adds a Simple Dropdown (type:
dropdown-simple
) task to the monorepo Classifier.<select>
which allows a single value to be selecteddropdown
) from PFEdropdown-simple
task type cannot be built in the PFE Project Builder, and has to be set up by a dev. Example project: https://local.zooniverse.org:8080/?env=production&project=12754&workflow=16106Please note that Simple Dropdown and Dropdown are two separate tasks, but can coexist. This
v3
branch (forward-looking Simple Dropdown, for new projects) is developed on top of thev2
branch (backwards-compatible classic Dropdown, for eventually porting PFE projects to the monorepo).Dev Notes
Simple Dropdown Task model:
Simple Dropdown Annotation model:
NOTE: if a simple dropdown has no value selected (as is the case when initially rendered), the annotation value is null.
Status
WIP
The simple dropdown is functional, annotations work, etc - but I need to clean up the README and snip out vestigial code from the v2 development.