-
Notifications
You must be signed in to change notification settings - Fork 7
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
Search modal #114
Conversation
carlosgauci
commented
Apr 16, 2023
- Added tutorial search modal (placeholder search result)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
* 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) |
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.
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> |
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.
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", "")}`; |
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 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