fix: polish assistant mobile layout
This commit is contained in:
1 parent
4635e3ce4e
commit
ea1e07c74f
2 files changed
+98
-21
No files matched your search
@@ -2,7 +2,7 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 290;
|
z-index: 290;
|
||||||
inset-inline-start: 50%;
|
inset-inline-start: 50%;
|
||||||
bottom: 1rem;
|
bottom: max(1rem, env(safe-area-inset-bottom));
|
||||||
display: flex;
|
display: flex;
|
||||||
width: min(31rem, calc(100vw - 1rem));
|
width: min(31rem, calc(100vw - 1rem));
|
||||||
min-height: 3.5rem;
|
min-height: 3.5rem;
|
||||||
@@ -39,6 +39,11 @@
|
|||||||
color: var(--mantine-color-dimmed);
|
color: var(--mantine-color-dimmed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.activityDismiss {
|
||||||
|
width: 2.5rem;
|
||||||
|
height: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.floatingPanel {
|
.floatingPanel {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 290;
|
z-index: 290;
|
||||||
@@ -68,6 +73,24 @@
|
|||||||
border-bottom: 1px solid var(--mantine-color-default-border);
|
border-bottom: 1px solid var(--mantine-color-default-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.panelIdentity,
|
||||||
|
.panelIdentityText {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panelIdentity {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panelActions {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panelAction {
|
||||||
|
width: 2.625rem;
|
||||||
|
height: 2.625rem;
|
||||||
|
}
|
||||||
|
|
||||||
.historyMenu {
|
.historyMenu {
|
||||||
background: var(--mantine-color-body);
|
background: var(--mantine-color-body);
|
||||||
}
|
}
|
||||||
@@ -90,6 +113,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.viewport {
|
.viewport {
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -186,6 +210,11 @@
|
|||||||
font: inherit;
|
font: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.composerInput::placeholder {
|
||||||
|
color: var(--mantine-color-dimmed);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.empty {
|
.empty {
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 23rem;
|
min-height: 23rem;
|
||||||
@@ -212,10 +241,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.scrollToBottom {
|
.scrollToBottom {
|
||||||
position: absolute;
|
position: sticky;
|
||||||
inset-inline-start: 50%;
|
|
||||||
bottom: 0.75rem;
|
bottom: 0.75rem;
|
||||||
transform: translateX(-50%);
|
z-index: 1;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
align-self: center;
|
||||||
|
margin-top: -2.5rem;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
box-shadow: var(--mantine-shadow-sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes assistant-activity-in {
|
@keyframes assistant-activity-in {
|
||||||
@@ -244,18 +277,34 @@
|
|||||||
|
|
||||||
@media (max-width: 48em) {
|
@media (max-width: 48em) {
|
||||||
.activityBar {
|
.activityBar {
|
||||||
bottom: 0.5rem;
|
bottom: max(0.5rem, env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
.floatingPanel {
|
.floatingPanel {
|
||||||
bottom: 0.5rem;
|
bottom: max(0.5rem, env(safe-area-inset-bottom));
|
||||||
width: calc(100vw - 1rem);
|
width: calc(100vw - 1rem);
|
||||||
height: min(44rem, calc(100dvh - 1rem));
|
height: min(44rem, calc(100dvh - 1rem - env(safe-area-inset-bottom)));
|
||||||
min-height: min(20rem, calc(100dvh - 1rem));
|
min-height: min(20rem, calc(100dvh - 1rem - env(safe-area-inset-bottom)));
|
||||||
}
|
}
|
||||||
|
|
||||||
.panelHeader {
|
.panelHeader {
|
||||||
padding-inline-start: 0.7rem;
|
min-height: 3.5rem;
|
||||||
|
padding: 0.5rem;
|
||||||
|
padding-inline-start: 0.65rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.composerWrap {
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.composer {
|
||||||
|
gap: 0.25rem;
|
||||||
|
padding: 0.25rem 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.composerInput {
|
||||||
|
min-height: 2.625rem;
|
||||||
|
padding: 0.6rem 0.55rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestions {
|
.suggestions {
|
||||||
@@ -263,15 +312,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.empty {
|
.empty {
|
||||||
min-height: 32rem;
|
min-height: 26rem;
|
||||||
padding-block: 1.5rem;
|
padding-block: 1.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 30em) {
|
@media (max-width: 30em) {
|
||||||
.historyButton {
|
.historyButton {
|
||||||
max-width: 2.25rem;
|
width: 2.625rem;
|
||||||
padding-inline: 0.5rem;
|
max-width: 2.625rem;
|
||||||
|
height: 2.625rem;
|
||||||
|
padding-inline: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.historyButtonSection {
|
.historyButtonSection {
|
||||||
@@ -283,7 +334,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.messages {
|
.messages {
|
||||||
padding-inline: 0.75rem;
|
padding: 0.5rem 0.75rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
margin-block: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userMessage {
|
||||||
|
max-width: 92%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ 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)}
|
||||||
|
aria-label={opened ? t("closeHistory") : t("openHistory")}
|
||||||
>
|
>
|
||||||
{t("conversations")}
|
{t("conversations")}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -489,7 +490,13 @@ const AssistantActivityBar = ({
|
|||||||
</Group>
|
</Group>
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
{!isRunning && !needsApproval && (
|
{!isRunning && !needsApproval && (
|
||||||
<ActionIcon variant="subtle" color="gray" size="sm" onClick={onMarkRead} aria-label={t("activity.dismiss")}>
|
<ActionIcon
|
||||||
|
className={classes.activityDismiss}
|
||||||
|
variant="subtle"
|
||||||
|
color="gray"
|
||||||
|
onClick={onMarkRead}
|
||||||
|
aria-label={t("activity.dismiss")}
|
||||||
|
>
|
||||||
<IconX size={15} />
|
<IconX size={15} />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
)}
|
)}
|
||||||
@@ -529,13 +536,13 @@ export const AssistantPanel = ({
|
|||||||
)}
|
)}
|
||||||
{opened && (
|
{opened && (
|
||||||
<dialog className={classes.floatingPanel} aria-label={t("title")} open>
|
<dialog className={classes.floatingPanel} aria-label={t("title")} open>
|
||||||
<Group className={classes.panelHeader} justify="space-between" wrap="nowrap">
|
<Group className={classes.panelHeader} justify="space-between" wrap="nowrap" gap="xs">
|
||||||
<Group gap="xs" wrap="nowrap">
|
<Group className={classes.panelIdentity} gap="xs" wrap="nowrap">
|
||||||
<ThemeIcon variant="light" color="red" radius="xl">
|
<ThemeIcon variant="light" color="red" radius="xl">
|
||||||
<IconRobot size={18} />
|
<IconRobot size={18} />
|
||||||
</ThemeIcon>
|
</ThemeIcon>
|
||||||
<div>
|
<div className={classes.panelIdentityText}>
|
||||||
<Text fw={700} lh={1.1}>
|
<Text fw={700} lh={1.1} lineClamp={1}>
|
||||||
{t("title")}
|
{t("title")}
|
||||||
</Text>
|
</Text>
|
||||||
<Text size="xs" c="dimmed" lineClamp={1}>
|
<Text size="xs" c="dimmed" lineClamp={1}>
|
||||||
@@ -543,16 +550,27 @@ export const AssistantPanel = ({
|
|||||||
</Text>
|
</Text>
|
||||||
</div>
|
</div>
|
||||||
</Group>
|
</Group>
|
||||||
<Group gap={2} wrap="nowrap">
|
<Group className={classes.panelActions} gap={2} wrap="nowrap">
|
||||||
<ConversationHistory />
|
<ConversationHistory />
|
||||||
<Tooltip label={t("newConversation")}>
|
<Tooltip label={t("newConversation")}>
|
||||||
<ThreadListPrimitive.New asChild>
|
<ThreadListPrimitive.New asChild>
|
||||||
<ActionIcon variant="subtle" color="gray" aria-label={t("newConversation")}>
|
<ActionIcon
|
||||||
|
className={classes.panelAction}
|
||||||
|
variant="subtle"
|
||||||
|
color="gray"
|
||||||
|
aria-label={t("newConversation")}
|
||||||
|
>
|
||||||
<IconPlus size={17} />
|
<IconPlus size={17} />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</ThreadListPrimitive.New>
|
</ThreadListPrimitive.New>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<ActionIcon variant="subtle" color="gray" onClick={onClose} aria-label={t("close")}>
|
<ActionIcon
|
||||||
|
className={classes.panelAction}
|
||||||
|
variant="subtle"
|
||||||
|
color="gray"
|
||||||
|
onClick={onClose}
|
||||||
|
aria-label={t("close")}
|
||||||
|
>
|
||||||
<IconX size={18} />
|
<IconX size={18} />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
Reference in new issue
Block a user