fix: keep assistant in user menu
This commit is contained in:
1 parent
f3360e0d97
commit
8a8e222da3
3 files changed
+1
-26
No files matched your search
@@ -9,7 +9,7 @@ tags:
|
||||
# Assistant
|
||||
|
||||
Administrators can configure the instance-wide AI assistant from **Management → Assistant**.
|
||||
It is available to signed-in users from the header, the user menu, and the `Cmd/Ctrl + K` command menu.
|
||||
It is available to signed-in users from the user menu and the `Cmd/Ctrl + K` command menu.
|
||||
`Cmd/Ctrl + Shift + K` opens it directly.
|
||||
|
||||
When the assistant is unavailable, its command-menu result remains visible but disabled and explains that
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Tooltip } from "@mantine/core";
|
||||
import { IconRobot } from "@tabler/icons-react";
|
||||
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
|
||||
import { HeaderButton } from "../layout/header/button";
|
||||
import { useOptionalHomarrAssistant } from "./assistant-provider";
|
||||
|
||||
export const AssistantHeaderButton = () => {
|
||||
const t = useScopedI18n("common.assistant");
|
||||
const assistant = useOptionalHomarrAssistant();
|
||||
if (!assistant?.enabled) return null;
|
||||
|
||||
return (
|
||||
<Tooltip label={`${t("title")} (Mod+Shift+K)`} position="bottom">
|
||||
<HeaderButton onClick={assistant.open} aria-label={t("open")}>
|
||||
<IconRobot size={20} />
|
||||
</HeaderButton>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
@@ -4,7 +4,6 @@ import { AppShellHeader, Group, UnstyledButton } from "@mantine/core";
|
||||
import { Link } from "@homarr/ui";
|
||||
|
||||
import { ClientBurger } from "./header/burger";
|
||||
import { AssistantHeaderButton } from "../assistant/assistant-trigger";
|
||||
import { DesktopSearchInput, MobileSearchButton } from "./header/search";
|
||||
import { TourTarget } from "./header/tour-target";
|
||||
import { UserButton } from "./header/user";
|
||||
@@ -38,7 +37,6 @@ export const MainHeader = ({ logo, actions, hasNavigation = true }: Props) => {
|
||||
</TourTarget>
|
||||
<Group h="100%" align="center" justify="end" style={{ flex: 1 }} wrap="nowrap">
|
||||
{actions}
|
||||
<AssistantHeaderButton />
|
||||
<MobileSearchButton />
|
||||
<TourTarget id="board-user-menu">
|
||||
<UserButton />
|
||||
|
||||
Reference in new issue
Block a user