Commit Graph

520 Commits

Author SHA1 Message Date
Ken-ichi
a3a43c4e2c g11n audit (#2189)
* chore: validate and normalize translations in addition to src strings
* fix: globalize lat/lng/acc in LocationPicker
* refactor: extract language picker into component
* refactor: globalized text
* feat: added a script to i18ncli called "checkify" that generates
  localization files prepended with a checkmark to help see strings that are
  not globalized
* fix: localize date formatting (closes #1622)

Closes #2102
2024-09-26 22:33:23 -07:00
Amanda Bullington
653340d854 Add infinite scroll to Projects (#2185)
* Implement infinite scroll in Projects

* Styling fixes for empty state in projects; add infinite loading wheel

* Resolve require cycle from ObsFlashList and FlashList shared components

* Order by distance and remove radius for nearby projects fetch

* Code cleanup

* Fix test

* Code cleanup

* Minor tweaks to search API request and results
2024-09-25 11:17:32 -07:00
Johannes Klein
6f8f2ea926 1953 suggestion logged out (#2163)
* TaxonResult TS

* Suggestion TS

* Do not show checkmark for logged out online suggestions

* Update strings.ftl

* From suggestions show bottom sheet on taxon detail

* Refactor updateTaxon

* Add text

* Another text

* Two more texts

* Fix import

* Function stubs

* Use a bulleted text list

* Restyle entire bottom sheet

* Code reorder

* Refactor saveObservation function

* Navigate to login screen for Upload now button

* Add key

* Save obs on press and nav to list

* Code style

* Get updated currentObservation immediately to pass to saveObservation

* Test AICamera with current user

* Show the bottom sheet only for logged out users

* Mock useCurrentUser hook

* Mock useCurrentUser hook

* Mock user

* Mock user
2024-09-25 12:56:32 +02:00
Amanda Bullington
dfc8fc8983 Support FlashList in RTL mode (#2158)
* Use custom FlashList with auto layout disabled in GroupPhotos

* Fixes for grid view in RTL mode

* Fix styling for PhotoCount in RTL

* Standardize ExploreSearchHeader; use BackButton for RTL support

* Styling fixes for filters search header
2024-09-23 19:08:43 -07:00
Amanda Bullington
3a9f831962 Enhancements: obs details from notifications (#2142)
* Rename obsDetailsTab & set to activity tab when nav from notifications

* Fix TS type
2024-09-23 11:18:08 -07:00
Ken-ichi Ueda
842fbe384d fix: reduce gradient shade for MyObs grid view
If you're not going to hide your light under a bunch of text, you might as
well not hide it under a lot of gradient either.
2024-09-20 15:30:52 -07:00
Amanda Bullington
74d81481ff Simplify ObsGridItem view in MyObservations (#2120)
* Only show one taxon name
* Remove comments, IDs, and quality grade
* Memoize grid and list display taxon name components
* fix: remove border on photoless ObsGridItem
* fix: don't show iconic taxon photo for another taxon

Closes #2088

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2024-09-20 12:43:45 -07:00
Ken-ichi
b81346f623 fix: control max text scaling to allow nav w/ large font sizes (#2129) 2024-09-20 10:42:22 -07:00
israr002
7f8519696d resolve typos on obs detail (#2098)
* resolve typos on obs detail

* correct typo in DetailsTab.test.js

---------

Co-authored-by: israr-stc-dev <Israr.Khan@intigral.net>
2024-09-19 17:11:05 +02:00
Amanda Bullington
36ae3f6660 Navigate via help text in AddObsModal (#2096)
* Make add obs help text pressable; closes #2077

* Fix test

* Styling updates; closes #2077
2024-09-18 10:24:37 -07:00
Johannes Klein
f85aba771b Username mentions navigate to User profile screen in-app (#2057)
* On user profile screen, if routed here with login as param search for user id

* UserText to TS

* Add linkify mention plugin dependency

* Rely on plugin for mention parsing

* Adjust rel

* Add a title attribute to mentions only

* Navigate to profile screen for mentions

* Use props

* Fix some types

* We dont really need this plugin if we check for href includes people link

* Replace user search api call with fetch by login

* Push new profiles on top of the navigation stack every time

* Add error strings

* If there is no user found for this id show error

This can happen I assume when a user changes the login but comments are not updated.

* Use this plugin

* Remove log

* Only react to anchors that have mention as a title

* Update types

* Another inferred type
2024-09-12 12:28:10 +02:00
Amanda Bullington
15382cee35 Integration test for photo import (#2058)
* Write an integration test for PhotoImport; closes #1430

* Add test for photo importer -> group photos -> obs edit flow

* Remove global image-picker mock
2024-09-10 16:26:23 -07:00
israr002
c7c25b029a Remove attribution for new photo in MediaViewer (#2040)
* 1570 Remove attribution for new photo in mediaviewer

* Guarding against photo being undefined

* Migrate AttributionButton to TS

* Remove console.log

* Find by label text instead of test ID

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2024-09-07 15:29:45 +02:00
Ken-ichi
ee37f6ce76 Account deletion improvements (#2044)
* Allow the in-app browser to open users/delete from settings
* When account deletion successful, sign the user out
2024-09-05 16:30:31 -07:00
Ken-ichi
d3a3c60715 fix: ident bodies should not get set by obs descriptions (#2018)
* separates ident body editing into its own state and UI
* stop adding an entire Realm object to nav params, where it gets out of date and causes access bugs
* fixes bug where accessing ObsDetails from MyObs can cause you to return there when returning from TaxonDetails via Explore
* separates BottomSheet handleClose callback so it can respond differently to the sheet closing and the user intentionally closing the sheet
* Suggest ID and Agree bottom sheets both have buttons of equal width with a single primary action
* Disagree sheet prompt refers to the taxon being disagreed with, not the ident taxon
* save taxon to local db when viewed on TaxonDetails
* minor refactors for readability

Closes #2003
2024-08-29 11:50:47 -07:00
Angie
704284b096 Location icon based on obscured state (#1943)
* location icon also based on taxon obscuration

* check for private before obscured

* Update schema ver
2024-08-23 02:23:41 -07: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
c2f0b21167 Fixes for explore loading state after permissions granted (#1986)
* Fixes to loading explore after location permission; closes #1918

* Test fixes

* Test fix
2024-08-19 17:23:57 -07:00
Amanda Bullington
75e5193ae7 Upload status fixes (#1979)
* Uploads start as expected from ObsEdit; error state not shown while syncing; closes #1954

* Fix MyObs test

* Fix toolbar test
2024-08-16 13:12:36 -07:00
Amanda Bullington
5945ccc525 Fixes and error handling for API throttling (#1971)
* Add new error type for 429; remove unnecessary logs

* Batch API calls for SpeciesSeenCheckmark

* Remove SpeciesSeenCheckmark test

* Revert logging errors

* Use Set for observedTaxonIds

* Add comments around logger.info statements

* Merge linting update

* More fixes from code review

* Switch to non-authenticated useQuery for fetching taxon ids seen by X user id

* Fix tests
2024-08-14 22:08:03 -07:00
Amanda Bullington
3b9739e254 Set threshold for top offline suggestion & sort by ascending rank (#1972)
* Update pods

* Show high scoring taxon as offline top ID; closes #1963

* Leave comment about offline threshold

* Add human offline test
2024-08-14 14:39:02 -07:00
Ken-ichi
e08cd83d6a Control web access (#1970)
* Convert web view components to typescript
* Basic tests for URL handling in FullPageWebView
* Allowlist of domains in FullPageWebView
* Open links in browser in most situations
* Allow FullPageWebView to handle mailto links
* Throw errors if FullPageWebView is about to leak a JWT
* Restore FullPageWebView functionality to signup screens

Closes #1803
Closes #1934
2024-08-13 14:45:37 -07:00
Amanda Bullington
cf70a4358a Move modules from jest setup to __mocks__ (#1949)
* Get a few mocks working in __mocks__ folder

* Move more mocks into __mocks__

* Move mocks

* Move zustand mock

* Add more mocks to __mocks__

* More mocks

* Move more files to __mocks__ and audit existing mocks

* Mock react navigation in __mocks__

* Restore test to help with imports after jest env torn down

* Add fake timer to integration test with userEvent

* Add RN paper mock
2024-08-11 11:27:52 -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
eca656b984 Formatting in DatePicker, ObsEdit (#1945)
* Remove seconds from datetime picker dates; make formatting closer to Figma; closes #1920

* Add DatePicker tests

* Add test for no date given
2024-08-09 16:10:37 -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
Ken-ichi
bca4872def Ensure device stays awake during uploading can sleep after (#1939)
* Fix previous state in which it was never really allowed to sleep again after
  upload finished
* Rename `uploadObservations` to `startUploadObservations` to accurately
  describe what it does
* Minor improvements in ts typing
2024-08-08 14:46:18 -07:00
Ken-ichi
ea0afb87a9 Don't restart location fetch when view blurred (#1936)
* Don't restart location fetch when view blurred
* Removed what looked like an unnecessary callback in DisplayTaxonName
* Refactored tests
2024-08-07 17:33:22 -07:00
Ken-ichi Ueda
4545d72e2f Ensure default realm instance is always unique for a single run 2024-08-07 12:18:58 -07:00
Ken-ichi
609b7c936f Select taxon button always visible from Suggestions (#1933)
* Send user back when they access a camera on a device with no camera
* Always show SELECT button on TaxonDetails when reached from Suggestions
2024-08-07 09:39:32 -07:00
Amanda Bullington
e0b5d446a2 Don't overwrite description in Suggestions/TaxonSearch (#1916)
* Don't overwrite description in Suggestions/TaxonSearch; closes #1913

* Fix TS

* Remove unused code related to adding/editing comments in Suggestions/TSearch

* Remove test about showing comments on Suggestions
2024-08-06 18:41:54 -07:00
Johannes Klein
c81201cffa 1843 offline taxon search (#1864)
* realm TS

* provider/contexts TS

* todo

* useIconicTaxa TS

* Refactor taxa list into component

* Use TaxaList for taxon search screen

* Refactor render decision

* Use flex 1 container instead of footer

* Show offline notice for query without results

Refetch taxa when going back online

* Update required because of useIsConnected

* Await typing in test

* Mock useIconicTaxa

* Add tests to taxon search

* emitUploadProgress TS

* createUTFPosition TS

* convertScores TS

* Add field type

* Fix imports
2024-08-03 15:13:13 +02:00
Amanda Bullington
b8c08ae2d4 Reassure tests (#1914)
* Basic performance tests for key components

* Fix MyObs integration test with fake timers and less rerendering
2024-08-02 19:07:41 -07:00
Amanda Bullington
5dbf5ef9a1 Avoid back button disappearing when offline (#1908)
* Customize back button; move icon assets into our image dir

* Fix ContextHeader with updated back button

* Fix styling around back buttons

* Fix taxon details header

* Test fix

* Fix signed in e2e test
2024-08-02 09:46:54 -07:00
Ken-ichi
960f3e3b67 Some typescript conversions in an attempt to improve CodeQL coverage (#1904) 2024-08-01 17:55:33 -07:00
Amanda Bullington
7f2ed32d32 Use fields to limit response from search API; save taxon results in realm (#1905) 2024-08-01 14:21:26 -07:00
Ken-ichi
d847f65049 Explore zooms to obs bounds in WORDWIDE and PLACE modes (#1902)
Solves the problem of Explore changing the region when applying a taxon filter
on top of an existing map area or nearby filter, but also adds similar
functionality whenever the observation bounds change, e.g. for a user
filter.
2024-07-31 15:47:27 -07:00
Amanda Bullington
14f53cd47c Show vision result from AICamera in Suggestions loading screen (#1900)
* Add AICamera result to loading screen; closes #1851

* Add test for loading state with vision result
2024-07-31 14:20:45 -07:00
Amanda Bullington
a781dca7c0 Settings: hide localization section & show internet errors (#1895)
* Hide App Language section in settings; hide locale check on app start

* Add Settings jest test
2024-07-31 10:38:37 -07:00
Amanda Bullington
9a0581670f Consolidate key-value stores (#1879)
* Switch to zustand mmkv storage instead of async storage

* Update hooks using async storage

* Remove asyncstorage

* Remove LocalPreferences

* Prevent collision upserting from infinite scroll & sync remote obs
2024-07-30 09:12:26 -07:00
Ken-ichi
899076e67a Only ask for permission to add photos from cameras (#1869)
* Patch camera roll to not ask for readwrite after addonly granted
* Only request add permission from cameras
2024-07-29 11:51:14 -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
Amanda Bullington
4beda5691c Use DisplayTaxonName component for disagreements (#1865)
* Use DisplayTaxonName as component in Trans to show DisagreementText

* Use DisplayTaxonName for top of disagree sheet

* Use DisplayTaxonName styling in radio button labels

* Remove italic from disagree text

* Add testing for DisplayTaxonName with plain text and scientific name only
2024-07-26 16:39:06 -07:00
Amanda Bullington
b61ff38f7c Reset stack when user navigates from AddObsModal (#1858)
* Reset navigation stack when user navigates from AddObsModal; closes #1857

* Fix AddObs nav test
2024-07-25 09:58:54 -07:00
Johannes Klein
b6ea37e7e2 Add reset button to Explore searches for taxon, user, and project (#1836)
* Add reset button to set user to null

* Update type

* Update project to be null with reset button

* Reset button to set taxon to null

* Fix test for null now

* Project can also be null now
2024-07-25 15:06:22 +02:00
Amanda Bullington
5c1a5142a4 Load suggestions with location after permission granted (#1846)
* Refactor into useReducer

* Use reducer for Suggestions

* Offline working

* Progress on getting location permissions button to work as expected

* Code improvements

* Fix photo deletion test

* Fix AICamera nav test

* Ensure suggestions location permission uses location immediately

* Loading wheel fixes

* Fix photo deletion test

* Use online result to advance to obsedit in PhotoDeletion

* Fix test by using online mock
2024-07-24 22:19:05 -07:00
Angie
27912676dc Loading wheel to explore filters searches (#1840) 2024-07-23 20:04:13 -07:00
Amanda Bullington
fbd22f9e9d Fix location toggle on Suggestions (#1833)
* Fix Suggestions test & create test for online suggestions with location

* Fetch location according to toggle

* Update tests

* Show loading & remove prev queries when toggling location

* Fix loading test
2024-07-22 06:44:35 -07:00
Johannes Klein
b655c896cc Increase width of upload circle to 2.5 (#1835)
* Increase width of upload circle to 2.5

* Update UploadStatus.test.js.snap
2024-07-22 15:38:56 +02:00
Amanda Bullington
c3c98deeda Create new obs when backing out to AICamera (#1832)
* Write test to confirm only one obs photo added when backing out of AICamera

* Create new obs when backing out to AICamera; closes #1822
2024-07-19 09:57:16 -07:00