fix(ui): fix playground banner Open Chat UI button 404

The banner's href was hardcoded to /chat, missing both the /ui/ prefix
and any server_root_path prefix. Use useUIConfig to build the same
chatHref as the navbar does.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang 2026-03-07 15:06:28 -08:00
parent cfd0e2cf99
commit ff6dc51987

View file

@ -8,6 +8,7 @@ import ComplianceUI from "@/components/playground/complianceUI/ComplianceUI";
import { TabGroup, TabList, Tab, TabPanels, TabPanel } from "@tremor/react";
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
import { fetchProxySettings } from "@/utils/proxyUtils";
import { useUIConfig } from "@/app/(dashboard)/hooks/uiConfig/useUIConfig";
import { MessageOutlined, CloseOutlined } from "@ant-design/icons";
interface ProxySettings {
@ -19,6 +20,11 @@ export default function PlaygroundPage() {
const { accessToken, userRole, userId, disabledPersonalKeyCreation, token } = useAuthorized();
const [proxySettings, setProxySettings] = useState<ProxySettings | undefined>(undefined);
const [chatBannerDismissed, setChatBannerDismissed] = useState(false);
const { data: uiConfig } = useUIConfig();
const uiRoot = uiConfig?.server_root_path && uiConfig.server_root_path !== "/"
? uiConfig.server_root_path.replace(/\/+$/, "")
: "";
const chatHref = `${uiRoot}/ui/chat`;
useEffect(() => {
const initializeProxySettings = async () => {
@ -67,7 +73,7 @@ export default function PlaygroundPage() {
{" "} a ChatGPT-like interface for your users to chat with AI models and MCP tools. Share it with your team.
</span>
<a
href="/chat"
href={chatHref}
target="_blank"
rel="noopener noreferrer"
style={{