Page MenuHomePhabricator

Update link preview design and include features for Places
Closed, ResolvedPublic

Assigned To
Authored By
scblr
Nov 16 2023, 12:54 PM
Referenced Files
F41658991: Screenshot_20240108-165110.png
Jan 8 2024, 3:57 PM
F41658989: Screenshot_20240108-165102.png
Jan 8 2024, 3:57 PM
F41615863: Screenshot_20231221-112751.png
Dec 21 2023, 10:35 AM
F41615849: image.png
Dec 21 2023, 10:35 AM
F41615834: Screenshot_20231221-112101.png
Dec 21 2023, 10:35 AM
F41615831: image.png
Dec 21 2023, 10:35 AM
F41615826: Screenshot_20231221-111511.png
Dec 21 2023, 10:35 AM
F41615821: handlebar copy.png
Dec 21 2023, 10:35 AM

Description

Design (Figma)
1. Bottom sheet
image.png (1×752 px, 596 KB)
2. Overflow menu
image.png (1×752 px, 576 KB)

Differences to the article bottom sheet:

  • Show distance to item (with icon + label)
  • Change main actions to 'Read', 'Save', 'Share'
  • Change overflow menu items to: 'Watch', 'Open in new tab', 'Copy link address', 'Get directions'
  • Functionality:
      • Tapping the search field when a location is active takes users to the search view with the active location. The keyboard is enabled, and the cursor is positioned at the end of the location string.
    • Tapping the 'Close' icon in the search bar takes users back to the map view, described in T351397
    • 'Read' takes users to the article
    • 'Save' saves article to reading list and shows existing snackbar
    • If an article’s been saved before → Change label from 'Save' to 'Saved'
    • 'Share' displays native bottom sheet
    • 'Watch' adds article to Watchlist and shows existing snackbar
    • If an article’s been watched before → Change label from 'Watch' to 'Watched'
    • 'Open in new tab' opens article in the background (without navigating there)
    • 'Copy link address' copies the article URL to the clipboard
    • 'Get directions' takes users to their default navigation app

APK: https://github.com/wikimedia/apps-android-wikipedia/pull/4334

Event Timeline

Sharvaniharan renamed this task from Update ‘article preview’ bottom sheet for nearby to Nearby: Update ‘article preview’ bottom sheet for nearby.Nov 20 2023, 6:52 PM
Sharvaniharan triaged this task as Medium priority.
scblr updated the task description. (Show Details)
Sharvaniharan renamed this task from Nearby: Update ‘article preview’ bottom sheet for nearby to Places: Update ‘article preview’ bottom sheet for nearby.Dec 7 2023, 2:28 AM
Sharvaniharan renamed this task from Places: Update ‘article preview’ bottom sheet for nearby to Places: Update ‘article preview’ bottom sheet for places.

Hi @scblr

This is the current LinkPreviewDialog when you tap on links on the article page, and I made a change to it so I can take a screenshot that shows the "Get directions" button.

Screenshot_20231214-154033_Wikipedia Dev.jpg (2×1 px, 175 KB)

Now, the "Get directions" is not showing anywhere and I cannot find the reason for not sending the Location information to the dialog, which is pretty weird.

The question is:

  1. Should we change "Get directions" to "View on map" if the article has Location information so we can see it on the Places?
  2. Does the design need to be updated? Showing three buttons on the bottom seems a bit crowded.

@cooltey two comments:

  1. The get directions option should be in the overflow menu; see designs in the task description.
  2. Per previous discussions with @Sharvaniharan and @JTannerWMF: only the LinkPreviewDialog within Places should be updated. The LinkPreviewDialog within the article should stay the same.

Thanks!

Hi @scblr

Per the discussion we had on Slack:

  1. Change "Get directions" to "View on map"
  2. Move the button to the overflow menu.
  3. This change only affects the current LinkPreviewDialog on the article page.

Hi @scblr,

The implementation of the link preview dialog is now completed. While waiting for the search bar to be merged into the feature branch, you are welcome to review the design now.

Thank you @cooltey, looks great already! 👏

1) Can we show the expanded full sheet from the beginning?

Like thisnotLike this
Screenshot_20231221-110106.png (2×1 px, 701 KB)
Screenshot_20231221-110106.png (2×1 px, 701 KB)

2) Would it be possible to add a handlebar to the top of the sheet?

ImplementationvsDesign
Screenshot_20231221-110106.png (2×1 px, 701 KB)
handlebar.png (1×752 px, 505 KB)
handlebar copy.png (1×752 px, 603 KB)

3) The 'Save' action should show the same snackbar as in the article (above the sheet)

ImplementationvsDesign
Screenshot_20231221-111511.png (2×1 px, 365 KB)
image.png (1×752 px, 691 KB)

4) There’s something off with the font definition used in the snackbar. It seems like there’s letter spacing applied to the h3-button type style, which should not be the case.

ImplementationvsDesign
Screenshot_20231221-112101.png (2×1 px, 715 KB)
image.png (1×752 px, 691 KB)

Make sure to use...

font-family: Roboto
font-weight: Medium
font-size: 16sp
line-height: 24sp/1.5em

...with no letter spacing

5) Is there some shadow or watermark applied to the thumbnail in the sheet?

Screenshot_20231221-112751.png (2×1 px, 863 KB)

If yes, please remove it :)

4) There’s something off with the font definition used in the snackbar. It seems like there’s letter spacing applied to the h3-button type style, which should not be the case.

@scblr If you spot issues or inconsistencies with general components, such as our Snackbars, please catalog them in a separate ticket such as T336702, so that these changes apply everywhere, and are not linked to a specific feature.

Dbrant renamed this task from Places: Update ‘article preview’ bottom sheet for places to Update link preview design and include features for Places.Dec 22 2023, 7:25 PM

I renamed the task to reflect the fact that we're making updates to the Link Preview component, which will apply globally wherever link previews are used.

If we need the appearance or behavior to deviate in the special case of Places, it would be great if we could list the deviations explicitly, and preferably keep them to a minimum.

Hi, @scblr
Please download the APK from the ticket description to see the changes.

1) Can we show the expanded full sheet from the beginning?

Done.

2) Would it be possible to add a handlebar to the top of the sheet?

Done.

3) The 'Save' action should show the same snackbar as in the article (above the sheet)

Done. Please note that if we need to show the snackbar, we have to dismiss the bottom sheet first before showing it.

4) There’s something off with the font definition used in the snackbar. It seems like there’s letter spacing applied to the h3-button type style, which should not be the case.

Done. (Looks like it is the default style for snackbar).

5) Is there some shadow or watermark applied to the thumbnail in the sheet?

There's nothing has been applied to the thumbnail, would you be able to check other places to see if it occurs again?


For the following two descriptions:

Tapping the search field when a location is active takes users to the search view with the active location. The keyboard is enabled, and the cursor is positioned at the end of the location string.
Tapping the 'Close' icon in the search bar takes users back to the map view, described in T351397

Since the actual search function is not in the feature branch yet, would it be possible to do these in another ticket?
Also, should we show the article title in the search bar when we tap on the marker?

Hi @scblr

Per code review comment:

  1. When setting the bottomsheet to fully expand by default, it will cause a jumpy issue on the initial loading. Would it be possible to have the default peek behavior of the bottom sheet to avoid the issue?
  2. About the bottomsheet handle, do we need to show the handle by default for the LinkPreviewDialog, not just for Places?

Thanks for all these updates @cooltey 🤝

1)

When setting the bottomsheet to fully expand by default, it will cause a jumpy issue on the initial loading. Would it be possible to have the default peek behavior of the bottom sheet to avoid the issue?

Ok, let’s keep the default peek behavior.

2) The status bar changes its color to paper when the bottom sheet is active. Can we avoid that behavior?

Screenshot_20240108-165102.png (2×1 px, 667 KB)
Screenshot_20240108-165110.png (2×1 px, 762 KB)

3)

About the bottomsheet handle, do we need to show the handle by default for the LinkPreviewDialog, not just for Places?

Yes, if feasible, please show the new handlebar everywhere to keep it consistent.

Hi @scblr, please download the APK to see the changes, thanks!

2) The status bar changes its color to paper when the bottom sheet is active. Can we avoid that behavior?

Done!

3)

About the bottomsheet handle, do we need to show the handle by default for the LinkPreviewDialog, not just for Places?

Done!

Thanks, @cooltey; this task is completed then! 👏