* 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>
* 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
* 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>
* 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>
* 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.
* 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>
* 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>
* 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
* Update user-facing terminology from gallery to photo library
* Update terminology for devs to make the user-facing change easier to remember
* Update snapshots
* 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>
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>
* 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
* 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
* Restore photo deletion
* Rename methods for accessing media files
* Added integration test for photo deletion
* Cleaned up some accessibility labels
Closes#1429
* 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
* 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
* 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
* 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
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
* 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
* 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
* 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
* 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>
* 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