Skip to content

Commit

Permalink
Fix some UX bugs in model switching
Browse files Browse the repository at this point in the history
  • Loading branch information
liambai committed Dec 22, 2024
1 parent 844cd99 commit 27aad08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions viz/src/components/CustomSeqSearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export default function CustomSeqSearchPage() {

// Do a search whenever the input changes
useEffect(() => {
setSearchResults([]);
if (urlState.pdb && isPDBID(urlState.pdb)) {
setInput(urlState.pdb);
handleSearch(urlState.pdb);
Expand All @@ -225,11 +226,10 @@ export default function CustomSeqSearchPage() {
handleSearch(urlState.seq);
} else {
setInput("");
setSearchResults([]);
}
// handleSearch runs unnecessarily if I add it here
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [urlState.pdb, urlState.seq]);
}, [urlState.pdb, urlState.seq, model]);

// Do a search whenever the chain changes
useEffect(() => {
Expand Down
7 changes: 6 additions & 1 deletion viz/src/components/SAESidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export default function SAESidebar() {
<div className="m-3">
<HomeNavigator />
</div>
<Select value={model} onValueChange={(value) => navigate(`/sae-viz/${value}`)}>
<Select
value={model}
onValueChange={(value) =>
navigate(`/sae-viz/${value}${feature !== undefined ? `/${feature}` : ""}`)
}
>
<SelectTrigger className="mb-3">
<SelectValue placeholder="Select SAE Model" />
</SelectTrigger>
Expand Down

0 comments on commit 27aad08

Please sign in to comment.