-
Notifications
You must be signed in to change notification settings - Fork 29
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
Make the classifier's subject viewer sticky #6103
Conversation
@@ -4,7 +4,6 @@ export default function getLayout(layout) { | |||
if (layouts[layout]) { | |||
return layouts[layout] | |||
} else { | |||
console.warn(`Couldn't find a layout for '${layout}', falling back to default`) |
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.
Opinionated statement, but this warning was just cluttering the console during unit tests.
This is a BIG step in the right direction. Super useful to keep the subject in view at all times. I tried every preview link and they all work great. OK by me to move forward with implementing this. |
I have 2 small questions about page positioning and scrolling which I chatted about briefly with Delilah.
Screen.Recording.2024-05-23.at.3.17.44.PM.mov
Screen.Recording.2024-05-23.at.3.25.14.PM.movI'd love to unify the behavior here. Either they both bring you back to the top of the page (preferably just above the subject, no need to see the header and project header), or you will retain your page position for both. |
|
The jarring scroll-to-top behavior with the survey task specifically is because the Chooser component (all the animal options), and the Choice component (form that collects final answer) are drastically different heights. Only one renders at a time, and usually the Choice component is much taller than the Chooser because it includes example images, paragraphs, select buttons, etc. If a volunteer selects an animal to identify, they see the Choice component, scroll down so the "Identify" button is in the middle of their screen vertically, click "Identify", but then the Choice component is replaced with the shorter Chooser component. This throws off window positioning regardless of whether the subject area is sticky. One way to solve this is to make the survey tasks's Choice component scrollable in an isolated manner, rather than scrolling the entire page. However, there's a similar problem for projects that have a super tall task area like: To summarize, the cause of the window jumping back up to the top when a volunteer clicks buttons in the task area is because it changes height while the subject image height remains the same, and the browser takes a best guess about position. In a perfect world, all components of the classifier would be designed to fit inside a volunteer's screen height for an immersive experience. Making the subject viewer sticky is a step toward that and I would still like this PR reviewed as is. I'm hesitant to manually manipulate users' scroll position, but something we could explore is a function triggered by Done, Next, Back, and the survey task Identify buttons that says "if the top edge of the classifier is above a user's viewport, scroll their screen so the top edge of the classifier is at the top edge of their viewport". In a separate PR though. |
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.
This looks good! Tested on noted projects without issue.
Are we concerned with mobile browser behavior? Uploading TESSmobile.mp4… |
Hmmm I think I see what you mean on mobile. The video in your comment didn't upload, but I'll remove all sticky behavior for mobile-sized viewports before merging this PR! |
Package
lib-classifier
Linked Issue and/or Talk Post
Toward: #6063
Describe your changes
How to Review
A few types of projects to review are below. The full list of FEM projects is here.
Checklist
PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.
General
yarn panic && yarn bootstrap
ordocker-compose up --build
and FEM works as expectedGeneral UX
Example Staging Project: i-fancy-cats
New Feature