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;
|
||||
width: min(46rem, calc(100vw - 2rem));
|
||||
height: min(36rem, calc(100dvh - 5rem));
|
||||
min-height: 22rem;
|
||||
min-height: min(22rem, calc(100dvh - 5rem));
|
||||
margin: 0;
|
||||
transform: translateX(-50%);
|
||||
flex-direction: column;
|
||||
@@ -251,7 +251,7 @@
|
||||
bottom: 0.5rem;
|
||||
width: calc(100vw - 1rem);
|
||||
height: min(44rem, calc(100dvh - 1rem));
|
||||
min-height: 20rem;
|
||||
min-height: min(20rem, calc(100dvh - 1rem));
|
||||
}
|
||||
|
||||
.panelHeader {
|
||||
@@ -274,11 +274,11 @@
|
||||
padding-inline: 0.5rem;
|
||||
}
|
||||
|
||||
.historyButton :global(.mantine-Button-section) {
|
||||
.historyButtonSection {
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
||||
.historyButton :global(.mantine-Button-label) {
|
||||
.historyButtonLabel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -337,6 +337,7 @@ const ConversationHistory = () => {
|
||||
color="gray"
|
||||
size="compact-sm"
|
||||
leftSection={<IconHistory size={16} />}
|
||||
classNames={{ section: classes.historyButtonSection, label: classes.historyButtonLabel }}
|
||||
onClick={() => setOpened((current) => !current)}
|
||||
>
|
||||
{t("conversations")}
|
||||
|
||||
@@ -440,7 +440,7 @@ const DisabledAssistantProvider = ({ children, description }: DisabledAssistantP
|
||||
export const AssistantProvider = ({ children }: PropsWithChildren) => {
|
||||
const t = useScopedI18n("common.assistant");
|
||||
const session = useSession();
|
||||
const { data, isLoading } = clientApi.assistant.getAvailability.useQuery(undefined, {
|
||||
const { data, isLoading, isError } = clientApi.assistant.getAvailability.useQuery(undefined, {
|
||||
enabled: session.status === "authenticated",
|
||||
staleTime: 60_000,
|
||||
});
|
||||
@@ -459,7 +459,9 @@ export const AssistantProvider = ({ children }: PropsWithChildren) => {
|
||||
? t("unavailable.signIn")
|
||||
: isLoading
|
||||
? t("unavailable.checking")
|
||||
: t("unavailable.notConfigured");
|
||||
: isError
|
||||
? t("unavailable.error")
|
||||
: t("unavailable.notConfigured");
|
||||
|
||||
return <DisabledAssistantProvider description={unavailableDescription}>{children}</DisabledAssistantProvider>;
|
||||
};
|
||||
@@ -1976,6 +1976,7 @@
|
||||
},
|
||||
"unavailable": {
|
||||
"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.",
|
||||
"signIn": "Sign in to use Homarr Assistant."
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user