-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixes #26124: recent synced tab will use preview image URLs from history #26195
Fixes #26124: recent synced tab will use preview image URLs from history #26195
Conversation
@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. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
app/src/main/java/org/mozilla/fenix/home/recentsyncedtabs/RecentSyncedTabFeature.kt
Outdated
Show resolved
Hide resolved
* 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
app/src/main/java/org/mozilla/fenix/home/recentsyncedtabs/RecentSyncedTabFeature.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/mozilla/fenix/home/recentsyncedtabs/view/RecentSyncedTab.kt
Show resolved
Hide resolved
45e920a
to
fa2c23f
Compare
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. |
This pull request has conflicts when rebasing. Could you fix it @MatthewTighe? 🙏 |
fa2c23f
to
be1dbdf
Compare
…URLs from history
be1dbdf
to
3c9f99e
Compare
Pull Request checklist
QA
To download an APK when reviewing a PR (after all CI tasks finished running):
Checks
at the top of the PR page.firefoxci-taskcluster
group on the left to expand all tasks.build-debug
task.View task in Taskcluster
in the newDETAILS
section.GitHub Automation
Fixes #26124