Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Fixes #26124: recent synced tab will use preview image URLs from history #26195

Merged
merged 2 commits into from
Aug 16, 2022

Conversation

MatthewTighe
Copy link
Contributor

@MatthewTighe MatthewTighe commented Jul 26, 2022

image

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

QA

  • QA Needed

To download an APK when reviewing a PR (after all CI tasks finished running):

  1. Click on Checks at the top of the PR page.
  2. Click on the firefoxci-taskcluster group on the left to expand all tasks.
  3. Click on the build-debug task.
  4. Click on View task in Taskcluster in the new DETAILS section.
  5. The APK links should be on the right side of the screen, named for each CPU architecture.

GitHub Automation

Fixes #26124

@MatthewTighe MatthewTighe requested review from a team as code owners July 26, 2022 23:22
@gabrielluong gabrielluong self-assigned this Jul 27, 2022
@gabrielluong
Copy link
Member

gabrielluong commented Jul 27, 2022

@MatthewTighe This is more of a follow up, but it might be worthwhile to check with UX (I would ask at least 2 UX Kate and Nicole and maybe even Product since this seems like a medium-size decision, maybe use the eng-ux slack channel) if we should also just change all the "Jump back in" images to use the hero/preview image instead of the thumbnail. This is more for general consistency since we have both thumbnail and hero image now for "Jump back in" and we already use hero image for Recent Bookmarks and Pocket.

Copy link
Contributor

@MozillaNoah MozillaNoah left a comment

Choose a reason for hiding this comment

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

🚢 🚢 🚢

I agree with @gabrielluong though there may need to be a follow-up for some UI unification.

* The number of days to search history for a preview image URL to display for a synced
* tab.
*/
private const val DAYS_HISTORY_FOR_PREVIEW_IMAGE = 3L
Copy link
Member

Choose a reason for hiding this comment

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

Should this just be inside the companion object of RecentSyncedTabFeature? No strong opinions on this, but it might be something worth doing to make it testable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hadn't thought of it from a testability standpoint. A companion object would probably make the most sense in that case. I generally kinda dislike the pattern of instantiating a whole object just for a const val, this SO post covers why a bit. A top-level internal val could work if we had modules in Fenix, but I think namespacing it with a companion makes more sense since we don't.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm.. interesting. I don't know if we really considered the pattern about how we define constants. My initial reaction is simply based on what I have seen in the project, and looking at what we did in the BookmarksUseCase. I won't be the best person to weigh on how we should ideally proceed with this, but might always be something to bring up in a discussion if you think it's worthwhile to establish some sort of guidelines.

* The number of days to search history for a preview image URL to display for a synced
* tab.
*/
private const val DAYS_HISTORY_FOR_PREVIEW_IMAGE = 3L
Copy link
Member

@gabrielluong gabrielluong Jul 28, 2022

Choose a reason for hiding this comment

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

I am not sure if 3 days might be too short. We have used 10 days in https://searchfox.org/mozilla-mobile/source/fenix/app/src/main/java/org/mozilla/fenix/components/bookmarks/BookmarksUseCase.kt#107. It's okay if you believe this is enough, but I figure I would ask anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used 3 here to try and keep it a little more performant, we're already struggling with the performance of this feature a little bit. My reasoning being that typically a "recent synced tab" has probably been visited on its original device within the last 3 days

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, sounds good to me.

@MatthewTighe
Copy link
Contributor Author

This is more of a follow up, but it might be worthwhile to check with UX (I would ask at least 2 UX Kate and Nicole and maybe even Product since this seems like a medium-size decision, maybe use the eng-ux slack channel) if we should also just change all the "Jump back in" images to use the hero/preview image instead of the thumbnail. This is more for general consistency since we have both thumbnail and hero image now for "Jump back in" and we already use hero image for Recent Bookmarks and Pocket.

I've filed mozilla-mobile/android-components#11971 and #26230 as followups to add a fallback to a site screenshot, based on feedback from UX.

@gabrielluong gabrielluong added the pr:approved PR that has been approved label Aug 4, 2022
@mergify
Copy link
Contributor

mergify bot commented Aug 16, 2022

This pull request has conflicts when rebasing. Could you fix it @MatthewTighe? 🙏

@MatthewTighe MatthewTighe force-pushed the recent-synced-tab-hero branch from fa2c23f to be1dbdf Compare August 16, 2022 02:08
@MatthewTighe MatthewTighe force-pushed the recent-synced-tab-hero branch from be1dbdf to 3c9f99e Compare August 16, 2022 17:25
@MatthewTighe MatthewTighe added the pr:needs-landing PRs that are ready to land [Will be merged by Mergify] label Aug 16, 2022
@MatthewTighe MatthewTighe reopened this Aug 16, 2022
@mergify mergify bot merged commit ab306f0 into mozilla-mobile:main Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:approved PR that has been approved pr:needs-landing PRs that are ready to land [Will be merged by Mergify]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recent synced tab should retrieve hero image URL from synced history
3 participants