Commit Graph

85 Commits

Author SHA1 Message Date
Ken-ichi
4ccf9e750b Explore fixes (#1169)
* Separate zoom to user loc from nearby; fix Android map crash; disable map pitch and rotate
* Ensure Explore shows nearby observations after permission granted
* Ensure Explore shows nearby observations even when defaulting to grid/list
  view
* Don't default the map to showing verifiable obs (this isn't the map's
  responsibility, sometimes we want to map casual obs)
* Remove extraneous current location button on map (closes #941)
* Bugfix: Explore user filter didn't let you choose a user
* Remove place params for bounding box searches and vice versa
* Prevent Explore list and map from re-rendering every time you come back to Explore
* Fixed Explore header count overflow style
* Bugfix: Explore filters weren't 100% width on iPad
* More layout fixes; fixed bug w/ UserProfile when zero idents
2024-02-23 19:55: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
Ken-ichi Ueda
dca5b4235f Numerous eslint fixes 2024-02-21 10:49:08 -08:00
Ken-ichi Ueda
096af978f0 Test fixes
* updated snapshots
* move timezone setup to globalSetup
* renamed old global setup file to reflect what it actually does, which is
  setup i18next
2024-02-21 10:47:31 -08:00
Johannes Klein
45dfb12824 Snapshot test updates 2024-02-21 16:54:55 +01: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
Johannes Klein
2d44fb9aac Explore filters, one more date range, two bugfixes (#1154)
* Update strings.ftl

* Add date range option to Date Uploaded filter

* Use more precise type for mapBoundaries

* Close date time picker on confirm button pressed

* Add TODO

* Prop isChecked into CheckBox component

Closes #1153

* Update Checkbox test

* Add another snapshot
2024-02-16 08:55:00 +01:00
Amanda Bullington
eb7f9d28e4 Add navigation links to explore views (#1146)
* Add navigation links to species, observer, identifier view items

* Add tests to check for navigation; closes #1054
2024-02-13 16:52:11 -08:00
Amanda Bullington
3a485f4d4b Load ObsDetails skeleton before observation data is ready (#1116)
* Load ObsDetail screen skeleton and loading wheels before observation is fetched; closes #1091

* Fix e2e test: make sure ActivityIndicator doesn't stay rendered
2024-02-06 17:09:51 -08:00
Amanda Bullington
2bce3aa784 Prevent PhotoCount from rendering with no count on scroll (#1112)
* Remove ForeignObject from SVG to prevent PhotoCount from rendering blank; closes #1073

* Update snapshot

* Fix styling for photo count large sizes

* Update snapshots
2024-02-05 14:12:02 -08:00
Amanda Bullington
ededfe82d1 Show ObsStatus in correct position after animating, ObsGridItem (#1099)
* Show ObsStatus in correct position after animating upload; closes #1056

* Update snapshots
2024-01-31 10:06:58 -08:00
Johannes Klein
60de855f6b Explore filters (#1067)
* Remove Explore Filters screen

* State for Explore filters modal

* Accept modal state in Header to open modal

* Basic explore filters modal

* Save taxon object to explore state on update

* Update types expected

* Pass state and update function into filters modal

* Receive new props

* Destructure taxon from props

* Restyle header View

* Add main Heading

* Add taxon section

* Restyle modal header

* Add numbers badge component

* TaxonResult add prop for general on press

* Make TaxonResult checkmark optional

* DisplayTaxon can receive children as right-side component

* Refactor ExploreFilters component tree

* Move header out of scroll view

* Update ExploreFilters.js

* Update ExploreFilters.js

* Add icon to display taxon

* Update ExploreFilters.js

* Add basic taxon search screen

* Use taxon result without checkmark, send taxon to Explore screen

* Add string

* Accept taxon on explore screen

* Add a dummy screen for explore location search

* Add type

* Store place in state when received as route param

* Basic explore filters location section

* Add strings

* Move filter modal to separate component, add sort by props

* Add screen for testing purposes

Because atm we can not have two modals open at the same time, I move filters to a separate screen for testing the other modals.

* Add initial filter params and do not pass down undefined ones

* Pass function to update sort by down

* Create SortBySheet.js

* Navigate to test screen instead

* Sort by button text

* Add default filters definition

* Call reset function if filters are not default

* Add prop and function to reset

* Add user search screen

* Move search screens

* Move references

* Replace list with flash list

* Add item separator

* Remove footer

* Return user to Explore

* On press handle for user list item

* Fix wrong imports

* If a user is in prop show user icon and edit button instead

* Refactor display taxon to be inside a Pressable

* Missing import

* Receive user in explore rout params

* Quality grade section header

* Placeholder

* Add TODO

* Calculate number of filters set

* Only send user id to explore screen

* Do send back user object, filter out user_id

* Add project section

* Refactor project list item into standalone component

* Change initial value to undefined

* Add project search screen

* Remove loading state

* Show project in filter modal

* If project is in param set it to state

* Add Checkboxes to filter modal

* Remove comment

* Taxonomic Ranks section UI

* Use props for checkboxes

* Update ExploreContainer.js

* Calculate actual query param

* Is Most Faved possible?

* Actually set sort by query params

* Save hrank and lrank to explore state, prop down

* Update ExploreContainer.js

* Show ranks in button text

* Radio modal to test taxonomic ranks

* Add sticky toolbar

* Update strings.ftl

* Date observed section bottom sheet

* Date observed prop

* Change padding

* Date observed all UI

* Taxonomic ranks section

* Add todo

* Refactor open sheets state

* Update button

* Add exact date picker sections

* Store dates in state

* Update strings.ftl

* Refactor function name

* Refactor constants

* Reset date states on mode change

* Set new months to state on change

* Configuration for showing months checkboxes

* Receive and update months with checkboxes

* Refactor RadioButton sheet to export radio button row

* Add Media section UI

* Add media state to Explore

* Start with Establishment Means section

* Add checkbox texts

* Add states

* Functions to update state

* Add sort by param for most faved

* Spacing for checkboxes

* Wild Status section UI

* Wild status state

* Reviewed UI section

* Reviewed state

* Set current user id as viewer_id for review true to work

* Remove testing code

* Photo licensing UI section

* Photo license state

* Prop down photo license update, use param in search

Forgotten in previous commit

* Unused prop

* Add noStatus state

* Change Establishment Means status to TODO

* Add TODO text

* Console log for testing params

* After rebase from main this was necessary

* Simple switch between two UIs

* Simple explore context

* Lift Provider one up

* Copy over photo license to new provider

* Copy over review filter

* Refactor to use enum

* Copy over wild status, and enum refactors

* Refactor some more state

* Remove unused navigation

* Refactor one state

* Refactor some more state

* Refactor some more state

* Remove testing screen

* Refactor some more state and derived state

* Do send over project as param from Project Details

* Update FilterModal.js

* Rename components

* Remove unused param handling

* Add keys

* Remove substring for key

* lrank and hrank combined counts as one only

* Use the correct constants

* Add key

* Fix issue with button text

* Add View Wrapper for filters section

* UI cosmetics

* Compare current filters state to a snapshot

* Change button level to focus

* Add context action to revert to snapshot

* Confirmation dialog strings

* Add confirmation sheet

* Send current user along to Explore from Home Header

Closes #887

* Date bottom sheets texts

* Show texts in modal

* Set search to worldwide on param received

* Send taxon as param to Explore from Taxon details screen

Closes #889

* Show all observations worldwide of project

* On species view pressed should navigate to explore species view

Closes #893

* Go to explore from users profile

* Navigate to species view from user profile

Closes #894

* Enable unclear filters

* Add taxon to context

* Use context for explore params further down the tree

* Refactor one state

* Remove unused action

* Remove unused state

* Refactor function

* Refactor state

* Refactor place_id, which concludes reducer refactor

* Refactor names

* Do not use key inside context's state

* Add a11y label

* Remove duplicate test ID

* Remove superfluous component

* Create ProjectListItem.test.js

* Add failing filter modal test

* Remove log

* Rename function

* Months strings

* Remove todo

* A11y labels

* Remove TODOs

* A11y label

* A11y label

* Refactor taxon search hook

* Update FilterModal.js

* A11y labels

* A11y not possible in react-native-paper lead to test fails

* Update TaxonSearch.test.js

* Add dropshadow

* Another dropshadow

* Add TODO text to UI elements that are not finished

* Reverse order

* Refactor constants

* Revert "Refactor constants"

This reverts commit 2f52e936d6.

* Refactor to use constants

* Refactor constants use

* Refactor constant use

* Refactor constants use

* Refactor constants use

* Refactor constants use

* Refactor code

* Add validation of date format

* Correct type for snapshot action

* Add taxonomic rank enum

* Taxon can be undefined

* More precise type

* Fix wrong string usage

* Refactor radio button row component

* Refactor ProjectListItem import

* Example usage of new ui elements

* Pull sort by sheet back inside filter modal

* Rename params

* Add useEffect dependency

* Rename param

* Fix broken function
2024-01-23 18:08:36 +01:00
Ken-ichi
e6b5cb8aa6 Obs details sounds (#1062)
* Extracted non-photo stuff from PhotoDisplay
* Separate component for FaveButton
* Prevent faves while signed out
* Separate component for nav header
* Stick nav header while scrolling until tabs
* Nav header has slight gradient for visibility over white content
* Renamed ObsDetails media components so they're not focused on photos
* Data and layout changes leading up to sound player on ObsDetail
* Add sound player to ObsDetails
* Swiping away while playing should pause playback
* Swiping back to sound and playing again should resume where you left off
* Allow viewing media while offline (images may be cached)
* Stop playback when navigating away from ObsDetails
* Fetch sounds in Explore so we can show sound icon
* Map all observation objects in explore with Realm-ish attributes
2024-01-22 13:12:01 -08:00
Amanda Bullington
51a3d171b2 Limit display taxon name on ObsGridItem (#1042)
* Ellipsize long common name text, ObsGridItem; closes #913

* Update snapshots
2024-01-16 16:52:10 -08:00
Amanda Bullington
09b225a1e6 Pause button dark mode until post-MVP (#1019)
* Pause button dark mode until post-MVP; closes #994

* Update snapshots
2024-01-10 17:07:36 -08:00
Amanda Bullington
7f6a25fa9f Show person icon as fallback when user is offline; closes #946 (#1017) 2024-01-10 14:34:10 -08:00
Amanda Bullington
21f83d7f58 Only show current ids in IdentificationCount; closes #995 (#1007) 2024-01-09 11:15:41 -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
Amanda Bullington
b33119f5a4 Update checkboxes & fix tests (#971)
* Update checkboxes & fix tests

* Fix accessibility/tests

* Update pods
2023-12-15 09:36:40 +01: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
Amanda Bullington
5c98d6665c Checkbox shared component (#963)
* Create shared checkbox component

* Add tests to Checkbox component

* Add snapshot and fix space in fill color
2023-12-14 10:01:48 -08:00
Amanda Bullington
f32a8812f5 Offline suggestions (#961)
* Use offline model for displaying sugggestions

* Simplify Suggestions/TaxonSearch screens using hooks

* Use updateObsKeys function from useStore

* Simplify code and fix unit tests

* Fix tests for offline predictions

* Fix faker urls

* Fetch remote taxa to display taxon photos in Suggestions

* Fix useTaxon code and test

* Use online vision results as backup for offline results

* Fix tests and add test for online predictions

* Use Flatlist for Suggestions and fix tests

* Move API call out of Attribution and fix test

* Fix tests

* Fix test warnings
2023-12-13 10:11:21 -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
Johannes Klein
66a0eda08d Dark mode styling button changes (#938)
* Add dark mode button snapshot tests

* Refactor dark mode styles to be a single function call

* Remove neutral button dark mode styling
2023-11-30 23:03:40 +01:00
Amanda Bullington
74f4238079 Increase pressable area of back button, Obs Edit (#931)
* Use custom header instead of react nav set options; expand back button padding; closes #907

* Wrap ObsEdit in SafeAreaView
2023-11-28 15:51:09 -08:00
Ken-ichi Ueda
38e75d3cdf Remove some unecessary react-navigation mocks 2023-11-20 11:09:36 -08:00
Amanda Bullington
7de3790230 Performance: move upload reducer out of ObsEditProvider into MyObservationsContainer (#879)
* Move upload functionality into MyObservations, out of ObsEditProvider

* Move upload into helper function

* Fixes for ObsEdit -> MyObs flow

* Progress on making uploads faster

* Update performance test

* Fix toolbar progress

* Fix tests for observation upload flow

* Fixes from code review; fix e2e test for signed in user by bypassing permission gate

* Hide sign up test when keyboard visible; fixes Android e2e test

* Comment out permissions code in e2e test to see if it's only needed locally

* Comment out permissions gate for signed out user iOS

* Use focused hook to stop ObsEdit from rerendering while user is on other screens

* Restore reassure in branch

* e2e code cleanup
2023-11-15 11:40:11 -08:00
Amanda Bullington
5d45b21570 Performance testing with Reassure (#867)
* Performance test with reassure, danger/CI integration set up

* Remove log

* Fix script location in github actions test

* Run performance tests before regular tests

* Move script

* Make script findable and executable

* Find scripts directory

* Find scripts directory

* Find scripts directory

* Give permission

* Comment out performance test CI

* Remove danger/CI and update naming

* Remove danger from package.json
2023-11-09 09:50:22 -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
60a7124405 Show tiles on ObsDetails map & map modal; add tests; closes #816 (#843) 2023-10-31 13:36:44 -07:00
Amanda Bullington
d38720f9b2 Tests & fix for upload progress (#826)
* Add unit tests for Toolbar upload progress

* Tests and improvements to upload progress bars

* Fix tests

* Update type for showsExploreIcon

* Fix tests

* Clear realm before MyObs tests
2023-10-20 16:01:48 -07:00
Ken-ichi
dacd8788ec Permission gate layouts (#743)
Primarily adds designed layouts for permission gates (also referred to as permissions priming).

* moved permission gate business logic into a container
* use react-native-permissions exclusively
* Show PermissionGate as a modal
* Basic unit tests for PermissionGate
* Consistent content width on tablet, other minor style changes
* Allow PermissionGate to be used outside of nav hierarchy
* Use user location on Explore after getting permission
* Remove redundant 'always' location perm in ios
* Isolate current location button in the Map component, which uses location fetching functionality from react-native-maps instead of our own
* Updated cocoapods; matched INatIcon.ttf to sha1 hashes
2023-10-18 16:47:12 -07:00
Amanda Bullington
7d20f6aa81 Suggestions (using server data) (#821)
* UI overhaul for Suggestions

* Updates to suggestions

* Update permissions library and Podfile

* Get tests passing

* Add tests for suggestions

* Update snapshot

* Add comment prompt & box to TaxonSearch

* Add empty state

* Nav and loading fixes

* Add more tests to Suggestions flow

* Fix tests

* Fix tests
2023-10-13 14:46:05 -07:00
Angie
1487e5f421 Accuracy circle and obscuration cell for obsdetail map (#744)
* Obscuration cell and accuracy circle on ObsDetail map
* DetailsMap view
* Copy and share location from DetailsMap
* Patched react-native-maps to address bug with showsUserLocation

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-10-09 12:41:22 -07:00
Ken-ichi
f166131fe5 ObsGridItem layout fixes (#815)
* Fixed layout changes for ObsGriditem
* Added noevidence icon when no photos
* Added a few tests
* Minor cleanup
2023-10-05 11:22:03 -07:00
Ken-ichi Ueda
2dd7f7b002 Forgot to add snapshot for tabs style change 2023-10-04 15:45:55 -07:00
Amanda Bullington
1be3cb94d2 Show iconic taxon icon in ObsImagePreview (#810)
* Add iconic taxon icon to ObsImagePreview; closes #805

* Show iconic taxon image instead of gradient

* Fix test
2023-09-27 17:41:46 -07:00
Johannes Klein
2027d77ac7 772 zoom button (#796)
* Refactor prop name

* Use Text component with Whitney Medium for zoom text

* Use multiplication sign in zoom button

* Update snapshots to new prop handling

* Refactor device and other props into a container component

* Use neutral zoom position as starting point

* Show zoom button not for single lens devices

* Cycle through neutralZoom maxZoom and minZoom

* when the device has only one physical lens it should start in the min zoom
2023-09-25 21:00:47 +02:00
Amanda Bullington
9ada594505 Show taxon pins on Explore Map (#778)
* Show taxon pins on Explore Map; allow navigation; closes #750

* Add test coverage for Map component

* Calculations for UTF position

* Map tiles pressable with UTF Grid overlay

* Fix tests

* Clean up tests
2023-09-21 16:08:39 -07:00
Amanda Bullington
5647e3a902 Show icon in DisplayTaxon if no photo (#775)
* Show icon in DisplayTaxon if no photo; closes #769

* Update icons with correct mollusca name

* Fix tests

* Fix tests and add test for iconic taxon icon; fix API call for default photo
2023-09-11 09:57:27 -07:00
Amanda Bullington
4942664432 Replace IconButton with INatIconButton (#749)
* Replace IconButton with INatIconButton

* Fix tests
2023-08-28 13:01:48 -07:00
Amanda Bullington
e26db07cf4 Make INatIconButton throw when no accessibilityLabel and fix errors (#748) 2023-08-25 08:46:32 -07:00
Amanda Bullington
0d203dfce0 Update activity list with suggested IDs (#740)
* Pass non-serialized values to AddID; handle id creation before nav; closes #721

* Fix tests
2023-08-17 19:27:49 -07:00
Amanda Bullington
dceccaece4 Add tests to DisplayTaxon; closes #726 (#735) 2023-08-14 17:04:01 -07:00
Amanda Bullington
85f11fdf69 Add IconicTaxonChooser to ObsEdit (#733) 2023-08-10 18:01:24 -07:00
Amanda Bullington
5b913ad1a7 Create IconicTaxonChooser, add to UI library, and write tests (#732) 2023-08-09 10:04:21 -07:00
Amanda Bullington
20d8308e5f Explore UI (#731)
* Start building explore screen

* Header for Explore screen

* Fix button build

* Move ObsFlashList to shared components for use in Explore

* Fix background transparency on SegmentedButtons

* Use reusable components for map and ObservationLocation

* Use search observations API to show results in explore views

* Add infinite scroll hook to species, observers, and identifiers views

* Update snapshots and create ExploreFlashList for consistent header animation

* Float segmented buttons above observation lists in explore

* Use queryparams for API calls; add loading state to each view
2023-08-08 12:29:17 -07:00
Ken-ichi Ueda
af2a5fbcb8 Replace current loc button w/ loading; make lower right interactive 2023-07-31 13:19:32 -07:00
Ken-ichi
7ae95519ea Iconic taxa icons (#723)
* Added iconic taxa icons; cleaned up some other icon files
* Updated snapshots
* Renamed ban icon to match fontawesome convention we use on the web
2023-07-28 10:22:34 -07:00
Ken-ichi Ueda
5717b84718 Minor test updates 2023-07-13 16:20:41 -07:00