Fix mobile custom widget authoring controls

This commit is contained in:
Thomas Camlong committed 2026-07-21 10:08:17 +02:00
1 parent 49193c37e0
commit 22b6f9ad89
3 files changed
+21 -3

No files matched your search

@@ -20,4 +20,18 @@ describe("Copy AI prompt", () => {
expect(prompt).toContain("exactly one complete `json` fenced block"); expect(prompt).toContain("exactly one complete `json` fenced block");
expect(prompt).toContain("one complete `jsx` fenced block"); expect(prompt).toContain("one complete `jsx` fenced block");
}); });
it("keeps AI actions and section navigation readable on narrow screens", () => {
const card = readFileSync(
`${process.cwd()}/apps/nextjs/src/app/[locale]/manage/custom-widgets/_custom-widget-ai-card.tsx`,
"utf8",
);
const styles = readFileSync(
`${process.cwd()}/apps/nextjs/src/app/[locale]/manage/custom-widgets/_custom-widget-form.module.css`,
"utf8",
);
expect(card).toContain("<SimpleGrid cols={{ base: 1, sm: 2 }}>");
expect(styles).toContain(".sectionNav > a");
expect(styles).toContain("flex: 0 0 auto");
});
}); });
@@ -1,6 +1,6 @@
"use client"; "use client";
import { Button, Card, Group, Stack, Text, TextInput, Textarea } from "@mantine/core"; import { Button, Card, Group, SimpleGrid, Stack, Text, TextInput, Textarea } from "@mantine/core";
import { IconSparkles } from "@tabler/icons-react"; import { IconSparkles } from "@tabler/icons-react";
import type { HomarrCustomWidgetV2 } from "@homarr/custom-widgets/core"; import type { HomarrCustomWidgetV2 } from "@homarr/custom-widgets/core";
@@ -38,7 +38,7 @@ export function CustomWidgetAiCard(props: AiCardProps) {
value={props.documentationUrl} value={props.documentationUrl}
onChange={(event) => props.onDocumentationUrlChange(event.currentTarget.value)} onChange={(event) => props.onDocumentationUrlChange(event.currentTarget.value)}
/> />
<Group grow wrap="wrap"> <SimpleGrid cols={{ base: 1, sm: 2 }}>
<CopyAiPromptButton <CopyAiPromptButton
currentConfig={props.candidate} currentConfig={props.candidate}
request={props.request} request={props.request}
@@ -47,7 +47,7 @@ export function CustomWidgetAiCard(props: AiCardProps) {
<Button type="button" variant="light" leftSection={<IconSparkles size={16} />} onClick={props.onPaste}> <Button type="button" variant="light" leftSection={<IconSparkles size={16} />} onClick={props.onPaste}>
{t("paste")} {t("paste")}
</Button> </Button>
</Group> </SimpleGrid>
</Stack> </Stack>
</Card> </Card>
); );
@@ -17,6 +17,10 @@
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
} }
.sectionNav > a {
flex: 0 0 auto;
}
.editorSection { .editorSection {
scroll-margin-top: 5rem; scroll-margin-top: 5rem;
} }