Skip to content

Commit

Permalink
fixed sidebar focus in automatic eval results view
Browse files Browse the repository at this point in the history
  • Loading branch information
bekossy committed Apr 19, 2024
1 parent 9ff0e58 commit 780ebf7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions agenta-web/src/components/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {createUseStyles} from "react-jss"
import {useLocalStorage} from "usehooks-ts"
import {SidebarConfig, useSidebarConfig} from "./config"
import {JSSTheme} from "@/lib/Types"
import {useAppId} from "@/hooks/useAppId"

const {Sider} = Layout

Expand Down Expand Up @@ -227,6 +228,7 @@ const Sidebar: React.FC = () => {
const router = useRouter()
const classes = useStyles()
const [openKey, setOpenKey] = useState<string>()
const appId = useAppId()

const [collapsed, setCollapsed] = useLocalStorage("sidebarCollapsed", false)

Expand Down Expand Up @@ -273,6 +275,13 @@ const Sidebar: React.FC = () => {
matched = {...item, key: "app-single-model-test-link"}
openKey = "app-human-evaluations-link"
}
if (
router.asPath.startsWith(`/apps/${appId}/evaluations`) &&
!router.asPath.includes("new-evaluator")
) {
matched = {...item, key: "app-evaluations-results-link"}
openKey = "app-auto-evaluations-link"
}
}
})
}
Expand Down

0 comments on commit 780ebf7

Please sign in to comment.