Commit Graph

57 Commits

Author SHA1 Message Date
Abbey Campbell
7736471a35 update snapshot 2026-03-31 15:41:20 -07:00
Abbey Campbell
409f0edace update snapshots 2026-01-15 13:32:06 -08:00
Ryan Stelly
b78be9243d lint rule & autofix for "trailing comma" (#3299)
* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
2025-12-22 20:17:13 -06:00
Abbey Campbell
0c07017ac6 update testID 2025-12-11 14:17:39 -08:00
Abbey Campbell
caca94fb48 update more tests and snapshots 2025-12-09 18:46:40 -08:00
Abbey Campbell
b8375e0254 update tests and snapshots 2025-12-09 18:46:40 -08:00
Abbey Campbell
5a212adf6e update snapshots 2025-12-01 14:29:50 -08:00
Corey Farwell
a43446909c Remove the need to specify TypeScript file extensions in imports (#3094)
* Don't require TS extensions in imports

* Resolve all import extension errors

* Remove file extension from import paths used in mocks

* Remove .d of type definition file paths

* Remove .d of type definition file and import as type

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-09-07 23:41:42 +02:00
Johannes Klein
b4516b7b25 Update react native to v0.78.x (#3043)
* Update package.json

* Update package.json

* Updates for native files with upgrade-helpers

* Update .flowconfig

* Update package-lock.json

* Update Podfile.lock

* Add react-dom types

* Update package-lock.json

* Wrong install

* Use types-react-codemod

* Update TaxonSearch.tsx

* Remove react-native-accessibility-engine dependency

This is currently not maintained and not compatible with RN 0.78

* Comment out accessibility tests

* Disable broken snapshot test

* Move broken test

* Move broken test

* Move broken test

* Remove duplicate file

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken tests

* Move broken test

* Remove duplicate file

* Move broken tests
2025-08-09 13:47:46 +02:00
Johannes Klein
f17a346f23 Repair ObsWheel tooltip (#3022)
* Refactor Tooltip into AddObsModal

* Update AddObsModal.tsx

* Remove unintentionally hardcoded condition

* Disallow close modal while tooltip is visible

While the tooltip is visible the modal should not be dismissed

* Reinstate logged-in triggers

* Disable tooltip for users that just signed up

Because of a bug in showing the "Account creation" pivot card the trigger here is not always set to true and so the correct behaviour of showing the tooltip is currently not possible.

* Remove buggy check for button press

* Re-position modal

* Make sure we have numbers of observations by the user

We need it to make a decision on wether to show the tooltip. If we don't have it don't show it.

* Show the modal when tooltip should be shown

With a timeout because we have a lot of overlapping modals here.

* Remove react-native-walkthrough-tooltip dependency

* Add triangle under bubble

* Update snapshot tests
2025-07-31 10:15:53 +02:00
Johannes Klein
e3d9edc433 Show a tooltip to find the obs wheel with all observation options (#2927)
* Add react-native-walkthrough-tooltip dependency

* WIP: Basic tooltip (always shown)

* Adjust arrow size

* Adjust background color

* Adjust tooltip shadow

* Adjust hight and vertical spacing

* Adjust border radius

* Adjust padding horizontal

* Only allow long press if tooltip is visible

* Move Tooltip into AddObsButton

* Show tooltip only once

Dismiss on long press of AddObsButton only

* Only show the tooltip if the user has only AI camera as an option

* Only show the tooltip on MyObservations screen

* Only show the tooltip on MyObservations screen for real

* Show tooltip after user making their second observation

* Code style

* Fix typo in comment

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Prevent navigation when modal is opened

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove return

* Update CustomTabBar.test.js.snap

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-20 12:28:31 +02:00
Johannes Klein
3faf5e3e29 Update to react-native 0.75 (#2950)
* Update to RN 0.75.5 with upgrade helper diff

* Update .flowconfig

* Update package-lock.json

* Update Gemfile.lock

* Update Podfile.lock

* Update project.pbxproj

* Use double quotes

* Update to RN 0.75.5 with upgrade helper diff

* Update .flowconfig

* Update package-lock.json

* Update Gemfile.lock

* Update Podfile.lock

* Update project.pbxproj

* Use double quotes

* Update Podfile.lock

* Update CustomTabBar.js

* Revert "Update CustomTabBar.js"

This reverts commit 2eb085e3bb.

* Update NavBar. Remove percentage based width as it broke the UI

Now we rely solely on flexbox spacing of justify-around.

* Update FloatingActionButton percentage values

* Update CustomTabBar.test.js.snap
2025-06-12 21:18:28 +02:00
Johannes Klein
26f0863ec9 Fix: integration tests store setup when changing layout slice (#2932)
* Update MyObservations.test.js

* Remove comment

* Remove unnecessary setState

* Update MyObservationsLocalization.test.js

* Previous change can be more specific

* Update MyObservationsSimple.test.js

* Update AICamera.test.js

* Update Explore.test.js

* Update MyObservations.test.js

* Update ObsEdit.test.js

* Update SoundRecorder.test.js

* Update PhotoImport.test.js

* Update CustomTabBar.test.js

* Update SuggestionsWithUnsyncedObs.test.js

* Update SuggestionsWithSyncedObs.test.js

* Update PhotoDeletion.test.js

* Update Suggestions.test.js

* Update AddObsButton.test.js

* Update MediaViewer.test.js

* Update PhotoLibrary.test.js

* Update StandardCamera.test.js

* Update SimpleUploadBannerContainer.test.js

* This test needs to be in advanced mode

* Remove setState of shownOnce back to default

* Refactor store override calls into a helper function

* Update MyObservationsLocalization.test.js

* Update MyObservationsSimple.test.js

* Update PhotoDeletion.test.js

* Update PhotoImport.test.js

* Update SuggestionsWithSyncedObs.test.js

* Refactor to use helper

* Update SimpleUploadBannerContainer.test.js
2025-06-10 16:10:19 +02:00
Amanda Bullington
bb31c1907b Update react navigation libraries for performance (#2903)
* Update navigators and create util for tabstack navigation

* Changes for react navigation 7

* Refactor to use navigateToTabStack throughout app

* Add comment about unmountOnBlur

* Get all unit tests passing; remove navutils & mock HeaderBackButton

* Fix animation issues in tests

* Temporarily remove parts of tests with back functionality

* Fix tests

* Delete ios/iNaturalistReactNative.xcodeproj/project.pbxproj

* Fix pbxproj

* Code cleanup; minimize unnecessary changes

* Fix tests

* Downgrade react-native-screens to v4.4.0 (#2918)

react-native-screens version 4.5.0 increases the react native version that it supports to 0.74.0+ (https://github.com/software-mansion/react-native-screens/pull/2613/files). So, by using 4.4.0 we are still able to build the app on Android as we are still on 0.73 for now (have tested and it works).
Have not seen any effect on the changes related to the latest react-navigation versions.

* Make requested changes

* Speed up Explore nearby tile loading (#2912)

* Create a performance tracker to show urltile load time in debug mode

* Set default radius to 1km, not 50km

* Code cleanup & TypeScript definitions

* Fix TypeError

* Address eslint error

* Make github actions happy

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>

* New Crowdin translations by GitHub Action (#2920)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>

* MOB-690 - Add error context to 401 errors (#2921)

* MOB-690 - Add error context to 401 errors

* Add Object.defineProperty like in the other error classes

* Add logger line

* Also throw 401 error if the error object has no response property

---------

Co-authored-by: Yaron Budowski <budowski@gmail.com>

* v1.0.4+164

* Rebase with latest version of RN screens. Remove unused code and packages, add eslint package for TS, suppress TS errors (#2924)

* New Crowdin translations by GitHub Action (#2926)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>

* New Crowdin translations by GitHub Action (#2929)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>

* Use 3 separate initial routes for tabs; hide animations on drawer screens

* Fix test

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
Co-authored-by: Ken-ichi <kenichi.ueda@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Yaron Budowski <budowski@gmail.com>
2025-05-30 09:26:47 -07:00
Johannes Klein
83eed85a74 Update react-native-safe-area-context-to >4.10.1 (#2911)
* Update react-native-safe-area-context-to >4.10.1

Version 4.10.1 adds support for react native 0.74.

* Re-establish mock after it was reset

I think the better way forward would be to restructure these tests, so that we don't need to resetAllMocks in between the two describe blocks, but I don't want to increase the scope of this PR.
2025-05-20 09:50:32 +02:00
Angie
548288c283 Change explore icon to magnifying glass (#2807)
* Replace change explore icon to magnifying glass

* Update snapshot
2025-03-27 18:15:34 -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
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
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
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
Amanda Bullington
9fae07cb16 Reduce size of nav button text (#2640) 2025-01-29 08:32:31 -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
budowski
2162f55ac3 Fix #2323 - view taxon observations from explore screen by tapping on taxon (#2554)
* Fix #2323 - view taxon observations from explore screen by tapping on taxon

* Updated test snapshots
2024-12-17 16:30:11 -08:00
budowski
b96051cb02 Internal feedback form (#1992)
Adds internal feedback form that posts to our logging infrastructure.

Also,

* Adds maxLength prop to TextInputSheet w/ UI to show characters remaining
* Adds optional description to TextInputSheet
* Adjusts TextInputSheet input height to fit area left by the keyboard

Closes #1844 

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-08-22 15:12:37 -07:00
Amanda Bullington
2ee0f14a2d Unify global shadow styling (#1947)
* Remove shadow from bottom sheets

* Shadow fixes

* Update snapshots
2024-08-09 19:03:19 -07:00
Amanda Bullington
cf896a3a17 Toolbar upload status refreshes when user returns to MyObs (#1942)
* Write some failing navigation tests for MyObs navigation

* Add one more failing test to check for empty screen after all obs are deleted

* Update what happens on blur

* Changes to focus effect

* Revert "Changes to focus effect"

This reverts commit c779504cdf.

* Test: toolbar status reset when user leaves screen

* Unmock useFocusEffect in Jest; fix tests

* Minor nav mocking updates

* Fix import
2024-08-09 11:21:25 -07:00
Amanda Bullington
182196a205 Change url for connectivity check (#1868)
* Change connectivity url to ping inat; remove unnecessary useIsConnected hook; closes #1770

* Ensure inaturalist.org/ping is being pinged

* Fix e2e tests by using isConnected, not isInternetReachable
2024-07-26 20:16:32 -07:00
Ken-ichi
fe0229291e Restore photo deletion (#1789)
* Restore photo deletion
* Rename methods for accessing media files
* Added integration test for photo deletion
* Cleaned up some accessibility labels

Closes #1429
2024-07-10 15:23:53 -07:00
Ken-ichi
6d553daa0b Made status text in Toolbar clickable to start upload (#1678)
Also refactored layout code to be a bit more rational and added Toolbar to the
UI library to help visualize its many states.

Closes #1453
2024-06-13 18:36:24 -07:00
Ken-ichi
f3bcec2d2e Continuous location fetch in the cameras (#1673)
* Fetch location continuously in cameras until accuracy falls below threshold
* Unit test for useUserLocation
* Added untilAcc option to useUserLocation
* Bugfix: ObsEdit was not always fetching location for new camera photos

Closes #1340
2024-06-12 11:18:12 -07:00
Amanda Bullington
e19221ddf0 Reduce app size (fonts and model/taxonomy assets) (#1513)
* Remove material community icons

* Remove unneeded font files from app

* Show app size in Debug on Android

* Update snapshots

* Code cleanup
2024-05-08 09:22:01 -07:00
Angie
902be59b5a 1266 location icon associated with an observation should change based on geoprivacy across the app (#1412)
* Add new icons, change ObservationLocation to include icons

*Change observationLocation to include new icons for geoprivacy

* update snapshot
2024-04-17 16:56:18 -07:00
Johannes Klein
efd88802ed 1364 UI setting (#1384)
* Show settings menu item to all users

* Add strings

* Update strings.ftl

* Add a logged out section to Settings

* Refactor logged in section

* Prop to use small label

* Restyle radio buttons

* Add react-native-mmkv

* Show logged in section only when logged in

* Add a boolean if user is advanced

* Hook for storage

* Change bottom tab button based on isAdvancedUser

* Add string

* Change supported AR camera version

* Refactor navigation out of AddObsModal

* Create new observation only on ObsEdit navigation inside Modal

* Reset store needs to happen before making new observation

* Merge conflicts removed some strings, put them back

* Remove comment

* Refactor AddObsModal test to unit test only

* Refactor navigation parts into integration test

* Add test case for advanced user

* Code style

* Add test case for advanced user to Tab bar

* Do not use a user object for snapshot tests, only the advanced user layout

* Use advanced user layout in navigation tests

* StandardCamera test with advanced user layout

* Add default value for boolean setting

* Remove default value as it is breaking immediate update of UI

* Refactor persisted layout value to be a part of zustand store

* Refactor persisted state into one bound store

* Explicit state for snapshot needed?

* Revert "Explicit state for snapshot needed?"

This reverts commit d448edc3dc.

* Remove snapshot test
2024-04-12 16:47:10 +02:00
Ken-ichi
0b2c8315a0 OfflineNotice (#1388)
* Added clean script; fixed UI Library
* OfflineNotice component; added to Notifications
* OfflineNotice on ObsDetails media
* OfflineNotice for DQA
2024-04-11 17:25:55 -07:00
Ken-ichi
e17c65d5d1 i18n strings audit (#1350)
* Tried to get accessibilityHints to conform to Apple guidelines
* Tried to make some more helpful `accessibilityLabel`s
* Used fork of fluent_conv to support function results as selectors in Fluent
* Custom VOWORCON function for Fluent

Note that there are still many accessibility problems for screen readers. This
just tries to make sure the strings up for translation are somewhat less
confusing in that context.

Part of #1223
2024-04-10 15:27:38 -07:00
Johannes Klein
d6afb4b386 Upgrade to RN 0.73 (#1339)
* Upgrade to RN 0.73 with upgrade helper

* Upgrade testing-library

* Comment announcements

* Comment out UserProfle test

* Mock function used to calculate masonry layout

* There should not be a modal here

* There is actually also no modal here

* Use View if SafeAreaView is undefined

* Replace fast image library that was failing tests because of not being maintained

* Clear mocks in useTaxon test

* Remove legacy deps from testing flow

* Snapshot update

* Revert "Snapshot update"

This reverts commit bca8b296df.

* Update package-lock.json

* Clean-start

* Update project.pbxproj

* Reenable test that failed before updating dependency

* Reenable test that failed because of dependencies

* Remove comment
2024-04-08 15:28:06 +02:00
Ken-ichi
fbf93e40d1 Add pre-commit checks for unused i18n keys and used keys not in strings.ftl (#1343)
FYI, this also essentially outlaws variables in translation keys because a key
that is only used with interpolated strings will never appear as "used".

Also starts using a convention of adding info to i18n keys that do not relate
to the text after double dashes, e.g. `Unknown--taxon = Unknown` for a string
that is specifically meant to describe a missing taxon but only needs to have
the word "Unknown".

* Changed several accessibilityHints to 3rd person
* Made several accessibilityLabels shorter and more verb-oriented
* Removed many unused i18n keys
* Refactored variables in i18n keys
* Removed some unused code from the old Settings
2024-04-02 12:17:57 -07:00
Amanda Bullington
c21d28ac8e Package upgrades for minor version bumps (#1334)
* Upgrade packages and fix deprecation warning in bottom sheets

* Upgrade packages with minor version updates
2024-03-28 17:37:21 -07:00
Angie
f37f92795b 1221 explore screen icons (#1308)
* Identifiers and Observers icons

* Add icons to explore bottomsheet
2024-03-27 16:21:56 -07:00
Amanda Bullington
b284bb2b9e Explore filters and navigation entry points (#1306)
* Add test for UserProfile species button from MyObs screen

* Finish initial tests for navigating to Explore from MyObs

* Check API calls are made with correct params

* Use RootExplore screen in CustomTabBar and write test for navigating cyclical Explore -> TaxonDetails

* Add navigation check for UserProfile from root explore screen

* Simplify RootExplore screen; show nearby data for species view

* Mock location permissions for Explore navigation tests

* Update snapshot

* Merge from main

* Fix tests for Explore navigation
2024-03-26 16:59:59 -07:00
Johannes Klein
5553719a2f Community Taxon improvement DQA (#1291)
* Restyle community taxon section

* Use fave/unfave mutation in case of need_id metric

* Add votes field to Observation

* Change useIsConnected to TS

* Refactor fetching of remote observation into hook

Also includes the code to update local copy of a user's own observation

* Use const as key instead of string

* Remove unused prop

* Only send obs uuid to DQA

* Get obs in DQA container

* Rebuild object that is to check as it was send in nav params

* Refactor qualityGrade

* Refactor set to not loading state

* Update test to reflect fetching of obs

* Refactor too long lines

* Refetch remote observation after success in adding/removing vote

* Change qualitcMetrics to make use of observation.votes as well

Also refactored the object structure to use more efficient and performant filtering and finding in child components.

* Only use data slice for DQA buttons

* Refactor DQAButtons to only work with data slice relevant to that metric

* Special case for needs_id metric

* Also show loading indicator when fetching remote obs

* Add TODO

* Check only for vote of this user

* Optional chaining for user id

* Update test

* Enable fetching of remote if local is falsy

* Invalidate query on mutation

* Only set loading to false after refetch is finished

* Split up DQA test into unit tests and integration tests

* Use factory for mock user

* Add needs_id DQAVoteButtons unit test

* Revert hook to js

* Check for observation before using it

* Undo code style changes

* Remove unused value

* Refactor faves to be derived from votes

* Refactor needs_id interaction into standalone fcts

* Code style
2024-03-22 21:57:28 +01:00
Ken-ichi Ueda
b3fbbd799d Minor UI fixes for TaxonDetails explore btn & establishment means 2024-03-07 17:18:25 -08:00
Ken-ichi
f45108036f Sound recording (#1164)
* Added basic navigation test for StandardCamera & SoundRecorder
* Abstracted camera nav buttons and used in SoundRecorder
* Show sounds in the MediaViewer
* Added sounds to ObsEdit, w/ MediaViewer support
* Ensure sounds get both uploaded and added to observations
* Local sound deletion
* Remote sound deletion
* Rudimentary and deeply unperformative sound visualization

Closes #869
2024-02-22 22:02:25 -08:00
Amanda Bullington
045ce6f789 Improve Jest performance (#1160)
* Use faker import with specific locale

* Add global beforeAll to initiate i18next
2024-02-16 16:17:00 -08:00
Angie
9de83f7fdf Unread notifications indicator in tab bar (#1101)
* Shows indicator in tab bar when you have new updates
* Should update every minute
* Make unread updates indicator go away when you view the updates

Closes #900

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-02-08 13:22:05 -08:00
Amanda Bullington
30a5a9fbec Use safe area insets to style tab bar padding (#1021)
* Use safe area insets to style tab bar padding; closes #945

* Update snapshot
2024-01-11 10:57:54 -08:00
Angie Ta
2e038abdeb Merge branch 'main' into 899-notifications-screen 2024-01-07 18:37:58 -08:00
Angie Ta
ee74db5f1f Notifications Screen, observation notifications, no infinite scroll or user notifications 2024-01-05 01:50:25 -08:00
Ken-ichi
f7dc08a704 Suggestions fixes (#972)
* Bugfix: TaxonDetails was crashing if it received a null taxon
* Send lat and lng instead of latitude and longitude to the score_image
  endpoint
* Show offline suggestions when you are offline
* Show notice when viewing offline suggestions
* Moved code unique to useOnlineSuggestions into that file
* Ensure we use a medium size image to get suggestions when dealing with
  remote URLs
* More logging around React Query retries
* Use default retry logic for useAuthenticatedQuery
* Made a module-resolver shortcut for tests
* Move offline notice above top suggestion; hide when offlines exist but onlines do too
2023-12-15 19:58:12 -08:00