fix: harden assistant floating panel
This commit is contained in:
1 parent
345d9e6fa4
commit
4635e3ce4e
4 files changed
+10
-6
No files matched your search
@@ -47,7 +47,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: min(46rem, calc(100vw - 2rem));
|
width: min(46rem, calc(100vw - 2rem));
|
||||||
height: min(36rem, calc(100dvh - 5rem));
|
height: min(36rem, calc(100dvh - 5rem));
|
||||||
min-height: 22rem;
|
min-height: min(22rem, calc(100dvh - 5rem));
|
||||||
margin: 0;
|
margin: 0;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -251,7 +251,7 @@
|
|||||||
bottom: 0.5rem;
|
bottom: 0.5rem;
|
||||||
width: calc(100vw - 1rem);
|
width: calc(100vw - 1rem);
|
||||||
height: min(44rem, calc(100dvh - 1rem));
|
height: min(44rem, calc(100dvh - 1rem));
|
||||||
min-height: 20rem;
|
min-height: min(20rem, calc(100dvh - 1rem));
|
||||||
}
|
}
|
||||||
|
|
||||||
.panelHeader {
|
.panelHeader {
|
||||||
@@ -274,11 +274,11 @@
|
|||||||
padding-inline: 0.5rem;
|
padding-inline: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.historyButton :global(.mantine-Button-section) {
|
.historyButtonSection {
|
||||||
margin-inline-end: 0;
|
margin-inline-end: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.historyButton :global(.mantine-Button-label) {
|
.historyButtonLabel {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ const ConversationHistory = () => {
|
|||||||
color="gray"
|
color="gray"
|
||||||
size="compact-sm"
|
size="compact-sm"
|
||||||
leftSection={<IconHistory size={16} />}
|
leftSection={<IconHistory size={16} />}
|
||||||
|
classNames={{ section: classes.historyButtonSection, label: classes.historyButtonLabel }}
|
||||||
onClick={() => setOpened((current) => !current)}
|
onClick={() => setOpened((current) => !current)}
|
||||||
>
|
>
|
||||||
{t("conversations")}
|
{t("conversations")}
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ const DisabledAssistantProvider = ({ children, description }: DisabledAssistantP
|
|||||||
export const AssistantProvider = ({ children }: PropsWithChildren) => {
|
export const AssistantProvider = ({ children }: PropsWithChildren) => {
|
||||||
const t = useScopedI18n("common.assistant");
|
const t = useScopedI18n("common.assistant");
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const { data, isLoading } = clientApi.assistant.getAvailability.useQuery(undefined, {
|
const { data, isLoading, isError } = clientApi.assistant.getAvailability.useQuery(undefined, {
|
||||||
enabled: session.status === "authenticated",
|
enabled: session.status === "authenticated",
|
||||||
staleTime: 60_000,
|
staleTime: 60_000,
|
||||||
});
|
});
|
||||||
@@ -459,7 +459,9 @@ export const AssistantProvider = ({ children }: PropsWithChildren) => {
|
|||||||
? t("unavailable.signIn")
|
? t("unavailable.signIn")
|
||||||
: isLoading
|
: isLoading
|
||||||
? t("unavailable.checking")
|
? t("unavailable.checking")
|
||||||
: t("unavailable.notConfigured");
|
: isError
|
||||||
|
? t("unavailable.error")
|
||||||
|
: t("unavailable.notConfigured");
|
||||||
|
|
||||||
return <DisabledAssistantProvider description={unavailableDescription}>{children}</DisabledAssistantProvider>;
|
return <DisabledAssistantProvider description={unavailableDescription}>{children}</DisabledAssistantProvider>;
|
||||||
};
|
};
|
||||||
@@ -1976,6 +1976,7 @@
|
|||||||
},
|
},
|
||||||
"unavailable": {
|
"unavailable": {
|
||||||
"checking": "Checking whether the assistant is available…",
|
"checking": "Checking whether the assistant is available…",
|
||||||
|
"error": "The assistant's availability could not be checked. Try again.",
|
||||||
"notConfigured": "An administrator must configure and enable the assistant first.",
|
"notConfigured": "An administrator must configure and enable the assistant first.",
|
||||||
"signIn": "Sign in to use Homarr Assistant."
|
"signIn": "Sign in to use Homarr Assistant."
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user