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 modal #114

Merged
merged 10 commits into from
May 17, 2023
Merged

Search modal #114

merged 10 commits into from
May 17, 2023

Conversation

carlosgauci
Copy link
Collaborator

  • Added tutorial search modal (placeholder search result)

@vercel
Copy link

vercel bot commented Apr 16, 2023

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

Name Status Preview Comments Updated (UTC)
haystack-home ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2023 10:53am

* Add tutorial-search api for requests

* Debug code

* Fetch env variable

* Check node version

* Add more env variables
* see error info to get

* return error message

* Remove console log and improve error handling

* Improve error handling for  dc request

* Improve api calls
}

} else {
console.error(response.statusText)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add an error state here? It can be similar to the modal's opening screen, and it can say "There has been an error. Please try again later."
Right now it is stuck in the loading state. We can do the same for console.error("Error:", error);

</svg>

<div>
<h3>${doc.meta.title}</h3>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make the title more prominent? Now in the UI title font seems smaller than the content

result.results[0].documents.forEach((doc) => {
const card = document.createElement("a")
card.classList.add("search-modal-card")
card.href = `/tutorials/${doc.meta.file_name.toLowerCase().replace(".txt", "")}`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I updated the tutorial response. Now, every tutorial has headlines information in the meta field. Can we use this information to direct the users precisely to the place where the text is retrieved from?

Here's an example
This is a headline of a result:

headlines: [
0: {level: 1, headline: "Initializing the PromptNode"}
1: {level: 1, start_idx: 455, headline: "Defining the Pipeline"}
]

This is the meta.link of the same result: tutorials/22_pipeline_with_promptnode
The link that this result item directs to should be: tutorials/22_pipeline_with_promptnode#initializing-the-promptnode
Basically, you need to take only the first item of headlines and add it to the end of the link with - instead of space.

* Remove "powered by" text from the logo
@bilgeyucel bilgeyucel merged commit def9885 into main May 17, 2023
@bilgeyucel bilgeyucel deleted the search-modal branch May 17, 2023 11:16
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