-
Notifications
You must be signed in to change notification settings - Fork 26
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
Refactor obs form with collapsible panels #2308
Conversation
Enable args[:content]
This is great for typical user on a mobile device. |
@JoeCohen If recorders are using field slips it's not a problem (assuming the create observation form not getting the locality info from the field slip form is fixed). If they aren't then they'll want the name and notes sections open. @nimmolo I agree we should work to minimize the number of empty fields that are visible and hide anything that is not yet relevant. But we need to balance that with showing all data that is automatically filled in. If this were the case, then when a new user clicks "Create Observation" it would just show the "Image / Select or drop files...", today's date, the locality field, and the scientific name field. Everything else would be hidden. If they enter the Locality then the "Is this location..." checkbox shows up. If they drop an image on the page that has lat/long then the locality is derived, and a lat/long panel opens that also has the Show map, Clear location, and Hide exact coordinates widgets. The Scientific Name field would be shown, but the confidence and checkboxes would not show up until a name is provided. I think it makes sense for the "Specimen Available" checkbox to always be visible. Leaving it next to the Scientific Name seems reasonable, but it honestly could be it's own sub-panel (since it kind of acts that way already). The Notes panel would be open if there is Notes data (from a Field Slip) or if they have an "Observation Notes Template" set. (As a side note, I wonder if we should make it easy to default to a reasonable subset of the standard Field Slip template to promote consistency. At least adding those as an example to the help text would be handy. I also wonder if the UI should let folks add fields if they want them, but that's definitely feature creep for this PR.) I think the Project and Species List panels should be open if the user has any of them checked automatically (from previous usage or the field slip form). I would also prefer it if in general the name of the panel toggled the panel and the V was next to the name of the panel. Otherwise I think we risk folks not being aware that they are subpanel and being confused by these words that don't seem to do anything. I know this is a bunch more work, but it seems like it would be slickest way to handle this while making a sensible balance between keeping the UI tight and ensuring that users see all the stuff they want/need to see before clicking "Create". |
@nimmolo I note that your image above implies that the sub-panel names are in a clickable bar with the V. However, when I run it locally that bar is not clickable and it's hardly visible from the "Agaricus" theme. |
My argument for showing them is that the user has control over the template and they went out of their way to include those fields as part of the form. I would guess that the vast majority of users who have any fields just have a handful of them. I agree it would be interesting to get @pellaea's opinion, but I'm guessing he won't really care and may even prefer to have it open. I know as a user of fields template, I would rather it was open by default than closed. |
Ok, considering the suggestions more thoroughly. Action items:
|
re: projects, yep i had missed that. I just pushed that change. locality and lat/lng in separate panels - Not really feasible considering the complexity of all the JS i just did: the locality (not just the lat/lng) interacts with, and depends upon, the map, particularly the whole "Create location" flow. I can just make a "show geolocation" checkbox to show hide the lat/lng, and show by JS if there are images. |
I love where this is going.
But the vast majority of recently created Observations that have images
also lack lat/lng.
29236 Obss created in the last year
29002 of those have images
21769 lack lat/lng
Is it possible that we're not picking up lat/ng from Android images added
via the website?
irb(main):011> *Observation*.where(*Observation*[:created_at] > *1*
.year.ago).count
=> *29236*
irb(main):014> *Observation*.where(*Observation*[:created_at] > *1*
.year.ago).where.not(*Observation*[:thumb_image_id] == *nil*).count
=> *29002*
irb(main):015> *Observation*.where(*Observation*[:created_at] > *1*
.year.ago).where.not(*Observation*[:thumb_image_id] == *nil*).where(lat:
*nil*).count
=> *21769*
…On Thu, Aug 15, 2024 at 6:31 PM Nathan Wilson ***@***.***> wrote:
Are you saying, put a checkbox next "Geolocation" (and maybe change it to
"Show geolocation" which can hide or show this bit:
Screenshot.2024-08-15.at.9.28.33.PM.png (view on web)
<https://github.com/user-attachments/assets/9ea7f01e-3e7a-4378-9a68-cb20087892c6>
But it would get checked automatically if there are images or the map gets
shown? If that's right, that sounds great!
—
Reply to this email directly, view it on GitHub
<#2308 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAALDFESFQPSST5AY6OG7BDZRVI5PAVCNFSM6AAAAABMRTYEDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGU2TMOJXGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Images without Geolocation. I created a new Issue, because it's (mostly)
outside the scope of this PR.
#2309
…On Fri, Aug 16, 2024 at 6:39 AM Joseph Cohen ***@***.***> wrote:
I love where this is going.
But the vast majority of recently created Observations that have images
also lack lat/lng.
29236 Obss created in the last year
29002 of those have images
21769 lack lat/lng
Is it possible that we're not picking up lat/ng from Android images added
via the website?
irb(main):011> *Observation*.where(*Observation*[:created_at] > *1*
.year.ago).count
=> *29236*
irb(main):014> *Observation*.where(*Observation*[:created_at] > *1*
.year.ago).where.not(*Observation*[:thumb_image_id] == *nil*).count
=> *29002*
irb(main):015> *Observation*.where(*Observation*[:created_at] > *1*
.year.ago).where.not(*Observation*[:thumb_image_id] == *nil*).where(lat:
*nil*).count
=> *21769*
On Thu, Aug 15, 2024 at 6:31 PM Nathan Wilson ***@***.***>
wrote:
> Are you saying, put a checkbox next "Geolocation" (and maybe change it to
> "Show geolocation" which can hide or show this bit:
> Screenshot.2024-08-15.at.9.28.33.PM.png (view on web)
> <https://github.com/user-attachments/assets/9ea7f01e-3e7a-4378-9a68-cb20087892c6>
> But it would get checked automatically if there are images or the map
> gets shown? If that's right, that sounds great!
>
> —
> Reply to this email directly, view it on GitHub
> <#2308 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAALDFESFQPSST5AY6OG7BDZRVI5PAVCNFSM6AAAAABMRTYEDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGU2TMOJXGQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Images + Details collapsible Fix carets display refactor formatted content
Thanks for the continued improvements. (Images + Details accordion-able; more things collapsed on Edit Obs.) Create Obs Location/Geolocation still presents some issue for me. The photo lat/lng is a long way from Deschutes Co., which is the Locality of my last-created Obs. That Obs was last created 23 Jul.
|
Fixed Joe's last issue. The issue was that I changed the HTML nesting around the locality autocompleter, to get the geolocation fields to be collapsible. But I had not moved the HTML ID. The ID needs to be on the outermost div that calls the Stimulus controller, to correctly connect to it. It was simply disconnected. |
#@mo-nathan @JoeCohen Please let me know if this solves it.
I tried including the naming fields in the top panel, but I didn't like them up there — it made it feel again like a barrage of too many fields all at once. This is now more like the iNat form: the identification and specimen stuff is right there above the "Create" button, but it has its own panel.
The "collapsed"ness of each panel, when the form is loaded or reloaded, is conditional upon whether there are form-validation-feedback messages present in the panel. If there are messages ("below"), the panel should now display them.
This PR is in progress, but I'd ideally like to get feedback before I clean it up.