Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Places: Add View on map option to customize toolbar #4308

Merged
merged 21 commits into from Dec 14, 2023

Conversation

cooltey
Copy link
Collaborator

@cooltey cooltey commented Nov 29, 2023

https://phabricator.wikimedia.org/T351394

In this PR:

  • Fixed an issue where we did not update the icon status of "Edit article" correctly.
  • Optimize some code related to the overflow menu and action tab.
  • Adjusted the width of the overflow menu.

@cooltey cooltey added the WIP Work in progress label Nov 29, 2023
@cooltey cooltey changed the title Nearby: Add View on map optionto customize toolbar Nearby: Add View on map option to customize toolbar Dec 1, 2023
@cooltey cooltey added Design review and removed WIP Work in progress labels Dec 1, 2023
@cooltey cooltey changed the title Nearby: Add View on map option to customize toolbar Places: Add View on map option to customize toolbar Dec 8, 2023
Copy link
Collaborator

@sharvaniharan sharvaniharan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cooltey

When I click on View on map I see that it just loads the map to a general locations with a zoomed-out approach like this: https://youtube.com/shorts/0usNNFKtGVg
I was expecting that we will zoom to that article on the map.. is that not the case?

@cooltey
Copy link
Collaborator Author

cooltey commented Dec 12, 2023

Hi @cooltey

When I click on View on map I see that it just loads the map to a general locations with a zoomed-out approach like this: https://youtube.com/shorts/0usNNFKtGVg I was expecting that we will zoom to that article on the map.. is that not the case?

Done!

@sharvaniharan
Copy link
Collaborator

@cooltey I think the recent change opens up the bottom sheet on loading the map, with markers on the background. I was thinking of a more smoother experience like this:

  • We get the location from the article
  • When user clicks on View on map it takes them to the places fragment
  • Here let us pass on that LatLng, and zoom slowly to that marker at that location, similar to the cluster experience
  • And, let us not open the bottom sheet, which is actually looking a bit more disruptive to me.
    I feel this experience will be what they expect. Please let me know your thoughts.

@cooltey
Copy link
Collaborator Author

cooltey commented Dec 13, 2023

@cooltey I think the recent change opens up the bottom sheet on loading the map, with markers on the background. I was thinking of a more smoother experience like this:

* We get the location from the article

* When user clicks on `View on map` it takes them to the places fragment

* Here let us pass on that `LatLng`, and zoom slowly to that `marker` at that location, similar to the cluster experience

* And, let us not open the bottom sheet, which is actually looking a bit more disruptive to me.
  I feel this experience will be what they expect. Please let me know your thoughts.

Sounds good to me, I can remove the open-up logic from the PR. But let me hold this PR until we merge the cluster PR to the feature branch 😅

@cooltey cooltey added HOLD Will review as soon as other more pressing PRs are merged/released. and removed HOLD Will review as soon as other more pressing PRs are merged/released. labels Dec 13, 2023
@cooltey
Copy link
Collaborator Author

cooltey commented Dec 13, 2023

@cooltey I think the recent change opens up the bottom sheet on loading the map, with markers on the background. I was thinking of a more smoother experience like this:

* We get the location from the article

* When user clicks on `View on map` it takes them to the places fragment

* Here let us pass on that `LatLng`, and zoom slowly to that `marker` at that location, similar to the cluster experience

* And, let us not open the bottom sheet, which is actually looking a bit more disruptive to me.
  I feel this experience will be what they expect. Please let me know your thoughts.

Done. Now it will not show the bottom sheet and also will zoom in to the max level.

@sharvaniharan sharvaniharan merged commit 9166cf1 into nearby_design Dec 14, 2023
2 checks passed
@sharvaniharan sharvaniharan deleted the nearby-customize-toolbar-design branch December 14, 2023 20:12
dbrant added a commit that referenced this pull request Feb 5, 2024
* Quick stub of nearby.

* Get it!

* Do it.

* Wire in our own OkHttp client.

* Fix.

* Create ViewModel for Nearby.

* Disable logo and set attribution margins.

* Basic markers.

* Set max zoom, for now.

* Apply proper limits on API call.

* Cache annotations, and make them clickable.

* Slightly better marker.

* Slightly better marker.

* Towards location tracking.

* Real-time user location.

* Introduce slop factor for fetching updated articles.

* With thumbnails.

* Yes.

* Don't fetch updates if zoomed out too far.

* Realign markers a bit.

* Recycle remaining bitmaps on destroy.

* Simplify initialization.

* Correctly pass search radius.

* Wire up link preview dialog.

* Precalculate Paint and Rect objects.

* Accept approximate location.

* Adapt.

* Explicitly specify referrer when fetching map tiles.

* Use Open Sans font, and update endpoints to Labs.

* Use production maps.

* Update suggested style json.

* Use correct font stack for markers.

* qq strings.

* Duplicate string.

* Nearby: Move nearby to main nav more menu (#4298)

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

* Update maplibre versions (#4306)

* Change label to `Places` (#4323)

* Change label to `Places`

* Lint fix

---------

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

* Places: adding dark theme JSON for the map (#4307)

* Nearby: adding dark theme JSON

* Update style

* Update dark theme json

* Rename

* Update history entry constant.

* Set HistoryEntry constant to what it used to be.

* Places: Clustering (#4309)

* wwip

* Lint fix

* Introduce clustering with desired styling

* Design update

* Update to themed color

* Code review change

* Places: slow animation from cluster to children (#4327)

* Places: slow animation from cluster to children

* Better animation

* Update duration and add correct font

* Design update

* Use Express.literal() instead

---------

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>
Co-authored-by: cooltey <coolteygame@gmail.com>
Co-authored-by: Cooltey Feng <cfeng@wikimedia.org>

* Places: Add View on map option to customize toolbar (#4308)

* Nearby: Add View on map optionto customize toolbar

* Add action logic

* Add comments for later fix

* Add default lists constant

* Fix: make sure getting the coordinates from the page/summary endpoint

* add FIXME and simplify the name

* Add parameter for nearby

* Add logic of pointing to target place

* Design comment and fix some toolbar color and enable states

* Fix logic

* Update width of the menu

* Fix error

* Show bottomsheet for the article location

* Fix lint

* Zoom in to the max

* A few preliminary bits.

* A few more preliminaries.

* Introduce Search bar at the top.

* Use correct gravity and margins for compass and attribution.

* Update style of FAB.

* Fix error

* Places: update UI elements on map (#4343)

* Places: update UI elements on map

* Fix lint

* Lazy it

* Disable the logo icon

* Update compass and code review addressed

* Lint

* Use new compass icon

* Use layer list to mimic shadow

* Use regular one

* Update compass svg

* Use correct color for info icon

* Use previous compass icon and adding bottom margin

* Update ripple color

* Don't create unnecessary bitmaps. (#4379)

---------

Co-authored-by: Dmitry Brant <dbrant@wikimedia.org>

* Places: Search (#4319)

* Added search bar to nearby screen

* Update tabs functionality

* Set-up click listeners

* Filter screen added

* Add filter screen

* Ui update to lang code button

* Add global location search

* Changed langCode layout and adjusted compass position

* Updated location tracking with language switch

* Use LatLng rather than Location

* Magnify the searched/clicked/visited_from_article marker

* Code clean-up

* Trigger search when you visit from Places

* Get language code from pagetitle

* Minor clean-up

* Fix edge-case language deletion bug

* Minor fix

* Do not use LatLng outside of Places.

* Preliminary cleanup.

* Lint.

* Lint.

* Lint fix

* Marker update fix

---------

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>
Co-authored-by: Dmitry Brant <me@dmitrybrant.com>

* A touch of cleanup.

* Stray bits.

* Places condition change - Minor fix

* change icons position and added a todo comment for optimization

* Places: Update ‘article preview’ bottom sheet for places (#4334)

* Places: Update ‘article preview’ bottom sheet for places

* Dialog update

* Update overflow menu

* Update overflow menu and add method to callback

* Update overflow menu and add method to callback

* Update overflow menu

* Add qq string

* Update overlay buttons

* Correct logic of add to new tab

* Set watchlist logic correctly

* Add timestamp for keep watch status updated.

* Use correct pagetitle

* Close bottomsheet before showing snackbar

* Reduce watch status loading

* Clear changed status before starting new watch action

* Show distance

* Show distance on the dialog

* Fix lint

* Fix build error

* Fix errors

* Fix another error

* Add handle and adjust peek height

* Reduce letter spacing in snackbar

* Show save vs saved for reading list button

* Optimze save to reading list logic

* Remove dim background

* Set correct state of the bottom sheet

* Remove peek height

* Rename strings name

* Move logic to link preview dialog

* Update expiry logic

* Remove unused methods

* Make handle always visible

* Remove unused method

* Fix error

* Add comment for remove snackbar

* Remain status bar color and update snackbar

* Fix lint

* Follow-up: run animation when opening in new tab. (#4389)

* Change 8dp to 12dp for compass margin

* Revert "Merge branch 'main' into nearby_design"

This reverts commit 3318abc, reversing
changes made to 6b0a379.

* Untangle from earlier merge.

* Further untangle.

* Minor: Add places condition to prefix search results too

* Design tweak: Places search (#4392)

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

* Places Filter screen: Design tweaks (#4383)

* Places Filter screen: Design tweaks

* Standardize langcode ui

* Minor ui update

* Update button style to h3

* Code review comments addressed

* Minor fix

---------

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

* Set title in xml.

* Make search field single-line.

* Factor out showing of link preview.

* Use parcelable extension.

* Bump z-order of selected marker, and clarify naming.

* Factor out setting of magnified symbol.

* Use highlightedPageTitle as it was intended.

* Title could contain html.

* Minor: Filter design update

* Open up maximum zoom level in the map. (#4395)

* Re-introduce minimum movement offset for querying map updates. (#4396)

* (Places) Correctly handle insets. (#4397)

* Places: reset the search bar text and icon after dismissing the link preview dialog (#4398)

* Fix: clear search bar text and icon after dismissing the link preview
dialog

* Lint fix

---------

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

* Show link preview dialog if access from an article (#4401)

* (Places) remove postDelayed calls. (#4402)

* Save last location information to the preference (#4400)

* Save last location on map to reduce zoom-in animation when launch

* Update with proper Preference method

* Update preference correctly

* Reduce animation duration

* Put back 10ms delay.

* Handle zoomlevel correctly

* Fix lint

---------

Co-authored-by: Dmitry Brant <me@dmitrybrant.com>

* (Places) Clean up searching, and correctly remember last search term. (#4403)

* (Places) Clean up searching, and correctly remember last search term.

* Style.

* Remove unused method

* Make sure the tab icon is visible when tab count > 0

* Places: Build a "list" view of places, alongside the "map" view (#4357)

* Initial commit of adding toggle buttons

* Adjust style

* Apply base color to buttons

* Use post for buttons

* Add linearlayout

* Add list item view

* Add adapter and viewholder

* Update binding

* Update adapter

* Show the list view correctly

* Update search bar bgcolor

* Update toggle buttons

* Add location to nearbypage

* Update recyclerview

* Add strings for empty state

* Fix lint

* Add empty illustration

* Use library to show circle image

* Update list styles

* Add clicklistener action

* Add long press menu

* Apply proper bottom margin for recyclerview

* Update list item text size and toggle button height

* Adjust margin

* Adjust ripple color

* Add drawable padding to the link preview dialog as well

* Use correct style for text and show article summary if no description

* Single line only if the description is extract

* Add prop=extracts for list view items in Places (#4413)

* Reset single line value

* Reset single line value

* (Places) Don't use extra list along with LiveData. (#4416)

* Handle orientation change

* Get correct last location

* Apply margins to the layout params correctly

* Open new foreground tab from map

* Fix error

---------

Co-authored-by: Dmitry Brant <dbrant@wikimedia.org>

* Remove extracts usage and update list view design

* Apply description once

* Align to the middle of vertical correctly

* Places: apply new language and tab counts view to Places (#4425)

* Add new lang button to places

* Unused import

* Remove background from langCodeView

* Add long press toast

* Use linearLayout instead

* Move transition parameter to the searchText and update contentDescripton
for LangCodeView

* Places: Bring back bottomsheet dim (#4426)

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

* Places: Discovery with tooltips (#4407)

* Places: Tooltips for discoverability

* Changes tooltip order

* Removed watchlist tooltip from both article screen and main screen

* Lint fix

* Design tweaks

* Show main tooltip on second launch

* Remove line-break in tooltip

---------

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

* Places: Survey (#4412)

* Initial commit

* Fix strings

* Added one time show logic

* Minor update

* update survey dialogs

* Minor change

* Code review comments addressed -1

* Addressed CR comments and Design Review suggestion

* Design review comments addressed

* Remove unnecesary line space

* Build fix

* Update survey conditions

* Code review comment addressed

* Code review comments addressed

---------

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

* Simplify and optimize code in PlacesFilterActivity (#4430)

* Respect isImageDownloadedEnabled setting in Places (#4436)

* Fix: use null-safe for LinkPreviewDialog action button (#4433)

* Fix: use lastKnownLocation instead of the last map location for distance (#4434)

* Set distance location at binding time.

* Fix: dismiss the LinkPreviewDialog when changing device's orientation (#4439)

* Minor code update for Places (#4441)

* Places: Data wiring (#4384)

* Places event created and Search, mapview and entry points data wired

* Minor change

* Places: Tooltips for discoverability

* Changes tooltip order

* Initial commit

* Fix strings

* Added one time show logic

* Minor update

* update survey dialogs

* Minor change

* Code review comments addressed -1

* Addressed CR comments and Design Review suggestion

* Design review comments addressed

* Remove unnecesary line space

* Removed watchlist tooltip from both article screen and main screen

* Lint fix

* Build fix

* Design tweaks

* Lint fix

* Add tooltip wiring

* Update survey conditions

* Updated list view and preview dialog wiring

* Complete data wiring

* Data review comments updated

* Code review comment addressed

* Codereview comments addressed

* stream wiring update

---------

Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>

---------

Co-authored-by: Sharvani Haran <sharvaniharan@users.noreply.github.com>
Co-authored-by: Cooltey Feng <cfeng@wikimedia.org>
Co-authored-by: Sharvani Haran <sharvaniharan83@gmail.com>
Co-authored-by: cooltey <coolteygame@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants