-
Notifications
You must be signed in to change notification settings - Fork 219
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
Analytics: Add REACH_RESULT_END event #2454
Conversation
Size Change: +2.83 kB (0%) Total Size: 843 kB
ℹ️ View Unchanged
|
afb0f8f
to
ac40905
Compare
ac40905
to
87e8ae7
Compare
Based on the medium urgency of this PR, the following reviewers are being gently reminded to review this PR: @AetherUnbound Excluding weekend1 days, this PR was ready for review 4 day(s) ago. PRs labelled with medium urgency are expected to be reviewed within 4 weekday(s)2. @obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings. Footnotes
|
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.
LGTM, tested fine locally.
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.
This looks good and tested as expected locally!
I made two small changes here:
|
Nice catches! |
Fixes
Fixes #1072 by @dhruvkb
Description
The main goal of this PR was to add the
REACH_RESULT_END
event when the user scrolls down the search results page and sees the "Load More" button.To add this event, I used the
useElementVisibility
composable from Vueuese. However, because the page was not scrolled to top when the user changes the search type, when the user opened a second page of images, for example, and then switched search type, theREACH_RESULT_END
event would be sent right after the "Load More" button was clicked, before the next page was even loaded.This is why I also added scroll to top functionality to the search result page so now when the user changes the search type, the results page scrolls to top.
This change surfaced a problem where the search type changed, and there were still results from the previous search type, and the change of the media and search title/content links was visibly inconsistent after the page scrolled to top. To fix this, I added
clearMedia
call to the function that changes the search type so that the page displays a loading skeleton once it scrolls up. For all content page, when the fetchState'sisFetching
was false before the fetching started, this wouldn't show the loading skeleton, and the external search form was visible right below the content links. This is why I had to update the condition for showing the loading skeleton to include!hasStarted
.To add the
resultPage
to the event payload, I updated themediaStore
to keep track of the current page. @zackkrida, this might be useful for #2449 (I found a relatively simple way of adding the page, without major changes to the media and search stores)I also did some cleanup in the
search.vue
: moved thefetchMedia
androuteWatcher
inside thesetup
function, and usedstoreToRefs
to simplify the store values.All of this is to say that seemingly small addition required a lot of changes in the code, this is why the PR is large.
Testing Instructions
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin