-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
feat(search): surface explorer views in search results #3429
feat(search): surface explorer views in search results #3429
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @marcelgerber and the rest of your teammates on Graphite |
3c15ba9
to
5a1a957
Compare
945fe68
to
a949af3
Compare
26c8f28
to
539259b
Compare
546e78c
to
f988fdc
Compare
4af8522
to
37806f4
Compare
d2dffb9
to
7dbbc49
Compare
6ace3db
to
a888e19
Compare
Click tracking is now part of this, but it's a bit messy overall: For posts (unchanged){
query: "co2",
position: 2, // Second overall entry
positionInSection: 2,
filter: "all"
} For charts (unchanged){
query: "co2",
position: 6, // Second chart, 6th global result
positionInSection: 2,
filter: "all"
} For full explorer links ("Explore all ... indicators"){
query: "co2",
position: 9, // First explorer card
positionInSection: 1,
cardPosition: 1,
positionWithinCard: 0, // Special marker for the "Explore all ..." link
filter: "all"
} For links to a view{
query: "co2",
position: 14, // Second explorer card, second link
positionInSection: 6, // Five results (links) before
cardPosition: 2, // Card number 2
positionWithinCard: 2,
filter: "all"
} Of course, the href is also always included as an Am I happy with that? Not really 🤷🏻 |
31341e3
to
4927798
Compare
cb9fc63
to
67583c5
Compare
4927798
to
ca8196c
Compare
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.
The functionality is overall very nice! Just a few comments on behind the scenes stuff
highlightedTagName="strong" | ||
className="search-results__explorer-view-title" | ||
/> | ||
<FontAwesomeIcon icon={faArrowRight} /> |
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.
You might want to position: absolute; margin-top: .5rem
this so that it doesn't dangle
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.
With display: block; width: calc(100% - 16px);
on .search-results__explorer-view-title-container
to ensure there's space
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.
Could achieve the same thing using ‍
(zero-width joiner) and white-space: nowrap
.
PR will go up soon, together with other design changes.
@@ -128,17 +136,152 @@ function ChartHit({ hit }: { hit: IChartHit }) { | |||
) | |||
} | |||
|
|||
function ExplorerHit({ hit }: { hit: IExplorerHit }) { | |||
interface ExplorerViewHitWithPosition extends IExplorerViewHit { |
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 think this is a regression not from this PR, but it seems like data-algolia-position
is now only local to each section, i.e. posts start at 1, charts start at 1, etc.
charts were meant to start at numberOfPosts + 1
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 think that's what it was meant to do, right?
data-algolia-position
is the local position, and globalPosition
gets computed in the click handler on its own (and only gets sent to GTM, not to Algolia).
f54369b
to
c1520b0
Compare
c1520b0
to
f9eb694
Compare
ca8196c
to
d46ddf7
Compare
d46ddf7
to
d9dc7b2
Compare
6be2870
into
search-feature-branch-2024-2
TODOs
explorerSlug
[viewTitle, explorerSlug]
maybe do country name removal (optionalWords
)probably sort explorer cards with more view items higher upexplorers
indexSearchIndexName.explorers
and all uses (refactor(algolia): remove old explorer indexing code #3472)