Commit Graph

39 Commits

Author SHA1 Message Date
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
Ken-ichi
8119a3e5ca Taxon detail media viewer (#966)
* Access MediaViewer from TaxonDetails
* Added our own presets for ActivityIndicator
* TaxonDetail should show a local taxon if one is available
* Made it a little easier to import the custom logger
* Refactored MediaViewer to accept photo-like objects instead of URIs
* Added license / attribution button to MediaViewer
* Moved delete button into MainPhotoDisplay so each photo has its own button
  and it can be laid out relative to its photo
* Add custom header to MediaViewer when accessed from TaxonDetial
* Allow DisplayTaxonName to accept custom text components as props
* Added darker bg to photo on TaxonDetail to make title more legible
2023-12-14 17:18:41 -08:00
Ken-ichi
d3f1f8ed6e View photos in MediaViewer from ObsDetail (#962)
* Unit tests for MediaViewer
* Added editable prop to MediaViewer
* MediaViewer navigation test
* Made MediaViewer a modal
2023-12-13 09:33:06 -08:00
Ken-ichi
0c7c807b56 Realm & other bugfixes (#950)
* Updated faker; fixed bug w/ DisplayTaxonName trying to modify a Realm object
* Fixed crash going from ObsDetail to ObsEdit
* Fixed bug fetching observation dates (not clear how this didn't instantly crash_
* Bugfix: MyObs observation fetch was failing on taxa w/ float rank_level
2023-12-04 13:47:00 -08:00
Ken-ichi Ueda
38e75d3cdf Remove some unecessary react-navigation mocks 2023-11-20 11:09:36 -08:00
Amanda Bullington
1d9adb0f51 More performance improvements (#845)
* Remove console statements in production build

* Move uploadReducer into separate file

* Create reducer for creating obs; combine reducers

* Fixes with createObsReducer

* Move album, passes test states out of global context

* Bug fixes for ObsEdit flow

* Create photo gallery container

* Set accessibility test todo for PhotoGallery

* Improve FlashList performance MyObs

* Prevent flicker on modal close

* Create less rerenders in MyObservations

* Memoize drawer items for less rerendering

* Memoize custom tab bar

* Remove unused libraries and update snapshot

* Fix and prune dependencies

* Add AddObsModal tests

* Fix e2e test android by making comment confirm button visible

* Use callbacks and memoization to cause less rerenders

* Fix tests

* Remove unused code

* Remove log

* Minimize calls to check whether internet is reachable

* Remove unused code
2023-11-06 12:24:31 -08:00
Amanda Bullington
5913fb511e Energy usage / performance improvements (#844)
* Remove console statements in production build

* Move uploadReducer into separate file

* Create reducer for creating obs; combine reducers

* Fixes with createObsReducer

* Move album, passes test states out of global context

* Bug fixes for ObsEdit flow

* Create photo gallery container

* Set accessibility test todo for PhotoGallery

* Improve FlashList performance MyObs

* Prevent flicker on modal close

* Create less rerenders in MyObservations

* Memoize drawer items for less rerendering

* Memoize custom tab bar

* Remove unused libraries and update snapshot

* Fix and prune dependencies

* Add AddObsModal tests

* Fix e2e test android by making comment confirm button visible
2023-11-02 11:03:48 -07:00
Amanda Bullington
0878242c20 Bottom tab icon (#829)
* Write tests for bottom tab bar

* Show people icon when low connectivity; closes #765
2023-10-24 15:44:20 -07:00