Skip to content

Improve collection form#800

Merged
mihow merged 16 commits intomainfrom
style/improve-collection-form
Jul 4, 2025
Merged

Improve collection form#800
mihow merged 16 commits intomainfrom
style/improve-collection-form

Conversation

@annavik
Copy link
Copy Markdown
Member

@annavik annavik commented Apr 8, 2025

Summary

In this PR we try to make the form for creating collections a bit more user friendly.

List of Changes

  • Split form up into sections to bring some structure
  • Use new date picker for date values
  • Add descriptions and error handling to number inputs
  • Skip fields "Earliest date" and "Earliest month" (our current assumption is that start date and end date will be enough)
  • Replace text input for "Sampling method" with a select
  • Conditionally show fields related to sampling method, depending on what type is selected

Related Issues

Closes #472.

Detailed Description

For the sampling method, we will still always pass "common_combined" to the backend. The new field "Type" is only there to make things easier to understand for users. I'm curious if we could try align this more with the sampling methods available on the backend side though.

As part of the changes, we are also trying to further align form components used in app, for example by introducing a shared SaveButton component to streamline how loading state and success state is presented.

Screenshots

Before:
Screenshot 2025-04-08 at 16 44 12

After:
Screenshot 2025-04-08 at 16 41 51
Screenshot 2025-04-08 at 16 41 58
Screenshot 2025-04-08 at 16 42 06

Deployment Notes

Users should be notified that their existing collections will no longer be editable.

@annavik annavik requested a review from mihow April 8, 2025 15:10
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2025

Deploy Preview for antenna-preview canceled.

Name Link
🔨 Latest commit 9fe4ded
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/6868300f9f634b000833771f

@mihow
Copy link
Copy Markdown
Collaborator

mihow commented Apr 8, 2025

@mihow consider removing common_combined and updating the specific sampling methods instead, now that we have custom fieldsets for each sampling type.

Comment thread ui/src/data-services/models/collection.ts Outdated
Comment thread ui/src/pages/project/entities/details-form/collection-details-form.tsx Outdated
Comment thread ui/src/pages/project/collections/constants.tsx Outdated
@mihow
Copy link
Copy Markdown
Collaborator

mihow commented Apr 28, 2025

@annavik can we add the selector for Stations to this PR? Or at least allow a list of comma separated IDs for now?

@annavik
Copy link
Copy Markdown
Member Author

annavik commented Apr 29, 2025

@annavik can we add the selector for Stations to this PR? Or at least allow a list of comma separated IDs for now?

Yes, on it! :)

@annavik
Copy link
Copy Markdown
Member Author

annavik commented May 15, 2025

@annavik can we add the selector for Stations to this PR? Or at least allow a list of comma separated IDs for now?

Actually can we handle this as a follow up task? I realize we need new UI components for this and it would be helpful to have this merged 🙏

@mihow mihow changed the base branch from main to deployments/ood.antenna.insectai.org May 23, 2025 07:28
@mihow mihow changed the base branch from deployments/ood.antenna.insectai.org to main May 23, 2025 07:28
@mihow mihow mentioned this pull request Jun 25, 2025
5 tasks
@annavik
Copy link
Copy Markdown
Member Author

annavik commented Jul 4, 2025

Can we merge this @mihow?

Copy link
Copy Markdown
Collaborator

@mihow mihow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this with more existing collections and it seems to work well! The edit button is disabled for most existing collections because they use the "common_combined" sampling method which is now depreciated. So we should notify users that they will need to create new collections if they want to modify the parameters of existing collections. However, they can re-populate (e.g. update) the existing collections with the depreciated method.

Thanks for greatly improving our collections form!

@mihow mihow merged commit c2e5bb3 into main Jul 4, 2025
8 checks passed
@mihow mihow deleted the style/improve-collection-form branch July 4, 2025 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choose sampling from dropdown (+ improve UI in general for registering a collection)

2 participants