fix: polish assistant widget interactions
This commit is contained in:
1 parent
ed705c9e34
commit
39a14a18f9
5 files changed
+33
-5
No files matched your search
@@ -93,6 +93,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.floatingPanel {
|
.floatingPanel {
|
||||||
|
container-name: assistant-widget;
|
||||||
|
container-type: size;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 290;
|
z-index: 290;
|
||||||
inset-inline-start: 50%;
|
inset-inline-start: 50%;
|
||||||
@@ -259,6 +261,21 @@
|
|||||||
.runtimeButton {
|
.runtimeButton {
|
||||||
padding-inline: 0.5rem;
|
padding-inline: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.reasoningButton {
|
||||||
|
width: 2.5rem;
|
||||||
|
min-width: 2.5rem;
|
||||||
|
max-width: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reasoningButton :global(.mantine-Button-label),
|
||||||
|
.reasoningButton :global(.mantine-Button-section[data-position="right"]) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reasoningButton :global(.mantine-Button-section[data-position="left"]) {
|
||||||
|
margin-inline: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@container assistant-widget (max-width: 18rem) {
|
@container assistant-widget (max-width: 18rem) {
|
||||||
|
|||||||
@@ -985,11 +985,11 @@ const ThreadHistory = ({ onSelect }: { onSelect: () => void }) => {
|
|||||||
{t("conversations")}
|
{t("conversations")}
|
||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<ScrollArea h="min(24rem, 55dvh)" type="auto" offsetScrollbars>
|
<ScrollArea.Autosize mah="min(24rem, 55dvh)" type="auto" offsetScrollbars>
|
||||||
<Stack gap={3}>
|
<Stack gap={3}>
|
||||||
<ThreadListPrimitive.Items components={{ ThreadListItem }} />
|
<ThreadListPrimitive.Items components={{ ThreadListItem }} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</ScrollArea>
|
</ScrollArea.Autosize>
|
||||||
</Stack>
|
</Stack>
|
||||||
</HistorySelectContext.Provider>
|
</HistorySelectContext.Provider>
|
||||||
);
|
);
|
||||||
@@ -1002,6 +1002,7 @@ const ConversationHistory = () => {
|
|||||||
<Popover
|
<Popover
|
||||||
opened={opened}
|
opened={opened}
|
||||||
onChange={setOpened}
|
onChange={setOpened}
|
||||||
|
onDismiss={() => setOpened(false)}
|
||||||
position="bottom-end"
|
position="bottom-end"
|
||||||
width="min(22rem, calc(100vw - 1rem))"
|
width="min(22rem, calc(100vw - 1rem))"
|
||||||
shadow="md"
|
shadow="md"
|
||||||
@@ -1016,6 +1017,12 @@ const ConversationHistory = () => {
|
|||||||
leftSection={<IconHistory size={16} />}
|
leftSection={<IconHistory size={16} />}
|
||||||
classNames={{ section: classes.historyButtonSection, label: classes.historyButtonLabel }}
|
classNames={{ section: classes.historyButtonSection, label: classes.historyButtonLabel }}
|
||||||
onClick={() => setOpened((current) => !current)}
|
onClick={() => setOpened((current) => !current)}
|
||||||
|
onKeyDown={(event) => {
|
||||||
|
if (event.key === "Escape" && opened) {
|
||||||
|
event.stopPropagation();
|
||||||
|
setOpened(false);
|
||||||
|
}
|
||||||
|
}}
|
||||||
aria-label={opened ? t("closeHistory") : t("openHistory")}
|
aria-label={opened ? t("closeHistory") : t("openHistory")}
|
||||||
>
|
>
|
||||||
{t("conversations")}
|
{t("conversations")}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ const CompactAssistantWidget = ({ onOpen }: { onOpen: () => void }) => {
|
|||||||
<ActionIcon
|
<ActionIcon
|
||||||
variant="light"
|
variant="light"
|
||||||
color="red"
|
color="red"
|
||||||
size="lg"
|
size={44}
|
||||||
radius="md"
|
radius="md"
|
||||||
onClick={onOpen}
|
onClick={onOpen}
|
||||||
aria-label={t("widget.assistant.compact.open")}
|
aria-label={t("widget.assistant.compact.open")}
|
||||||
|
|||||||
@@ -2758,7 +2758,8 @@
|
|||||||
"description": "Custom URLs must resolve to a public IP address. Private and local hosts are rejected."
|
"description": "Custom URLs must resolve to a public IP address. Private and local hosts are rejected."
|
||||||
},
|
},
|
||||||
"station": {
|
"station": {
|
||||||
"label": "Station"
|
"label": "Station",
|
||||||
|
"placeholder": "Search for a station"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
@@ -4887,7 +4888,8 @@
|
|||||||
},
|
},
|
||||||
"conversation": {
|
"conversation": {
|
||||||
"label": "Pinned conversation",
|
"label": "Pinned conversation",
|
||||||
"description": "This selector stays hidden while the widget follows the current conversation."
|
"description": "Choose the saved conversation this widget should keep available.",
|
||||||
|
"placeholder": "Select a saved conversation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pinned": {
|
"pinned": {
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ export const WidgetDynamicSelectInput = ({
|
|||||||
)}
|
)}
|
||||||
searchValue={search}
|
searchValue={search}
|
||||||
onSearchChange={setSearch}
|
onSearchChange={setSearch}
|
||||||
|
placeholder={tWidget("placeholder")}
|
||||||
|
nothingFoundMessage={t("common.noResults")}
|
||||||
leftSection={isPending && <Loader size="xs" />}
|
leftSection={isPending && <Loader size="xs" />}
|
||||||
renderOption={({ option, checked }) => {
|
renderOption={({ option, checked }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in new issue
Block a user