feat: search & chat UX improvements, sidebar fixes, and bug fixes - #78
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
UX-focused update across the Next.js frontend plus a backend system-prompt tweak to improve navigation/auth affordances, search results presentation, and chat response behavior.
Changes:
- Introduces a reusable
SignInOutButtonand relocates sign-in/out controls from the sidebar to page headers across multiple pages. - Refreshes
/searchUX (category “pill” filters, loading skeletons, empty/initial states, and a Clear action). - Improves
ChatBoxresponse handling (stop/cancel in-flight requests; reduce duplicated biomodel ID/link formatting) and expands LLM formatting rules in the backend prompt.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/components/sign-in-out-button.tsx | Adds shared login/logout button component for consistent header placement. |
| frontend/components/file-fetcher.tsx | Adds header-level sign-in/out control to file fetcher views. |
| frontend/components/ChatBox.tsx | Adds stop/cancel support and adjusts biomodel ID hyperlink formatting logic. |
| frontend/components/app-sidebar.tsx | Reorders sidebar sections and removes the bottom auth/logout button area. |
| frontend/app/search/page.tsx | Search UI refresh: filter pills, clear button, skeleton loading, and empty/initial states. |
| frontend/app/search/[bmid]/page.tsx | Adds header-level sign-in/out control to biomodel detail view. |
| frontend/app/sbml/page.tsx | Adds header-level sign-in/out control to SBML page. |
| frontend/app/page.tsx | Updates landing page header to show Sign Out when authenticated. |
| frontend/app/diagrams/page.tsx | Adds header-level sign-in/out control to diagrams page. |
| frontend/app/chat/page.tsx | Adds header-level sign-in/out control to chat page. |
| frontend/app/analyze/page.tsx | Adds header-level sign-in/out control to analyze page. |
| frontend/app/analyze/[id]/page.tsx | Adds header-level sign-in/out control to analysis results page. |
| frontend/app/admin/knowledge-base/page.tsx | Adds header-level sign-in/out control to knowledge base admin page. |
| backend/app/utils/system_prompt.py | Adds/adjusts LLM output-format guidance for identifiers.org links and biomodel listings. |
Comments suppressed due to low confidence (3)
frontend/components/ChatBox.tsx:131
bmIdis interpolated directly into aRegExpwithout escaping. If the backend ever returns an ID containing regex metacharacters, this will either throw or match unintended text. EscapebmIdbefore building the regex (and then build the regex from the escaped value).
const db_link = `[Database Details](/search/${bmId})`;
const replacementString = `**${bmId}** || ${db_link}`;
const idRegex = new RegExp(`(?<!/search/)\\b${bmId}\\b`, "g");
formattedContent = formattedContent.replace(idRegex, replacementString);
frontend/components/ChatBox.tsx:240
- Abort detection relies on
error instanceof DOMException, but Fetch aborts aren't consistently surfaced asDOMExceptionacross runtimes. Checking the.nameproperty is more robust and avoids misclassifying aborts as backend errors.
if (error instanceof DOMException && error.name === "AbortError") {
backend/app/utils/system_prompt.py:34
- The biomodel listing template mixes
${biomodelID}and${biomodelId}. Using inconsistent placeholder casing makes the required format ambiguous for the LLM; keep it consistent with${biomodelID}used elsewhere in this section.
1. **[Biomodel Name](/search/${biomodelID})**
- **Biomodel Key:** ${biomodelId}
- **Owner:** ${owner}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sidebar & navigation
Search page (
/search)Chat (
ChatBox)Backend