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

Search page #73

Merged
merged 18 commits into from
Jan 15, 2025
Merged

Search page #73

merged 18 commits into from
Jan 15, 2025

Conversation

Emmanuel-Develops
Copy link
Collaborator

@Emmanuel-Develops Emmanuel-Develops commented Dec 20, 2024

  • search api
  • use search
  • sidebar with filter and sort
  • result cards
  • toggle pills in result card
  • link pills from explore section to search
  • mobile responsiveness
  • use server action for search call to better integrate with search API

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
registry ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 3:11pm

@0tuedon
Copy link
Collaborator

0tuedon commented Jan 8, 2025

Asides the niit from the call? ready for review? @Emmanuel-Develops

@Emmanuel-Develops
Copy link
Collaborator Author

Asides the niit from the call? ready for review? @Emmanuel-Develops

core functionality, yes.
There's still some ui/ux nits to work out

@IgboPharaoh
Copy link
Collaborator

Hello @Emmanuel-Develops can you please rebase your branch to the latest on staging to resolve merge conflicts

@Emmanuel-Develops
Copy link
Collaborator Author

Hello @Emmanuel-Develops can you please rebase your branch to the latest on staging to resolve merge conflicts

rebased 👍

src/components/search/SearchResultCard.tsx Show resolved Hide resolved
src/utils/search.ts Outdated Show resolved Hide resolved
Copy link
Member

@kouloumos kouloumos left a comment

Choose a reason for hiding this comment

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

The implementation looks good overall, and I was able to test it locally. Search functionality works as expected.

However, I noticed a few issues and potential areas for improvement:

Testing Prerequisites

To test locally, you need to define the API_KEY and CLOUD_ID environment variables. This requirement should be mentioned in the README, similar to how we handle it for bitcoin-search.

Code Reuse

For files copied fully or partially from bitcoin-search, it would be helpful to include a note at the top of the file with a reference link. This adds context for future developers.

Additionally, if there's significant duplicated logic, we should consider centralizing it. With TLDR coming (which will also have a search page), maintaining similar functionality across three repositories is not sustainable.

Observations

A couple of issues I observed:

Topics Filtering

search query /search?search=dlcs sir

I see duplicate values for the very first tags, first tag filters correctly, the other displays a 404 page in the search results.

issue-duplicate-tags

There seems to be an issue with keeping state in the searchbox when using search

issue-with-filter-search

issue-with-state

Those issues don't exist in the Speakers and Sources filters.

Red colors

Is the red text for "No matching options" and the red "X" for the search part in the designs? They look out of place.

image

image

Result Card

The date placement on the result card does not align with the design specifications and looks awkward.

image

We should make a note for the source on the card. I know that is not an easy fix, but the way that is being displayed (slug instead of name) is not correct.

Pagination isn't centered

image

image

Comment on lines 34 to 41
"title",
"body",
"authors",
"tags",
"summary",
"transcript_source",
];
Copy link
Member

Choose a reason for hiding this comment

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

For Bitcoin Search we are only search authors, title and body. My thoughts:

  • I understand the addition of transcript_source.
  • I'm not sure about the addition of tags and summary. If they are actually useful, then we might need to consider adding them to Bitcoin Search as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point on summary it really isn't useful. However tags do offer some benefits, especially for single search keywords that are topics that may not have the topic name in the body.

src/config/index.ts Outdated Show resolved Hide resolved
src/components/search/SearchResultCard.tsx Outdated Show resolved Hide resolved
src/config/index.ts Outdated Show resolved Hide resolved
@Emmanuel-Develops
Copy link
Collaborator Author

For files copied fully or partially from bitcoin-search, it would be helpful to include a note at the top of the file with a reference link. This adds context for future developers.

Code that can be said to be partially duplicated are useURLManager and useSearch, and these hooks are self-contained functions (containing some different variables and functions in this implementation). Linking them to bitcoin-search doesn't provide any extra context.

Only /search/api contains more nuanced search, and I do not include it as it will be deleted during refactoring to use your global search API.
Notice in https://github.com/bitcointranscripts/registry/blob/search-page/src/app/search/searchCall.ts#L24 it can make a call to a provided URL rather than /search/api all custom data fetching will be deleted in favor of the global search API endpoint

also the envs won't be required anymore

@Emmanuel-Develops
Copy link
Collaborator Author

I see duplicate values for the very first tags, first tag filters correctly, the other displays a 404 page in the search results.

I am not getting the same results as you are (can't reproduce)
Screenshot 2025-01-14 at 11 28 41 AM

Is the red text for "No matching options" and the red "X" for the search part in the designs? They look out of place.

Mmm, there are no designs for this. Let's discuss that in the dev call today.
I'll switch it to grey in the meantime, but this isn't a blocker 👍

The date placement on the result card does not align with the design specifications and looks awkward.

fixed!

Pagination isn't centered

fixed!

cc: @kouloumos

Copy link
Member

@kouloumos kouloumos left a comment

Choose a reason for hiding this comment

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

Amazing! All my previous comments have been covered. Additionally, all of the places where "slug" was used, we are now using the full names.

This is the last one to be mapped, in the "Applied Filters":
image

I think that it should be a quick fix by passing the selected filter from the same mapping function.

ACK as soon as the above is fixed.

@Emmanuel-Develops
Copy link
Collaborator Author

Amazing! All my previous comments have been covered. Additionally, all of the places where "slug" was used, we are now using the full names.

This is the last one to be mapped, in the "Applied Filters": image

I think that it should be a quick fix by passing the selected filter from the same mapping function.

ACK as soon as the above is fixed.

thanks, pushed the fix

@kouloumos
Copy link
Member

Looks good to me! 🚀

@Emmanuel-Develops Emmanuel-Develops merged commit 5fc22f8 into staging Jan 15, 2025
2 checks passed
Emmanuel-Develops added a commit that referenced this pull request Jan 15, 2025
* feat: base search

* feat: link pills, speakers and topic cards to search

* feat: mobile responsiveness

* fix: cleanups and loader

* fix: sort fields and query

* refactor: switch useSearch to context from hook

* fix: prevent deopt to CSR with suspense

* feat: clickable pills either as link or function

* feat: loaders

* fix: use tagsDetailed from rebase

* fix: search behaviour logic and search results ui

* refactor: break search box into mobile component, standalone mobile filter menu

* fix(hydration-error): Pills as buttons on featured transcripts

* fix(review-fixes): source naming, result card UI, pagination, readme, use summary

* fix(review-fixes): searchbox clear on page navigation and get topic title for topics facet

* feat(optimizations): too many unnecessary prefetch requests, remove bloated data from landing page

* fix(search): prevent overflow on search results, add mapped topic name in applied filters

* fix(mobile): quality of life improvements
Emmanuel-Develops added a commit that referenced this pull request Jan 15, 2025
* feat: base search

* feat: link pills, speakers and topic cards to search

* feat: mobile responsiveness

* fix: cleanups and loader

* fix: sort fields and query

* refactor: switch useSearch to context from hook

* fix: prevent deopt to CSR with suspense

* feat: clickable pills either as link or function

* feat: loaders

* fix: use tagsDetailed from rebase

* fix: search behaviour logic and search results ui

* refactor: break search box into mobile component, standalone mobile filter menu

* fix(hydration-error): Pills as buttons on featured transcripts

* fix(review-fixes): source naming, result card UI, pagination, readme, use summary

* fix(review-fixes): searchbox clear on page navigation and get topic title for topics facet

* feat(optimizations): too many unnecessary prefetch requests, remove bloated data from landing page

* fix(search): prevent overflow on search results, add mapped topic name in applied filters

* fix(mobile): quality of life improvements
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.

4 participants