Commit Graph

602 Commits

Author SHA1 Message Date
Johannes Klein
844629bbf4 Revert "Maintenance: break upload code into smaller modules -- realm syncing functions (#2872)"
This reverts commit 43f9520b86.
2025-04-29 16:53:25 +02:00
Amanda Bullington
43f9520b86 Maintenance: break upload code into smaller modules -- realm syncing functions (#2872) 2025-04-29 16:50:02 +02:00
Amanda Bullington
b362071b1b Change default explore view to observations map view (#2871)
* Set default explore view to observations

* Rearrange ObservationsViewBar buttons to always show grid first and map first in Explore

* Set initialRegion of Explore map to same zoom level as location picker, using delta

* Consolidate map code into MapView with ref forwarding to allow animation & initialRegion set

* Stop controlling the map region from zustand, since we're using initialRegion

* Make sure we're not double animating when navigating to a new place

* Use ref to only get map boundaries exactly when they're needed, instead of tracking in state

* Make sure current location button does the same as NEARBY button

* Update Explore integration tests to reflect observations view as first view

* Fix navigation Explore tests to reflect landing on observations view

* Update MapView unit tests

* Check location permissions in MapView on current location button

* Code cleanup

* Fix tests and add test for location permissions

* To Mob 720: add some types and null guards (#2878)

* Update Map with Region type

* Type initialRegion

* Guard against null

* Guard against undefined coordinates

* Center loading indicator but not fill space (#2880)

Move the loading indicator to the center of the parent (and back left and top for half its size).

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-04-28 11:53:47 -07:00
Amanda Bullington
6e87dafae4 Limit 429 errors in Explore taxa search (#2867)
* Prevent lots of extra renders from useTaxonSearch; prevent TaxonResult from refetching remote taxon

* Add debounce to SearchBar to prevent unnecessary API calls

* Reset local value when clearing search
2025-04-24 07:00:24 -07:00
Amanda Bullington
5d01431578 Prevent multiple taps on all Button components (#2844)
* Change text on Match loading screen (#2838) (#2841)

* Change copy for Match header & omit check for already seen species (#2837) (#2840)

* Fix: prevent multiple taps on Buttons like Suggest Id (#2833)

* Add debounce to Button to make sure users can't double tap any buttons / navigate twice

* Fix tests by mocking the Button component with a quick debounce

* Remove useEffect
2025-04-24 07:00:08 -07:00
Angie
6a61c3340d Decrease TaxonDetailHeader size to match ObsDetails header size (#2863)
* Decrease TaxonDetailHeader size to match ObsDetails header size

* Adjust taxondetails header to match obsdetails header
2025-04-22 09:57:12 -07:00
Amanda Bullington
332f419c98 Add tracking for Pressable and INatIconButton taps (#2855)
* Add tracking for Button taps

* Use PressableWithTracking and handlePress in INatIconButton to track all pressables with a testID

* Import as UnstyledPressableWithTracking for consistency
2025-04-16 08:54:41 -07:00
Johannes Klein
1dd114f96a Consistent margin around user profile stats (#2856)
* Increase margin top of user count buttons

* Use 30px of margin instead

* Do not show an empty container with margin when unable to Follow
2025-04-16 11:05:52 +02:00
Amanda Bullington
043ea1cf46 Fix: prevent multiple taps on Buttons like Suggest Id (#2833)
* Add debounce to Button to make sure users can't double tap any buttons / navigate twice

* Fix tests by mocking the Button component with a quick debounce
2025-04-08 12:46:01 -07:00
Kirk van Gorkom
7d125044a2 Merge pull request #2806 from inaturalist/mob-568-camera-location-fetching-should-happen-when-photo-taken-not-1
Fetch accurate camera location when shutter button / checkmark pressed
2025-04-04 18:06:27 -07:00
Amanda Bullington
84cb088949 Fix: limit API calls in AICamera to avoid delay in advancing navigation (#2820)
* Limit iconic taxa and fetchTaxa API calls

* Add timeout to geocoder

* Revert useTaxonSearch
2025-04-03 08:07:07 -07:00
Amanda Bullington
787410876f Update AICamera icon (#2815) 2025-03-31 13:55:04 -07:00
Amanda Bullington
915a2dd40f Fixes for e2e tests? 2025-03-31 10:48:21 -07:00
Amanda Bullington
213dc19dd0 Fetch location when observation processed; fetch separate location for geomodel without watch 2025-03-27 13:25:09 -07:00
Amanda Bullington
d782538109 Advanced settings UI updates (#2797)
* Open more options on long press

* Add tests for long press

* Rearranging Settings screen with new layout

* Add toggle for advanced settings in layout slice; fix default mode toggle

* Update settings with navigation flows

* Fix tests

* Change power mode switch for e2e test

* Fix settings test for green button toggle

* Fix advanced user toggle in e2e test (which hides pivot cards)

* Changes based on design convo; test fixes

* Fix e2e tests

* Follow user flow chart and update nav accordingly

* Rename function

* Fix test

* Can be null so check for false only

* Little less spacing between radio button rows

* Minor UI updates

* Remove check for previous setting in UI

* This is no longer used anywhere

* Update AICamera.test.js

* Update AICamera.test.js

* Update AICamera.test.js

* Update Suggestions.test.js

* Update Settings.test.js

* Update LanguageSettings.test.js

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-03-27 17:36:36 +01:00
Johannes Klein
a6b8a50425 Show a simple unviewed-activity-indicator for default obs list (#2801) 2025-03-26 09:05:02 +01:00
Amanda Bullington
7733ededfb Carousel, Permission, Match, Login, AI Camera copy edits (#2802)
* Text updates and AICamera icon update for onboarding carousel

* Update background image camera permission

* Update text for permission gates

* Update text match screen, login signup, and camera

* Fix AICamera test
2025-03-25 16:18:39 -07:00
Amanda Bullington
be53f87537 Add long press to AICamera gradient button in default/advanced (#2793)
* Open more options on long press

* Add tests for long press
2025-03-24 12:33:57 -07:00
Amanda Bullington
4bd212813e Update ai camera icon (#2792)
* First attempt, but need to replace SVGs

* Icons

* Update aicamera across app with Figma sizing
2025-03-21 13:16:25 -07:00
Angie
146886fbeb Increase tappable area of back button, remove console logs (#2787)
Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-03-20 10:02:00 +01:00
Johannes Klein
647aaf5457 Hide subscribe button from kebab menu when logged out (#2780)
* KebabMenu TS

* Hide subscribe button from kebab menu when logged out

Closes MOB-591

* Update import
2025-03-17 22:30:18 +01:00
Amanda Bullington
6f5d24df66 Zoom map in further when tapping current location button (#2774) 2025-03-14 17:14:17 -07:00
Amanda Bullington
2be121d1a8 Fade out MyObs checkmark without fading into ObsStatus (#2763)
* Don't fade into ObsStatus in MyObservations

* Update snapshot
2025-03-13 18:33:17 -07:00
Johannes Klein
b35952481f Make any CustomFlashList scrollable with Voice Over (#2756)
* Do not make FlashList wrapper accessible

Because it takes away a11y from the single items, and makes the list unscrollable with a11y commands.

* Remove a11y label

This was read without the actual param passed in so made no sense. Removing it for now. In that way at least the actual ID text is read.

* Make bottom sheet container not accesible
2025-03-13 11:26:46 +01:00
Amanda Bullington
d4d29b3aa8 Fix icons for dropdown carets in ObsEdit (#2748)
* Add icon

* Add icon

* Add icon

* Fix triangle dropdowns on ObsEdit other data section

* Update snapshots
2025-03-12 14:53:45 -07:00
Johannes Klein
626fbfd94f Full screen loading state on match screen (#2717)
* Build UI for loading state between AI->Match

* Make designs for AI loading screen match Figma

* Selective changes from bf872e2d4f

* Selective changes from 9ed81f99c7

* Selective changes from 4bc7c3474f

* Selective changes from 4916cf70fb

* Replace loading state from store with props

* Add some types

* Make component agnostic of what skipping does

* Remove debug info

* Add more debug data

* Elongate loading state if online errors out and offline is still loading in sequence

* Remove underline

This classname had no effect as far as I can tell.

* Hide skip button when it has no function

* Remove a comment that slipped through partial cherry-picking

* Split apart online and offline fetch status

Weird but even though they start in sequence it happened to me that online error was received after offline was fetched successfully. So, Let's split apart online and offline loading state.

---------

Co-authored-by: Amanda Bullington <albullington@gmail.com>
2025-03-07 11:50:49 +01:00
Johannes Klein
50b4689a0f Passing props through to child component
We are not sure if this screen will stay like this so this seems to me to be a better way. We are just expanding the interface to allow a customization that is already possible to pass through. Instead of adding a new "largeText" mode.
2025-03-05 23:56:45 +01:00
Kirk van Gorkom
9d767204ff Add simple mode to ObsDetailsDefaultMode 2025-03-04 16:54:35 -08:00
Angie
25d0ac7e22 Removes location picker from match screen, fetches user location and reload suggestions (#2703)
* Removes location picker from match screen, fetches user location and reloads suggestions instead

* fix variable name

* Remove unused prop

* changes requested, changes to fetching place guess, changes to refetch offline

* Close permission gate when permissions denied initially

* change toggle to set in reducer

* add optional chaining to location values

* Add optional chaining for place name

* Closing on initial block optional

The function of closing the permission gate on pressing the initial block button was as far as I can see only scoped to the Match container.

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-03-04 12:22:10 +01:00
Johannes Klein
a44f0412f3 Hide observation status for logged out users on simple MyObs (#2710)
* Show simple my obs header only for logged-in users

* ActivityCount TS

* CommentsCount TS

* IdentificationsCount TS

* ObsStatus TS initial pass not looking at errors

* QualityGradeStatus TS

* Update RealmObservation interface

* Update RealmObservation interface

* ObsUploadStatus TS, plain copy, no errors yet

* Update types

* Update type

* IconicTaxonIcon TS

* ObsImage TS

* PhotoCount TS

* ObsImagePreview TS

* Image is only opaque when logged in

* DateDisplay TS

* Remove debug flag from UploadObsStatus

* Update type

* Prop to hide ObsUploadStatus

* Test observations need those otherwise they appear as needing edit

* Update imports
2025-03-04 09:01:21 +01:00
Johannes Klein
360a63cdbe Photo similarity representative photo result sent to taxon details (#2699)
* A key like this does not exist because we don't save rep Photo to realm

* Show rep photo on suggestions

* Add comment

* Update types.d.ts

* Move code around

* Send rep photo ID to taxon result

* Send rep photo to taxon result

* Add white background to box on taxon details

Closes MOB-491

* Comments

* Only send ID around and move photo to top

* Send first photo id also from match screen

* If rep photo is of same taxon, only send ID, else send entire photo to taxon details

* Refactor taxon image

* Updated realm types

* If rep photo is of other taxon send entire object

* Create copy of realm taxon

Avoids an error "object has been invalidated and deleted" which I didn't have tome to track down.
2025-02-27 15:20:06 +01:00
Johannes Klein
7660de73a8 Show user info on logged-in my obs empty (#2678)
* Rename MyObsEmptyLoggedOut because it will have a logged in state as well

* Add a copy of InlineUser for headers

* Prop in currentUser and isConnected

* Use HeaderUser on empty my obs

* Adjust top position based on safe area insets

* Also use HeaderUser for MyObsList

* Refactor User components to use a base component

* npm calls for separate tests

* Revert "npm calls for separate tests"

This reverts commit 6317e0eda5.
2025-02-20 15:44:36 +01:00
Johannes Klein
e2ee6170ea Some camera design changes with using geomodel (#2677)
* Do not show double gap for when no zoom button to show

* Add location-off icon

* Basic location button for camera

* Do not show new button in default mode

* In advanced mode using geomodel is opt-in with the button state

* Basic info box layout

* Add opacity

* Update strings.ftl

* Use location if present

* If no location permission given, show permission gate on pressing use location

* Minor restyle for offline text

* Refactor LocationStatus and add animation

* Update snapshot tests
2025-02-20 11:32:47 +01:00
Angie
fa0e78df10 don't show Add Location as place name in match screen (#2664)
Instead if an observation on the match screen has no location this text say "Observed at" and shows only the date there.
2025-02-20 10:22:03 +01:00
Amanda Bullington
400f118ad9 Change terminology from gallery to photo library (#2663)
* Update user-facing terminology from gallery to photo library

* Update terminology for devs to make the user-facing change easier to remember

* Update snapshots
2025-02-13 17:11:28 -08:00
Johannes Klein
f704aa00eb Few minor match screen UI updates (#2661)
* On top suggestion change scroll top top

* Change top Divider to use a card look instead

* Show photo count in case of multiple photos
2025-02-12 16:54:43 +01:00
Johannes Klein
4a5aa7d3ae Few match screen updates (#2653)
Sets camera values to defaults, exactly like Seek works.
Loading indicator while other suggestions are being fetched.
Fix a bug with lingering state of previous score_image request.
Refactor top suggestion to a state.
2025-02-07 07:58:15 +01:00
Johannes Klein
11d262e10e Some signup login flow UI changes (#2645)
* Add title string

* Label for icon button

* Restyle 3rd party sign in section

* Add apple svg icon

* Use apple svg

* Add google icon

* Update strings.ftl

* Partially bold string

* SignUpForm TS

* SignUpConfirmation TS

* Rename signup screens

* SignUpConfirmation TS

* Remove string

* TS fixes

* Button text change

* Remove superfluous margin

* Move two text fields to sign up confirmation

* Revert "Remove superfluous margin"

This reverts commit 6a8fe1e7cf.

* Add TODO

* Remove text under Continue button

* Reorder states

* Close button only on login

* LoginSignupWrapper TS

* SignUp TS

* Remove Learn More screen

* Update text input field label

* Remove email confirmation screen

* Disable button when inputs empty

* Navigate to main after register

* Only show one check box

* Add error component to first signup screen

* Partially italics string

* Remove previous text

* SignUpConfirmationForm TS

* Add a type

* Make exclamation mark appear white

* Example email validation

* Updated Learn More webview title

* Comment out some registration fields from previous checkboxes

* Add comment

* Update Error.tsx

* Set all previously separate checkbox consents to true if the one is checked

* Revert removal of LearnMore screen

* Navigate to Learn More screen

* Update LoginForm.tsx

* Revert "Remove email confirmation screen"

This reverts commit 52c396e411.

* Use pink_flower as background for Learn More screen

* Remove old confirmation screen

* Remove LearnMore demo

* Show translated error text for common errors

* Force dark buttons in signup/login flow screens

* Add text to forgot password page

* Change text input label
2025-02-05 11:36:57 +01:00
budowski
13c53d3bfe Fix #2573 - don't show location indicator if observation has no coordinates (#2627) 2025-02-04 15:27:55 -08:00
Ken-ichi
7e960d9010 feat: display time zones and times in time zones (#2636)
* fix: show observation datetime in the obs time zone

I.e. it doesn't offset the observation datetime into the viewer's time zone.

* test: adjust to literal times by default

* chore: update to date-fns 3.0

* wip: show time zone names with all times

* show time zone name whenever a time zone is passed to a formatting function
* store observation IANA time zone in Realm

Note that this required patching around a bug in Hermes in which it should be
returning a GMT offset for the short time zone but is instead just returning
GMT.

* fix: omit time zone for unuploaded obs

* feat: show relative time differences on ActivityItem headers

* fix: hide zone/offset on ObsEdit before upload when signed in

* fix: hide clock icon in activity item header in new default mode

Also

* stop using checkCamelAndSnakeCase when not necessary in DetailsTab.js
* make POJO types only refer to other POJO types
2025-01-31 23:22:55 +01:00
Ken-ichi
21a66c8580 fix: make UUIDs more random (#2629)
Replaces react-native-uuid with uuid, which might do a better job making UUIDs random
2025-01-21 15:23:15 -08:00
Ken-ichi
736eba5a52 feat: add labels to tab buttons (#2611)
* feat: add text labels to bottom tabs
* fix: treat icon and text as single pressable for screen readers in bottom tabs
* feat: float AddObs button outside of bottom tab bar

Closes MOB-254

---------

Co-authored-by: Kirk van Gorkom <55742+kvangork@users.noreply.github.com>
2025-01-21 11:20:48 -08:00
Ken-ichi
8121e1452c feat: show simplified MyObservations to logged in users (#2616)
* refactor: convert UserIcon to TypeScript
* feat: show simple MyObs to signed in user; add user icon & login to header
* feat: show warning and edit button for unuploaded obs w/o basics
* refactor: consolidate ObsEdit navigation logic
* feat: show edit button with circle dots
* refactor: upload UploadQueuedRotatingIcon to the more reusable CircleDots
  component
* refactor: upload icons to use more composition and fewer specialized, one-off
  components
* fix: bugs in determining if an obs has date and coords
* refactor: extract MyObservationsSimple business logic into container
* refactor: get total obs count from relevant hooks
* feat: show remote species for signed in users
* fix: hide photo count icon when missing basics icon is present
* feat: show banner alerting user when missing location or date

Closes MOB-318
2025-01-17 17:21:29 -08:00
Amanda Bullington
bbb7b46657 Keep list items (and all content) within the screen width (#2623) 2025-01-17 16:52:15 -08:00
Amanda Bullington
9872a99f47 Fix: Show observation date in ObsEdit date picker (#2620)
* test: run same suite of tests for ObsDetails and its default mode equivalent

* Show observation date when opening date picker
2025-01-17 15:21:40 -08:00
Amanda Bullington
689882726c Update confidence scores to show decimal & update styling of suggestions list (#2615) 2025-01-16 10:48:05 -08:00
Ken-ichi
75d69f8c74 feat: add simplified MyObservations for logged out users with at least 1 obs (#2599)
Simplified version of MyObs for signed out users with more than 1 obs. Currently only in debug mode.

Also:

* refactor: extract TaxonGridItem into a reusable component
* chore: TypeScript cleanup

Closes MOB-317
2025-01-10 19:48:29 -08:00
Ken-ichi
cee9b64188 fix: save or discard the observation from the match screen (#2607)
* fix: save or discard the observation from the match screen
* feat: add Match header and footer to TaxonDetails from Match
* refactor: rename TaxonDetailsHeader prop controlling right element
* feat: show search from TaxonDetails via Match

Closes MOB-353
Closes MOB-358
Closes MOB-359
2025-01-10 16:44:12 -08:00
Amanda Bullington
40a375dd9f Create text style Subheading2 and apply in Match screen (#2605)
* Add Subheading2 component and apply to Match screen

* Add snapshot test for Subheading2

* Add snapshot
2025-01-09 17:10:26 -08:00
Ken-ichi
486f1f6dff fix: change No Location to Add Location on match screen (#2606)
Closes MOB-365
2025-01-09 15:58:37 -08:00