Skip to content
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

All search #11534

Merged
merged 22 commits into from
Jan 29, 2025
Merged

All search #11534

merged 22 commits into from
Jan 29, 2025

Conversation

davidpmccormick
Copy link
Contributor

Part of #11460

image

What does this change?

Adds a ContentSearchResult component and uses it behind the allSearch toggle on the new search page

How to test

Turn on the toggle, search for something, check the linkResolver takes you to where it should for each of the possible content types.

I used the existing Pagination component (if/when we update to match the designs, I think that could be a larger piece of work to make that change everywhere we do pagination).

Catalogue results are being dealt with separately. I also backed out of tackling the styling of the search box and adding then number of hits per section as part of this PR. It would require several more requests and maybe needs more discussion before it gets built

How can we measure success?

We can serve site-search information to users rather than them having to Ask Jeeves

Have we considered potential risks?

Things link to the wrong place/display incorrectly. It's behind a toggle so this shouldn't be a problem for as long as that's the case if so

@davidpmccormick davidpmccormick requested a review from a team as a code owner January 27, 2025 17:35
<p className={font('intr', 5)}>
{contentQueryFailed ? (
<>
There was a problem fetching some search results. Please try
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would need an editor to write it for real

Copy link
Contributor

Choose a reason for hiding this comment

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

Fairs, could create a new ticket for error messages or add it to the no results scenarios as those will be worked on next sprint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@rcantin-w rcantin-w left a comment

Choose a reason for hiding this comment

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

content/webapp/components/ContentSearchResult/ContentSearchResult.tsx

I thought we were moving towards the content/webapp/components/ContentSearchResult/index.tsx model.

It's fine if not, but just a naming thing that if we don't want we should change the others that have it?
Although I still think we could move the other "SearchResults" component under the umbrella of one folder and then index becomes confusing!

@rcantin-w
Copy link
Contributor

The links for Exhibition Text don't lead to the captions-and-transcript page (like Hard graft's http://localhost:3000/search?query=hard+graft)

@rcantin-w
Copy link
Contributor

It's reaaaaally cool to see it come to life 🙌 loved switching to this branch and rendering it.

@davidpmccormick
Copy link
Contributor Author

The links for Exhibition Text don't lead to the captions-and-transcript page (like Hard graft's http://localhost:3000/search?query=hard+graft)

Nice spot thanks!

if (type === 'exhibition-texts') {
return `/guides/exhibitions/${uid}/captions-and-transcripts`;
}

if (type === 'visual-stories') {
Copy link
Contributor

Choose a reason for hiding this comment

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

We're not returning the "correct" URL here, since we don't have 'data', it goes to the fallback URL - do we mind? (maybe one for Lauren).

http://localhost:3000/visual-stories/hard-graft
should be
http://localhost:3000/exhibitions/hard-graft-work-health-and-rights/visual-stories

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@rcantin-w rcantin-w left a comment

Choose a reason for hiding this comment

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

Audio highlight tour is there at least 3x; even though it says 5 results, this makes it look like there are more
http://localhost:3000/search?query=hard+graft+highlight

@rcantin-w
Copy link
Contributor

rcantin-w commented Jan 29, 2025

Audio highlight tour is there at least 3x; even though it says 5 results, this makes it look like there are more
http://localhost:3000/search?query=hard+graft+highlight

Hermmm I can't replicate anymore.... Weird? Hot reload? Will keep an eye out 🤔

UPDATE: I was able to replicate! It's on query change. So try "hard graft" -> search -> "hard graft highlight" -> search; there are more results displaying than should.

@rcantin-w
Copy link
Contributor

rcantin-w commented Jan 29, 2025

Not for this PR and probs needs Lauren/design but some pages don't have descriptions and it looks off. We could run a script seeing which ones they are and if Editorial could just address those, maybe make it a Prismic linting rule?

EDIT: I'll talk about this with Lauren

UPDATE: I've sent the list to Editorial to amend

Screenshot 2025-01-29 at 09 36 22

@davidpmccormick
Copy link
Contributor Author

UPDATE: I was able to replicate! It's on query change. So try "hard graft" -> search -> "hard graft highlight" -> search; there are more results displaying than should.

Nice catch! I was using the uid as the key in the map, but since the uid doesn't account for unique results (because there are two highlight tours for the same uid) it needs the highlightTourType taken into account too

Copy link

github-actions bot commented Jan 29, 2025

Size Change: +1.8 kB (+0.18%)

Total Size: 1.02 MB

Filename Size Change
content/webapp/.next/static/chunks/2782.7aaa3e9253023056.js 0 B -3.47 kB (removed) 🏆
content/webapp/.next/static/chunks/7914-115210bc7c243bdf.js 0 B -2.96 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/_app-5810eea9a448e1e9.js 0 B -109 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/search-56e8528825661853.js 0 B -6.06 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/stories/[articleId]-9c29f321164b94e7.js 0 B -7.61 kB (removed) 🏆
content/webapp/.next/static/chunks/webpack-2f316d76bb1f51d1.js 0 B -2.33 kB (removed) 🏆
identity/webapp/.next/static/chunks/pages/_app-8c0df489457ac1d1.js 0 B -105 kB (removed) 🏆
content/webapp/.next/static/chunks/2782.eac83680a61cf332.js 3.47 kB +3.47 kB (new file) 🆕
content/webapp/.next/static/chunks/7914-54f2a2a0f777f381.js 2.96 kB +2.96 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/_app-44b1d80a6f69b290.js 109 kB +109 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/search-4d58728d11397585.js 7.48 kB +7.48 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/stories/[articleId]-dd3c93e1563b827c.js 7.61 kB +7.61 kB (new file) 🆕
content/webapp/.next/static/chunks/webpack-ac93fbabbbf9b221.js 2.33 kB +2.33 kB (new file) 🆕
identity/webapp/.next/static/chunks/pages/_app-775eb4998a78964a.js 105 kB +105 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
content/webapp/.next/static/chunks/00a8a139.e66d72e5d4e63786.js 58.7 kB
content/webapp/.next/static/chunks/1256.13d04d7ceb6d34d7.js 3.2 kB
content/webapp/.next/static/chunks/1271.e0c2268369bdddfb.js 4.81 kB
content/webapp/.next/static/chunks/1570-12fc6fe973ac6263.js 5.49 kB
content/webapp/.next/static/chunks/1711.d646362e86773288.js 1.63 kB
content/webapp/.next/static/chunks/1723-dd15ab5809baac3f.js 6.98 kB
content/webapp/.next/static/chunks/1792.8d30ed89b794a7c5.js 2.87 kB
content/webapp/.next/static/chunks/1801.0e7c25d7fb0b5b8e.js 3.12 kB
content/webapp/.next/static/chunks/1895-939985d7aa411a41.js 2.27 kB
content/webapp/.next/static/chunks/211-f2920ff3e40813b3.js 2.67 kB
content/webapp/.next/static/chunks/2186-6e5af00a8e062693.js 3.82 kB
content/webapp/.next/static/chunks/2394-f7ade4728bab7d66.js 3.2 kB
content/webapp/.next/static/chunks/2526.ca9695fe3b718606.js 4.38 kB
content/webapp/.next/static/chunks/2588.182a59157030f15d.js 1.65 kB
content/webapp/.next/static/chunks/286.e6c4fb42dbebd142.js 20.7 kB
content/webapp/.next/static/chunks/2873.76785027718b9ef3.js 1.62 kB
content/webapp/.next/static/chunks/3197.b17b6db1e5fef68e.js 263 B
content/webapp/.next/static/chunks/3393.1a50235e398e33e1.js 358 B
content/webapp/.next/static/chunks/3422-35d87fae4bd6364d.js 2.92 kB
content/webapp/.next/static/chunks/3463.6f34c3c7f0a539d7.js 3.31 kB
content/webapp/.next/static/chunks/3818-f189578851816276.js 3.5 kB
content/webapp/.next/static/chunks/3833-a84da5bdad9f4850.js 2.99 kB
content/webapp/.next/static/chunks/3870-6cd839f2d5f8f560.js 3.42 kB
content/webapp/.next/static/chunks/4005.218bad1ccfa4c2b3.js 5.97 kB
content/webapp/.next/static/chunks/4374.b1c852b38e66d6ec.js 373 B
content/webapp/.next/static/chunks/4494-9ee08e6cd2d95cc0.js 4.68 kB
content/webapp/.next/static/chunks/4554.3ebff88311e47bda.js 3.93 kB
content/webapp/.next/static/chunks/4631.9dd484a988ff132d.js 2.19 kB
content/webapp/.next/static/chunks/4660.d3804cb5d35c597f.js 277 B
content/webapp/.next/static/chunks/4892-fda2d3f364673ee8.js 4.42 kB
content/webapp/.next/static/chunks/6042-1becdfc7177f0443.js 7.15 kB
content/webapp/.next/static/chunks/6425-194ee5c5c5654052.js 6.66 kB
content/webapp/.next/static/chunks/6472-b175ef56ac759325.js 22 kB
content/webapp/.next/static/chunks/656-a5507fb3ff57a9a4.js 3.06 kB
content/webapp/.next/static/chunks/6577-5673df74d42242c4.js 3.9 kB
content/webapp/.next/static/chunks/6921-867cfe60d1b6e717.js 3.67 kB
content/webapp/.next/static/chunks/7107-7a0c6bd1411921e2.js 33.8 kB
content/webapp/.next/static/chunks/7185.711d55487124425c.js 2.44 kB
content/webapp/.next/static/chunks/72-b9bcdfe8ff0bebfc.js 4.47 kB
content/webapp/.next/static/chunks/721-ea2d0bb10927ae69.js 7.55 kB
content/webapp/.next/static/chunks/7401-4a133da6bafaf096.js 4.34 kB
content/webapp/.next/static/chunks/7603-ca72323ac1819255.js 3.14 kB
content/webapp/.next/static/chunks/7732-1dd71852aef3f1ea.js 7.68 kB
content/webapp/.next/static/chunks/7842-b97990097b812fa3.js 4.79 kB
content/webapp/.next/static/chunks/8732.8a67f91b9792fd93.js 4.54 kB
content/webapp/.next/static/chunks/8880-f5a4b47b6d3b3e03.js 4.99 kB
content/webapp/.next/static/chunks/8910.2c6b18de4b850a00.js 263 B
content/webapp/.next/static/chunks/8983-2f54da5934670a9b.js 11.4 kB
content/webapp/.next/static/chunks/9133.39332f424231fd53.js 2.71 kB
content/webapp/.next/static/chunks/9309.60054df571ff5328.js 2.83 kB
content/webapp/.next/static/chunks/9450.bf6b04974baf1a1a.js 5.04 kB
content/webapp/.next/static/chunks/9536-ffd6af6ce3912e19.js 3.71 kB
content/webapp/.next/static/chunks/9696.f76a03ee3b169f51.js 3.59 kB
content/webapp/.next/static/chunks/9875.cc2786d20b9961c7.js 4.8 kB
content/webapp/.next/static/chunks/framework-978a6051e6d0c57a.js 44.9 kB
content/webapp/.next/static/chunks/main-f8a178edb9b98bff.js 36.9 kB
content/webapp/.next/static/chunks/pages/_error-4cf036a2ff1ec507.js 331 B
content/webapp/.next/static/chunks/pages/[uid]-f7f5a1c5c173a80f.js 1.94 kB
content/webapp/.next/static/chunks/pages/404-791c5651d62f91a3.js 258 B
content/webapp/.next/static/chunks/pages/500-2275439797e687d9.js 258 B
content/webapp/.next/static/chunks/pages/about-us-67d04490ec9e73bf.js 1.94 kB
content/webapp/.next/static/chunks/pages/about-us/[uid]-6eb0a9c5eda89650.js 1.94 kB
content/webapp/.next/static/chunks/pages/about-us/cookie-policy-928f89339ac2ecbf.js 5.99 kB
content/webapp/.next/static/chunks/pages/books-b4a7e0f211c0fdd2.js 2.02 kB
content/webapp/.next/static/chunks/pages/books/[bookId]-98d052c378550e1e.js 4.08 kB
content/webapp/.next/static/chunks/pages/collections-b81cfe99c7eed9d2.js 2.35 kB
content/webapp/.next/static/chunks/pages/collections/[uid]-028a4efe4b821a11.js 2.29 kB
content/webapp/.next/static/chunks/pages/concepts/[conceptId]-c83a56c08dfed03a.js 3.81 kB
content/webapp/.next/static/chunks/pages/event-series/[eventSeriesId]-eaaf51b5cc921d61.js 2.93 kB
content/webapp/.next/static/chunks/pages/events-326f4d9953df5f9a.js 2.14 kB
content/webapp/.next/static/chunks/pages/events/[eventId]-709812801280af7e.js 8.87 kB
content/webapp/.next/static/chunks/pages/events/[eventId]/visual-stories-5c97b5365f87b92d.js 299 B
content/webapp/.next/static/chunks/pages/exhibitions-cf4a548474c5fd80.js 2.39 kB
content/webapp/.next/static/chunks/pages/exhibitions/[exhibitionId]-01fc7d3b72c8eaec.js 3.98 kB
content/webapp/.next/static/chunks/pages/exhibitions/[exhibitionId]/visual-stories-c191d7e9adfaa7b5.js 300 B
content/webapp/.next/static/chunks/pages/get-involved-14a56d323cec3ca5.js 1.94 kB
content/webapp/.next/static/chunks/pages/get-involved/[uid]-503367f75f3c1cd4.js 1.95 kB
content/webapp/.next/static/chunks/pages/guides/[guideId]-73b83002c64a73b6.js 2.25 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions-08ea84a753b1c93f.js 2.65 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]-266807f317d4df24.js 2.76 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]/[type]-add8fa514e508c79.js 7.2 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]/[type]/[stop]-bf1be7f0514b5628.js 3.71 kB
content/webapp/.next/static/chunks/pages/index-287ad9758b767a78.js 3.48 kB
content/webapp/.next/static/chunks/pages/newsletter-930fb9f580889eee.js 2.35 kB
content/webapp/.next/static/chunks/pages/pages/[pageId]-58b058ba4201f276.js 1.91 kB
content/webapp/.next/static/chunks/pages/projects/[projectId]-6133409795b403db.js 2.23 kB
content/webapp/.next/static/chunks/pages/search/events-67237cc0093758db.js 2.04 kB
content/webapp/.next/static/chunks/pages/search/images-088ca917b8b02e94.js 1.58 kB
content/webapp/.next/static/chunks/pages/search/stories-e9ac779ef5a8b05c.js 3.11 kB
content/webapp/.next/static/chunks/pages/search/works-91cef78fa662dc37.js 2.96 kB
content/webapp/.next/static/chunks/pages/seasons/[seasonId]-c0d254e369e93df3.js 3.86 kB
content/webapp/.next/static/chunks/pages/series/[seriesId]-018c871fbad4af1b.js 5.08 kB
content/webapp/.next/static/chunks/pages/slice-simulator-42e197d935275401.js 973 B
content/webapp/.next/static/chunks/pages/stories-f7221235c4db5df8.js 1.73 kB
content/webapp/.next/static/chunks/pages/visit-us-6aad5b024691be14.js 2.27 kB
content/webapp/.next/static/chunks/pages/visit-us/[uid]-d14c16d0485a9bf2.js 1.95 kB
content/webapp/.next/static/chunks/pages/visual-stories/[visualStoryId]-539ee0cbab547f91.js 238 B
content/webapp/.next/static/chunks/pages/whats-on-4b840aee34feb0ae.js 210 B
content/webapp/.next/static/chunks/pages/whats-on/[period]-4d3fbe544ccc539e.js 279 B
content/webapp/.next/static/chunks/pages/works/[workId]-39d05b97c94d09a5.js 21.9 kB
content/webapp/.next/static/chunks/pages/works/[workId]/download-a6ff441233119a50.js 2.73 kB
content/webapp/.next/static/chunks/pages/works/[workId]/images-465df80c2c73bd2f.js 702 B
content/webapp/.next/static/chunks/pages/works/[workId]/items-994abab0f7a2450a.js 3.99 kB
content/webapp/.next/static/chunks/polyfills-42372ed130431b0a.js 39.5 kB
identity/webapp/.next/static/chunks/128.a394cb623dd1d2e9.js 2.71 kB
identity/webapp/.next/static/chunks/286.30e19e68d137a7fe.js 20.7 kB
identity/webapp/.next/static/chunks/442-16a4fdfe63454534.js 9.09 kB
identity/webapp/.next/static/chunks/644-f0cfb6459ad9993f.js 16.2 kB
identity/webapp/.next/static/chunks/911.3961d88c7985befe.js 939 B
identity/webapp/.next/static/chunks/framework-e82a91356956e6c8.js 44.8 kB
identity/webapp/.next/static/chunks/main-0a79b8ff20fd3839.js 39 kB
identity/webapp/.next/static/chunks/pages/_error-cd4c42214e080cf2.js 1.45 kB
identity/webapp/.next/static/chunks/pages/delete-requested-695bdf7b35dae097.js 3.22 kB
identity/webapp/.next/static/chunks/pages/error-a8564e691956d3a2.js 1.69 kB
identity/webapp/.next/static/chunks/pages/index-fdcc8e4649babc2a.js 12 kB
identity/webapp/.next/static/chunks/pages/registration-c4497c610603656a.js 4.12 kB
identity/webapp/.next/static/chunks/pages/success-c2599ab99f3cf080.js 3.3 kB
identity/webapp/.next/static/chunks/pages/validated-ccfa3474735f993e.js 3.38 kB
identity/webapp/.next/static/chunks/polyfills-42372ed130431b0a.js 39.5 kB
identity/webapp/.next/static/chunks/webpack-f1b15f41485fda96.js 1.82 kB

compressed-size-action

Copy link
Contributor

@rcantin-w rcantin-w left a comment

Choose a reason for hiding this comment

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

🙌

@davidpmccormick davidpmccormick merged commit 242c611 into main Jan 29, 2025
8 checks passed
@davidpmccormick davidpmccormick deleted the all-search branch January 29, 2025 16:25
@gestchild gestchild mentioned this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants