feat(onboarding): polish setup experience
This commit is contained in:
1 parent
f4891447d3
commit
4ca02a9133
34 files changed
+1005
-1172
No files matched your search
@@ -534,8 +534,8 @@ export const assistantRouter = createTRPCRouter({
|
||||
connectionConfigured: Boolean(configuration),
|
||||
enabled: configuration?.enabled ?? false,
|
||||
webSearchEnabled: configuration?.webSearchEnabled ?? false,
|
||||
provider: configuration?.provider ?? "openrouter",
|
||||
baseUrl: configuration?.baseUrl ?? "https://openrouter.ai/api/v1",
|
||||
provider: configuration?.provider ?? "homarr",
|
||||
baseUrl: configuration?.baseUrl ?? getHomarrProviderBaseUrl(),
|
||||
modelDiscoveryPath: configuration?.modelDiscoveryPath ?? "/models",
|
||||
apiKeyConfigured: Boolean(configuration?.encryptedApiKey),
|
||||
customHeadersConfigured: Boolean(configuration?.encryptedHeaders),
|
||||
|
||||
@@ -585,7 +585,7 @@ export const onboardRouter = createTRPCRouter({
|
||||
);
|
||||
let leftGutterColumnCount = requestedGutters.left;
|
||||
let rightGutterColumnCount = requestedGutters.right;
|
||||
const desiredColumns = getLayoutPresetColumnCount(input.board.layoutPreset);
|
||||
const desiredColumns = input.board.columnCount ?? getLayoutPresetColumnCount(input.board.layoutPreset);
|
||||
if (requiredColumns + leftGutterColumnCount + rightGutterColumnCount > 24) rightGutterColumnCount = 0;
|
||||
if (requiredColumns + leftGutterColumnCount + rightGutterColumnCount > 24) leftGutterColumnCount = 0;
|
||||
const baseColumnCount = Math.min(
|
||||
|
||||
@@ -59,6 +59,18 @@ const createConfiguredAssistantAsync = async () => {
|
||||
return db;
|
||||
};
|
||||
|
||||
describe("assistantRouter.getAdminConfiguration", () => {
|
||||
test("defaults an unconfigured Assistant to the Homarr provider", async () => {
|
||||
const caller = assistantRouter.createCaller({ db: createDb(), deviceType: undefined, session: adminSession });
|
||||
|
||||
await expect(caller.getAdminConfiguration()).resolves.toMatchObject({
|
||||
connectionConfigured: false,
|
||||
provider: "homarr",
|
||||
baseUrl: "https://homarr.dev/api/ai/v1",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("assistantRouter.updateConnection", () => {
|
||||
test("clears the persisted model when the discovery path changes without clearing credentials", async () => {
|
||||
const db = await createConfiguredAssistantAsync();
|
||||
|
||||
@@ -307,6 +307,7 @@ describe("onboard.completeSetup", () => {
|
||||
...completionInput("missing").board,
|
||||
id: undefined,
|
||||
name: "Recovered-board",
|
||||
columnCount: 14,
|
||||
leftSidebar: true,
|
||||
rightSidebar: true,
|
||||
},
|
||||
@@ -328,7 +329,7 @@ describe("onboard.completeSetup", () => {
|
||||
expect.objectContaining({ role: "mobile", columnCount: 3, breakpoint: 0 }),
|
||||
expect.objectContaining({
|
||||
role: "base",
|
||||
columnCount: 10,
|
||||
columnCount: 14,
|
||||
breakpoint: 768,
|
||||
leftGutterColumnCount: 1,
|
||||
rightGutterColumnCount: 1,
|
||||
|
||||
@@ -15,7 +15,7 @@ export const assistantProviderIds = [
|
||||
] as const;
|
||||
|
||||
export type AssistantProvider = (typeof assistantProviderIds)[number];
|
||||
export type AssistantProviderCategory = "hosted" | "local" | "custom";
|
||||
export type AssistantProviderCategory = "free" | "hosted" | "local" | "custom";
|
||||
export const assistantHomarrProviderTokenHeader = "X-Homarr-Provider-Token";
|
||||
|
||||
export const assistantReasoningModes = ["auto", "none", "minimal", "low", "medium", "high"] as const;
|
||||
@@ -50,7 +50,7 @@ export const assistantProviderPresets = {
|
||||
baseUrl: "https://homarr.dev/api/ai/v1",
|
||||
modelDiscoveryPath: "/models",
|
||||
requiresApiKey: false,
|
||||
category: "hosted",
|
||||
category: "free",
|
||||
discoveryAuthentication: "bearer",
|
||||
iconUrl: "https://homarr.dev/img/logo.png",
|
||||
},
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
"@mantine/core": "catalog:",
|
||||
"@mantine/hooks": "catalog:",
|
||||
"@tabler/icons-react": "catalog:",
|
||||
"motion": "catalog:",
|
||||
"react": "catalog:",
|
||||
"zod": "catalog:"
|
||||
},
|
||||
|
||||
@@ -126,6 +126,9 @@ const CredentialsSetup = () => {
|
||||
passwordInputProps={{ ...form.getInputProps("password"), autoComplete: "new-password" }}
|
||||
confirmPasswordInputProps={{ ...form.getInputProps("confirmPassword"), autoComplete: "new-password" }}
|
||||
/>
|
||||
<Text size="sm" c="dimmed" my="xs">
|
||||
{t("passwordHint")}
|
||||
</Text>
|
||||
{submitError ? (
|
||||
<Alert color="red" title={t("errorTitle")}>
|
||||
{submitError}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { isHttpUrl, normalizeServiceUrl, resolveDiscoveredAppUrl, takeNewSourceIds } from "./discovery-selection";
|
||||
import {
|
||||
isHttpUrl,
|
||||
normalizeServiceUrl,
|
||||
resolveDiscoveredAppUrl,
|
||||
resolveIntegrationDraftUrl,
|
||||
takeNewSourceIds,
|
||||
} from "./discovery-selection";
|
||||
|
||||
describe("takeNewSourceIds", () => {
|
||||
it("keeps same-kind service instances independent and does not reselect them after refresh", () => {
|
||||
@@ -22,6 +28,25 @@ describe("takeNewSourceIds", () => {
|
||||
expect(resolveDiscoveredAppUrl(undefined, null, null)).toBe("");
|
||||
});
|
||||
|
||||
it("regenerates integration URLs from the usual server address without replacing manual edits", () => {
|
||||
expect(
|
||||
resolveIntegrationDraftUrl({
|
||||
currentUrl: "http://docker-host:8989",
|
||||
overridden: false,
|
||||
serverUrl: "http://home.lan:8989",
|
||||
fallbackUrl: "http://docker-host:8989",
|
||||
}),
|
||||
).toBe("http://home.lan:8989");
|
||||
expect(
|
||||
resolveIntegrationDraftUrl({
|
||||
currentUrl: "https://sonarr.custom.example",
|
||||
overridden: true,
|
||||
serverUrl: "http://home.lan:8989",
|
||||
fallbackUrl: "http://docker-host:8989",
|
||||
}),
|
||||
).toBe("https://sonarr.custom.example");
|
||||
});
|
||||
|
||||
it("normalizes HTTP, HTTPS, and bare self-hosted service addresses", () => {
|
||||
expect(isHttpUrl("http://home.lan:8989")).toBe(true);
|
||||
expect(isHttpUrl("https://home.example/sonarr")).toBe(true);
|
||||
|
||||
@@ -11,6 +11,18 @@ export const resolveDiscoveredAppUrl = (
|
||||
generatedUrl: string | null,
|
||||
) => override ?? suggestedUrl ?? generatedUrl ?? "";
|
||||
|
||||
export const resolveIntegrationDraftUrl = ({
|
||||
currentUrl,
|
||||
overridden,
|
||||
serverUrl,
|
||||
fallbackUrl,
|
||||
}: {
|
||||
currentUrl: string;
|
||||
overridden: boolean;
|
||||
serverUrl: string | null;
|
||||
fallbackUrl: string | null;
|
||||
}) => (overridden ? currentUrl : serverUrl || fallbackUrl || "");
|
||||
|
||||
export const normalizeServiceUrl = (value: string) => {
|
||||
try {
|
||||
const trimmed = value.trim();
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { Alert, Button, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title } from "@mantine/core";
|
||||
import { IconArrowRight, IconBook2, IconLayoutDashboard, IconSparkles, IconTool } from "@tabler/icons-react";
|
||||
import { motion, useReducedMotion } from "motion/react";
|
||||
import { Button, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title } from "@mantine/core";
|
||||
import { IconArrowRight, IconBook2, IconSparkles, IconTool } from "@tabler/icons-react";
|
||||
|
||||
import { createDocumentationLink } from "@homarr/definitions";
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
@@ -13,7 +12,6 @@ import classes from "./onboarding-studio.module.css";
|
||||
|
||||
export const Finish = ({ environment }: OnboardingStudioProps) => {
|
||||
const t = useScopedI18n("init.studio.finish");
|
||||
const reduceMotion = useReducedMotion();
|
||||
const boardHref = `/boards/${encodeURIComponent(environment.initialBoard?.name ?? "dashboard")}`;
|
||||
const destination = environment.canConfigurePrivileged ? boardHref : "/auth/login?callbackUrl=%2Finit";
|
||||
|
||||
@@ -21,22 +19,14 @@ export const Finish = ({ environment }: OnboardingStudioProps) => {
|
||||
<main className={classes.page}>
|
||||
<div className={classes.shell}>
|
||||
<Stack mih="calc(100dvh - 6rem)" justify="center" align="center">
|
||||
<motion.div
|
||||
initial={reduceMotion ? false : { opacity: 0, y: 22, scale: 0.97 }}
|
||||
animate={{ opacity: 1, y: 0, scale: 1 }}
|
||||
transition={{ duration: 0.4 }}
|
||||
style={{ width: "100%", maxWidth: "52rem" }}
|
||||
>
|
||||
<div style={{ width: "100%", maxWidth: "52rem" }}>
|
||||
<Paper className={classes.studio} radius="lg" p={{ base: "lg", sm: "xl" }}>
|
||||
<Stack gap="xl" align="center">
|
||||
<motion.div
|
||||
animate={reduceMotion ? undefined : { rotate: [0, 7, -7, 0], scale: [1, 1.08, 1] }}
|
||||
transition={{ duration: 2.8, repeat: Infinity, repeatDelay: 1.4 }}
|
||||
>
|
||||
<div>
|
||||
<ThemeIcon size={78} radius="xl" variant="light" color="green">
|
||||
<IconSparkles size={36} />
|
||||
</ThemeIcon>
|
||||
</motion.div>
|
||||
</div>
|
||||
<Stack gap="xs" align="center">
|
||||
<Title ta="center">{t("title")}</Title>
|
||||
<Text c="dimmed" ta="center" maw="42rem">
|
||||
@@ -46,9 +36,6 @@ export const Finish = ({ environment }: OnboardingStudioProps) => {
|
||||
<Button component={Link} href={destination} size="lg" rightSection={<IconArrowRight size={18} />}>
|
||||
{t("openBoard")}
|
||||
</Button>
|
||||
<Alert variant="light" w="100%" icon={<IconLayoutDashboard size={18} />}>
|
||||
{t("tutorial")}
|
||||
</Alert>
|
||||
<SimpleGrid cols={{ base: 1, sm: 3 }} w="100%">
|
||||
<NextCard
|
||||
icon={IconTool}
|
||||
@@ -72,7 +59,7 @@ export const Finish = ({ environment }: OnboardingStudioProps) => {
|
||||
</SimpleGrid>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</motion.div>
|
||||
</div>
|
||||
</Stack>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
.page {
|
||||
--studio-surface: color-mix(in srgb, var(--mantine-color-body) 92%, transparent);
|
||||
--studio-glow-color: var(--mantine-primary-color-filled);
|
||||
--studio-secondary-glow-color: var(--mantine-color-orange-6);
|
||||
min-height: 100dvh;
|
||||
overflow-x: clip;
|
||||
position: relative;
|
||||
background:
|
||||
radial-gradient(
|
||||
circle at 10% 10%,
|
||||
color-mix(in srgb, var(--mantine-primary-color-filled) 14%, transparent),
|
||||
color-mix(in srgb, var(--studio-glow-color) 14%, transparent),
|
||||
transparent 34rem
|
||||
),
|
||||
radial-gradient(
|
||||
circle at 90% 5%,
|
||||
color-mix(in srgb, var(--mantine-color-orange-6) 10%, transparent),
|
||||
color-mix(in srgb, var(--studio-secondary-glow-color) 10%, transparent),
|
||||
transparent 30rem
|
||||
),
|
||||
var(--mantine-color-body);
|
||||
@@ -20,19 +22,22 @@
|
||||
.page::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
inset: -2rem;
|
||||
pointer-events: none;
|
||||
opacity: 0.22;
|
||||
background-image: radial-gradient(circle, var(--mantine-color-dimmed) 0.7px, transparent 0.7px);
|
||||
background-size: 24px 24px;
|
||||
mask-image: linear-gradient(to bottom, black, transparent 75%);
|
||||
opacity: 0.28;
|
||||
background-image:
|
||||
linear-gradient(color-mix(in srgb, var(--mantine-color-dimmed) 28%, transparent) 1px, transparent 1px),
|
||||
linear-gradient(90deg, color-mix(in srgb, var(--mantine-color-dimmed) 28%, transparent) 1px, transparent 1px);
|
||||
background-size: 32px 32px;
|
||||
filter: blur(0.35px);
|
||||
mask-image: radial-gradient(ellipse 66% 86% at center, transparent 22%, black 88%);
|
||||
}
|
||||
|
||||
.shell {
|
||||
position: relative;
|
||||
width: min(100% - 2rem, 76rem);
|
||||
margin-inline: auto;
|
||||
padding-block: clamp(1rem, 3vw, 2.5rem) 5rem;
|
||||
padding-block: clamp(1rem, 3vw, 2.5rem) calc(6rem + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.topbar {
|
||||
@@ -42,31 +47,33 @@
|
||||
|
||||
.wordmark {
|
||||
display: block;
|
||||
width: clamp(9.5rem, 22vw, 14rem);
|
||||
height: auto;
|
||||
padding: 0.4rem 0.55rem;
|
||||
border-radius: var(--mantine-radius-md);
|
||||
background: rgba(12, 12, 14, 0.86);
|
||||
filter: drop-shadow(0 0.8rem 1.6rem color-mix(in srgb, black 22%, transparent));
|
||||
width: auto;
|
||||
height: 3.5rem;
|
||||
}
|
||||
|
||||
.onboardingWordmark {
|
||||
height: clamp(5rem, 12vw, 7rem);
|
||||
max-width: min(70vw, 28rem);
|
||||
}
|
||||
|
||||
:global([data-mantine-color-scheme="light"]) .wordmark {
|
||||
filter: brightness(0);
|
||||
}
|
||||
|
||||
.hero {
|
||||
min-height: calc(100dvh - 8rem);
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
|
||||
align-items: center;
|
||||
gap: clamp(2rem, 6vw, 6rem);
|
||||
margin-inline: auto;
|
||||
max-width: 42rem;
|
||||
padding-block: 5rem 3rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.heroTitle {
|
||||
font-size: clamp(2.5rem, 7vw, 5.8rem);
|
||||
line-height: 0.94;
|
||||
letter-spacing: -0.04em;
|
||||
font-size: 3.5rem;
|
||||
line-height: 1.05;
|
||||
letter-spacing: -0.03em;
|
||||
text-wrap: balance;
|
||||
max-width: 11ch;
|
||||
}
|
||||
|
||||
.heroPanel,
|
||||
.studio {
|
||||
background: var(--studio-surface);
|
||||
backdrop-filter: blur(18px);
|
||||
@@ -74,54 +81,13 @@
|
||||
box-shadow: var(--mantine-shadow-sm);
|
||||
}
|
||||
|
||||
.heroPanel {
|
||||
position: relative;
|
||||
min-height: 27rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.orbit {
|
||||
position: absolute;
|
||||
inset: 50% auto auto 50%;
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
margin: -9rem;
|
||||
border-radius: 50%;
|
||||
border: 1px solid color-mix(in srgb, var(--mantine-primary-color-filled) 35%, transparent);
|
||||
}
|
||||
|
||||
.orbitItem {
|
||||
position: absolute;
|
||||
width: 3.25rem;
|
||||
height: 3.25rem;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border-radius: var(--mantine-radius-lg);
|
||||
background: var(--mantine-color-body);
|
||||
border: 1px solid var(--mantine-color-default-border);
|
||||
box-shadow: var(--mantine-shadow-md);
|
||||
}
|
||||
|
||||
.orbitItem:nth-child(1) {
|
||||
inset: -1.6rem auto auto calc(50% - 1.6rem);
|
||||
}
|
||||
.orbitItem:nth-child(2) {
|
||||
inset: calc(50% - 1.6rem) -1.6rem auto auto;
|
||||
}
|
||||
.orbitItem:nth-child(3) {
|
||||
inset: auto auto -1.6rem calc(50% - 1.6rem);
|
||||
}
|
||||
.orbitItem:nth-child(4) {
|
||||
inset: calc(50% - 1.6rem) auto auto -1.6rem;
|
||||
}
|
||||
|
||||
.studio {
|
||||
overflow: clip;
|
||||
}
|
||||
|
||||
.studioGrid {
|
||||
display: grid;
|
||||
grid-template-columns: 17rem minmax(0, 1fr);
|
||||
grid-template-columns: 15rem minmax(0, 1fr);
|
||||
min-height: 40rem;
|
||||
}
|
||||
|
||||
@@ -131,30 +97,38 @@
|
||||
background: color-mix(in srgb, var(--mantine-color-default) 40%, transparent);
|
||||
}
|
||||
|
||||
.railButton {
|
||||
.timeline {
|
||||
width: 100%;
|
||||
min-height: 3.25rem;
|
||||
padding: 0.65rem 0.75rem;
|
||||
}
|
||||
|
||||
.timelineBullet {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.timelineButton {
|
||||
width: calc(100% + 2.75rem);
|
||||
min-height: 2.75rem;
|
||||
margin-inline-start: -2.75rem;
|
||||
padding: 0.15rem 0.25rem;
|
||||
padding-inline-start: 2.75rem;
|
||||
border-radius: var(--mantine-radius-md);
|
||||
color: var(--mantine-color-dimmed);
|
||||
transition:
|
||||
background-color 150ms ease,
|
||||
color 150ms ease,
|
||||
transform 150ms ease;
|
||||
}
|
||||
|
||||
.railButton[data-active="true"] {
|
||||
.timelineButton[data-active="true"] {
|
||||
color: var(--mantine-color-text);
|
||||
background: var(--mantine-color-default-hover);
|
||||
}
|
||||
|
||||
.railButton:focus-visible {
|
||||
.timelineButton:focus-visible {
|
||||
outline: 2px solid var(--mantine-primary-color-filled);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
min-height: 100%;
|
||||
padding: clamp(1rem, 3vw, 2rem);
|
||||
}
|
||||
|
||||
@@ -163,12 +137,6 @@
|
||||
border: 1px solid color-mix(in srgb, var(--mantine-color-default-border) 76%, transparent);
|
||||
}
|
||||
|
||||
.discoveryChoice {
|
||||
transition:
|
||||
border-color 150ms ease,
|
||||
background-color 150ms ease;
|
||||
}
|
||||
|
||||
.discoveryChoice[data-checked] {
|
||||
border-color: var(--mantine-primary-color-filled);
|
||||
background: color-mix(in srgb, var(--mantine-primary-color-light) 62%, var(--mantine-color-body));
|
||||
@@ -179,6 +147,10 @@
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.integrationStatus {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.choiceGrid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
@@ -192,10 +164,6 @@
|
||||
border: 1px solid var(--mantine-color-default-border);
|
||||
background: var(--mantine-color-body);
|
||||
padding: var(--mantine-spacing-md);
|
||||
transition:
|
||||
border-color 150ms ease,
|
||||
background-color 150ms ease,
|
||||
transform 150ms ease;
|
||||
}
|
||||
|
||||
.choice[data-selected="true"] {
|
||||
@@ -203,10 +171,6 @@
|
||||
background: color-mix(in srgb, var(--mantine-primary-color-light) 70%, var(--mantine-color-body));
|
||||
}
|
||||
|
||||
.choice:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.choice:focus-visible {
|
||||
outline: 3px solid var(--mantine-primary-color-light-color);
|
||||
outline-offset: 2px;
|
||||
@@ -220,21 +184,15 @@
|
||||
padding: 0.6rem;
|
||||
overflow: hidden;
|
||||
border-radius: var(--mantine-radius-lg);
|
||||
background: color-mix(in srgb, var(--mantine-color-default) 66%, transparent);
|
||||
background: var(--mantine-color-default);
|
||||
border: 1px solid var(--mantine-color-default-border);
|
||||
}
|
||||
|
||||
.preview[data-layout-role="mobile"] {
|
||||
width: min(100%, 28rem);
|
||||
margin-inline: auto;
|
||||
aspect-ratio: 4 / 3;
|
||||
}
|
||||
|
||||
.previewLane {
|
||||
min-width: 0;
|
||||
border-radius: calc(var(--mantine-radius-lg) * 0.65);
|
||||
background: color-mix(in srgb, var(--mantine-color-body) 88%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--mantine-color-default-border) 70%, transparent);
|
||||
background: var(--mantine-color-body);
|
||||
border: 1px solid var(--mantine-color-default-border);
|
||||
padding: 0.35rem;
|
||||
}
|
||||
|
||||
@@ -248,62 +206,28 @@
|
||||
|
||||
.previewTile {
|
||||
border-radius: calc(var(--mantine-radius-lg) * 0.45);
|
||||
background: linear-gradient(
|
||||
135deg,
|
||||
var(--mantine-primary-color-light),
|
||||
color-mix(in srgb, var(--mantine-color-orange-light) 60%, transparent)
|
||||
);
|
||||
border: 1px solid color-mix(in srgb, var(--mantine-primary-color-filled) 22%, transparent);
|
||||
}
|
||||
|
||||
.assistantStage {
|
||||
position: relative;
|
||||
min-height: 13rem;
|
||||
overflow: hidden;
|
||||
border-radius: var(--mantine-radius-lg);
|
||||
background: color-mix(in srgb, var(--mantine-primary-color-light) 44%, var(--mantine-color-body));
|
||||
}
|
||||
|
||||
.assistantGlow {
|
||||
position: absolute;
|
||||
inset: 50% auto auto 50%;
|
||||
width: 12rem;
|
||||
height: 12rem;
|
||||
margin: -6rem;
|
||||
border-radius: 50%;
|
||||
background: radial-gradient(
|
||||
circle,
|
||||
color-mix(in srgb, var(--mantine-primary-color-filled) 35%, transparent),
|
||||
transparent 68%
|
||||
);
|
||||
background: var(--mantine-color-default);
|
||||
border: 1px solid var(--mantine-color-default-border);
|
||||
}
|
||||
|
||||
.stickyActions {
|
||||
position: sticky;
|
||||
z-index: 2;
|
||||
bottom: 0;
|
||||
margin: 1.5rem -2rem -2rem;
|
||||
margin: auto -2rem -2rem;
|
||||
padding: 1rem 2rem;
|
||||
background: color-mix(in srgb, var(--mantine-color-body) 92%, transparent);
|
||||
border-top: 1px solid var(--mantine-color-default-border);
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.applyError {
|
||||
margin-top: var(--mantine-spacing-lg);
|
||||
}
|
||||
|
||||
.nextCard {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
transition:
|
||||
background-color 150ms ease,
|
||||
transform 150ms ease;
|
||||
}
|
||||
|
||||
.nextCard:hover {
|
||||
background: var(--mantine-color-default-hover);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.nextCard:focus-visible {
|
||||
@@ -312,12 +236,54 @@
|
||||
}
|
||||
|
||||
.content :global(.mantine-Button-root),
|
||||
.content :global(.mantine-SegmentedControl-label),
|
||||
.page :global(.mantine-Input-input),
|
||||
.page :global(.mantine-Tabs-tab) {
|
||||
min-height: 2.75rem;
|
||||
}
|
||||
|
||||
.floatingControlScroller {
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.floatingControlRoot {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: max-content;
|
||||
min-width: 100%;
|
||||
padding: 0.2rem;
|
||||
border-radius: var(--mantine-radius-md);
|
||||
background: var(--mantine-color-default);
|
||||
}
|
||||
|
||||
.floatingControlIndicator {
|
||||
border: 1px solid var(--mantine-color-default-border);
|
||||
border-radius: calc(var(--mantine-radius-md) - 0.2rem);
|
||||
background: var(--mantine-color-body);
|
||||
box-shadow: var(--mantine-shadow-xs);
|
||||
}
|
||||
|
||||
.floatingControl {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
flex: 1 0 auto;
|
||||
min-height: 2.25rem;
|
||||
padding-inline: var(--mantine-spacing-sm);
|
||||
border-radius: calc(var(--mantine-radius-md) - 0.2rem);
|
||||
color: var(--mantine-color-dimmed);
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.floatingControl[data-active="true"] {
|
||||
color: var(--mantine-color-text);
|
||||
}
|
||||
|
||||
.floatingControl:focus-visible {
|
||||
outline: 2px solid var(--mantine-primary-color-filled);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.page :global(.mantine-Switch-body) {
|
||||
min-height: 2.75rem;
|
||||
align-items: center;
|
||||
@@ -325,32 +291,15 @@
|
||||
|
||||
@media (max-width: 62em) {
|
||||
.hero {
|
||||
grid-template-columns: 1fr;
|
||||
padding-block: 3rem;
|
||||
}
|
||||
|
||||
.heroPanel {
|
||||
min-height: 22rem;
|
||||
}
|
||||
|
||||
.studioGrid {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-columns: 12rem minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.rail {
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid var(--mantine-color-default-border);
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.railList {
|
||||
min-width: max-content;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.railButton {
|
||||
width: auto;
|
||||
min-width: 10rem;
|
||||
padding-inline: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +309,7 @@
|
||||
}
|
||||
|
||||
.heroTitle {
|
||||
font-size: clamp(2.35rem, 14vw, 4.5rem);
|
||||
font-size: 2.75rem;
|
||||
}
|
||||
|
||||
.choiceGrid {
|
||||
@@ -371,8 +320,25 @@
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.studioGrid {
|
||||
grid-template-columns: 3.75rem minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.rail {
|
||||
padding: 1rem 0.5rem;
|
||||
}
|
||||
|
||||
.timelineLabel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.timelineButton {
|
||||
min-height: 2rem;
|
||||
padding-inline-start: 2.75rem;
|
||||
}
|
||||
|
||||
.stickyActions {
|
||||
margin: 1rem -1rem -1rem;
|
||||
margin: auto -1rem -1rem;
|
||||
padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
@@ -384,10 +350,6 @@
|
||||
flex: 1 1 12rem;
|
||||
}
|
||||
|
||||
.content :global(.mantine-SegmentedControl-root) {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.content :global(.mantine-Tabs-list) {
|
||||
flex-wrap: nowrap;
|
||||
overflow-x: auto;
|
||||
@@ -406,31 +368,13 @@
|
||||
}
|
||||
|
||||
.wordmark {
|
||||
width: 9.5rem;
|
||||
height: 3rem;
|
||||
}
|
||||
|
||||
.hero {
|
||||
min-height: auto;
|
||||
gap: 2rem;
|
||||
padding-block: 2rem 3rem;
|
||||
}
|
||||
|
||||
.heroPanel {
|
||||
min-height: 19rem;
|
||||
}
|
||||
|
||||
.orbit {
|
||||
scale: 0.78;
|
||||
}
|
||||
|
||||
.rail {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
||||
.railButton {
|
||||
min-width: 8.5rem;
|
||||
}
|
||||
|
||||
.stickyActions {
|
||||
gap: var(--mantine-spacing-xs);
|
||||
}
|
||||
@@ -459,12 +403,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.fastAction {
|
||||
flex: 1.15 1 0;
|
||||
min-width: 0;
|
||||
padding-inline: 0.25rem;
|
||||
}
|
||||
|
||||
.primaryActions > :global(.mantine-Button-root):last-child {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
@@ -475,36 +413,20 @@
|
||||
font-size: var(--mantine-font-size-sm);
|
||||
}
|
||||
|
||||
.content :global(.mantine-SegmentedControl-label) {
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
padding: 0.45rem 0.3rem;
|
||||
line-height: 1.15;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.sectionCard :global(.mantine-Group-root) {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.page {
|
||||
scroll-behavior: auto;
|
||||
.page * {
|
||||
animation: none !important;
|
||||
}
|
||||
|
||||
.choice,
|
||||
.railButton,
|
||||
.nextCard,
|
||||
.discoveryChoice {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.choice:hover {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.nextCard:hover {
|
||||
transform: none;
|
||||
.page *:not(.integrationAccordion *),
|
||||
.page *:not(.integrationAccordion *)::before,
|
||||
.page *:not(.integrationAccordion *)::after {
|
||||
transition: none !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { Alert, Button, Center, Loader, Paper, Stack, Text, Title } from "@mantine/core";
|
||||
import { Alert, Button, Center, Paper, Stack, Text, Title } from "@mantine/core";
|
||||
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
import { Link } from "@homarr/ui";
|
||||
@@ -61,7 +61,6 @@ export const OnboardingStudio = (props: OnboardingStudioProps) => {
|
||||
<Center mih="100dvh" p="md">
|
||||
<Paper withBorder radius="lg" p="xl" maw="32rem" w="100%">
|
||||
<Stack align="center">
|
||||
{claimState === "checking" ? <Loader aria-label={t("checking")} /> : null}
|
||||
<Title order={1} size="h2" ta="center">
|
||||
{claimState === "checking"
|
||||
? t("checkingTitle")
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import classes from "./onboarding-studio.module.css";
|
||||
|
||||
export const OnboardingWordmark = () => (
|
||||
<img
|
||||
src="/logo/homarr-wordmark-light.svg"
|
||||
alt="Homarr"
|
||||
className={`${classes.wordmark} ${classes.onboardingWordmark}`}
|
||||
/>
|
||||
);
|
||||
File diff suppressed because it is too large.
Load diff
@@ -20,4 +20,5 @@ export interface OnboardingEnvironment {
|
||||
export interface OnboardingStudioProps {
|
||||
environment: OnboardingEnvironment;
|
||||
sqliteRestore?: ReactNode;
|
||||
assistantConfiguration?: ReactNode;
|
||||
}
|
||||
@@ -2,21 +2,20 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { Alert, Badge, Button, Group, Paper, Stack, Text, ThemeIcon, Title } from "@mantine/core";
|
||||
import { IconArrowRight, IconDatabaseImport, IconLayoutDashboard, IconSparkles } from "@tabler/icons-react";
|
||||
import { motion, useReducedMotion } from "motion/react";
|
||||
import { IconArrowRight, IconDatabaseImport } from "@tabler/icons-react";
|
||||
|
||||
import { clientApi } from "@homarr/api/client";
|
||||
import { revalidatePathActionAsync } from "@homarr/common/client";
|
||||
import { showErrorNotification } from "@homarr/notifications";
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
|
||||
import { OnboardingWordmark } from "./onboarding-wordmark";
|
||||
import type { OnboardingStudioProps } from "./types";
|
||||
import classes from "./onboarding-studio.module.css";
|
||||
|
||||
export const Welcome = ({ environment, sqliteRestore }: OnboardingStudioProps) => {
|
||||
const t = useScopedI18n("init.studio.welcome");
|
||||
const claimT = useScopedI18n("init.studio.claim");
|
||||
const reduceMotion = useReducedMotion();
|
||||
const [showRestore, setShowRestore] = useState(false);
|
||||
const [claimPending, setClaimPending] = useState(false);
|
||||
const [claimError, setClaimError] = useState<string | null>(null);
|
||||
@@ -78,29 +77,19 @@ export const Welcome = ({ environment, sqliteRestore }: OnboardingStudioProps) =
|
||||
<main className={classes.page}>
|
||||
<div className={classes.shell}>
|
||||
<Group className={classes.topbar} justify="space-between">
|
||||
<motion.img
|
||||
src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/homarr-wordmark-light.svg"
|
||||
alt="Homarr"
|
||||
className={classes.wordmark}
|
||||
initial={reduceMotion ? false : { opacity: 0, y: -10 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.45 }}
|
||||
/>
|
||||
<OnboardingWordmark />
|
||||
<Badge variant="light" size="lg">
|
||||
{t("badge")}
|
||||
</Badge>
|
||||
</Group>
|
||||
|
||||
<section className={classes.hero} aria-labelledby="onboarding-welcome-title">
|
||||
<Stack gap="xl" align="flex-start">
|
||||
<Stack gap="md">
|
||||
<Text c="dimmed" fw={650} size="sm">
|
||||
{t("eyebrow")}
|
||||
</Text>
|
||||
<Title id="onboarding-welcome-title" className={classes.heroTitle}>
|
||||
<Stack gap="xl" align="center">
|
||||
<Stack gap="sm" align="center">
|
||||
<Title id="onboarding-welcome-title" className={classes.heroTitle} ta="center">
|
||||
{t("title")}
|
||||
</Title>
|
||||
<Text size="lg" c="dimmed" maw="38rem">
|
||||
<Text size="lg" c="dimmed" maw="38rem" ta="center">
|
||||
{t("description")}
|
||||
</Text>
|
||||
</Stack>
|
||||
@@ -152,48 +141,6 @@ export const Welcome = ({ environment, sqliteRestore }: OnboardingStudioProps) =
|
||||
</Alert>
|
||||
) : null}
|
||||
</Stack>
|
||||
|
||||
<motion.div
|
||||
initial={reduceMotion ? false : { opacity: 0, scale: 0.96, y: 24 }}
|
||||
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||
transition={{ duration: 0.55, delay: 0.08 }}
|
||||
>
|
||||
<Paper className={classes.heroPanel} radius="lg" p="xl">
|
||||
<div className={classes.orbit} aria-hidden>
|
||||
{[IconLayoutDashboard, IconSparkles, IconDatabaseImport, IconLayoutDashboard].map((Icon, index) => (
|
||||
<motion.div
|
||||
key={index}
|
||||
className={classes.orbitItem}
|
||||
animate={reduceMotion ? undefined : { y: [0, index % 2 === 0 ? -6 : 6, 0] }}
|
||||
transition={{ duration: 3.4 + index * 0.35, repeat: Infinity, ease: "easeInOut" }}
|
||||
>
|
||||
<Icon size={22} />
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
<Stack h="100%" justify="space-between" pos="relative">
|
||||
<Badge variant="dot" color="green">
|
||||
{t("ready")}
|
||||
</Badge>
|
||||
<Stack gap={4} align="center">
|
||||
<ThemeIcon size={72} radius="xl" variant="light">
|
||||
<IconLayoutDashboard size={34} />
|
||||
</ThemeIcon>
|
||||
<Text fw={700} size="lg">
|
||||
{t("panelTitle")}
|
||||
</Text>
|
||||
<Text size="sm" c="dimmed" ta="center" maw="19rem">
|
||||
{t("panelDescription")}
|
||||
</Text>
|
||||
</Stack>
|
||||
<Group gap="xs" justify="center">
|
||||
<Badge variant="light">{t("chipDiscover")}</Badge>
|
||||
<Badge variant="light">{t("chipConnect")}</Badge>
|
||||
<Badge variant="light">{t("chipBuild")}</Badge>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</motion.div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
{
|
||||
"init": {
|
||||
"studio": {
|
||||
"setupBadge": "First-time setup",
|
||||
"navigationLabel": "Onboarding sections",
|
||||
"title": "Setup studio",
|
||||
"subtitle": "Configure the essentials, let Homarr infer the rest.",
|
||||
"back": "Back",
|
||||
"continue": "Continue",
|
||||
"buildBoard": "Build my board",
|
||||
@@ -31,8 +28,7 @@
|
||||
"review": "Review"
|
||||
},
|
||||
"welcome": {
|
||||
"badge": "New Homarr",
|
||||
"eyebrow": "Your homelab, one useful board away",
|
||||
"badge": "Homarr v2",
|
||||
"title": "Make home feel organized.",
|
||||
"description": "Homarr can discover your services, connect the right integrations, and build a responsive first board. You only decide what cannot be inferred.",
|
||||
"start": "Get started",
|
||||
@@ -40,18 +36,13 @@
|
||||
"restoreTitle": "Restore this Homarr",
|
||||
"restoreDescription": "A full SQLite backup restores boards, people, apps, integrations, and settings. Homarr validates it before replacing anything.",
|
||||
"errorTitle": "Setup could not start",
|
||||
"errorDescription": "Your setup choices are still here. Try again, or reload the page if this continues.",
|
||||
"ready": "Ready to configure",
|
||||
"panelTitle": "From services to a useful board",
|
||||
"panelDescription": "Discovery, secure connections, layouts, widgets, Assistant, Workshop, and MCP stay connected in one flow.",
|
||||
"chipDiscover": "Discover",
|
||||
"chipConnect": "Connect",
|
||||
"chipBuild": "Build"
|
||||
"errorDescription": "Your setup choices are still here. Try again, or reload the page if this continues."
|
||||
},
|
||||
"account": {
|
||||
"title": "Create your administrator",
|
||||
"description": "This account owns the first setup and protects integration, Assistant, and MCP credentials.",
|
||||
"description": "Specify the credentials for your administrator user.",
|
||||
"username": "Administrator username",
|
||||
"passwordHint": "Only the 8-character minimum is required. The other password-strength checks are suggestions.",
|
||||
"create": "Create administrator",
|
||||
"errorTitle": "Administrator could not be created",
|
||||
"recoveryTitle": "Administrator account created",
|
||||
@@ -77,9 +68,11 @@
|
||||
"themeLight": "Light",
|
||||
"themeDark": "Dark",
|
||||
"serverTitle": "Usual server address",
|
||||
"serverOriginHelp": "Homarr uses this address to prefill detected service URLs. You can still edit every service individually.",
|
||||
"serverDescription": "This is a shortcut, not a restriction. Every detected service remains editable.",
|
||||
"serverOrigin": "Domain, IP, or reverse-proxy path",
|
||||
"serverOriginDescription": "Examples: home.lan, 192.168.1.10, or https://home.example.com/services. Choose how each service is appended below.",
|
||||
"urlModeLabel": "Service address pattern",
|
||||
"hostPort": "Same host, different ports",
|
||||
"subdomain": "One subdomain per service",
|
||||
"path": "One path per service",
|
||||
@@ -94,7 +87,6 @@
|
||||
"kubernetes": "Kubernetes",
|
||||
"assistantWorkshop": "Assistant and Workshop",
|
||||
"found": "Found {integrations} integrations and {apps} additional apps",
|
||||
"retryDocker": "Scan Docker again",
|
||||
"retryKubernetes": "Check Kubernetes again",
|
||||
"retryWorkshop": "Check Workshop again",
|
||||
"unknownVersion": "unknown version",
|
||||
@@ -105,8 +97,6 @@
|
||||
"workshopUnavailable": "Local and custom Assistant providers remain available",
|
||||
"partialTitle": "Some sources could not be scanned",
|
||||
"partialDescription": "Results from reachable hosts are kept. Check socket permissions or add services manually in the next section.",
|
||||
"platformTitle": "Docker, Synology, Kubernetes, and bare metal are all welcome",
|
||||
"platformDescription": "Homarr uses capabilities rather than guessing your platform. Detected values are suggestions you can review before anything is created.",
|
||||
"status": {
|
||||
"checking": "Checking availability…",
|
||||
"available": "Available",
|
||||
@@ -134,9 +124,13 @@
|
||||
"url": "Service URL",
|
||||
"noCredentials": "No credentials",
|
||||
"noCredentialsDescription": "This integration does not need credentials.",
|
||||
"credentialMethod": "Credential method",
|
||||
"getApiKey": "Open the API key settings for this service",
|
||||
"openGuide": "Open Homarr's setup guide for this service",
|
||||
"validationError": "Complete the URL and required credentials for {name}, or remove it from the selection."
|
||||
"needsConfiguration": "Needs configuration",
|
||||
"configured": "Configured",
|
||||
"validationError": "Complete the URL and required credentials for {name}, or remove it from the selection.",
|
||||
"incompleteConfirmation": "Some integrations need to be configured, are you sure?"
|
||||
},
|
||||
"board": {
|
||||
"title": "Shape the board before it is built",
|
||||
@@ -150,54 +144,23 @@
|
||||
"primaryColor": "Primary color",
|
||||
"secondaryColor": "Secondary color",
|
||||
"radius": "Widget corner radius",
|
||||
"layoutPreset": "Board width preset",
|
||||
"layoutFocused": "Focused",
|
||||
"layoutBalanced": "Balanced",
|
||||
"layoutWide": "Wide",
|
||||
"columns": "Board columns",
|
||||
"columnsDescription": "Columns define the horizontal grid used to size and position items. 12 is plenty for most people.",
|
||||
"columnCount": "{count, plural, one {# column} other {# columns}}",
|
||||
"leftSidebar": "Left sidebar",
|
||||
"rightSidebar": "Right sidebar",
|
||||
"previewLabel": "Live preview of the first board layout",
|
||||
"previewLayout": "Layout to preview",
|
||||
"previewMobile": "Mobile",
|
||||
"previewBase": "Base",
|
||||
"widgetPrimer": "A 30-second Homarr primer",
|
||||
"primerAppsTitle": "Apps open things",
|
||||
"primerAppsDescription": "App tiles are fast links with icons, status, and optional ping checks.",
|
||||
"primerWidgetsTitle": "Widgets explain things",
|
||||
"primerWidgetsDescription": "Integrations power focused views such as downloads, calendars, requests, and health.",
|
||||
"primerEditTitle": "Everything stays editable",
|
||||
"primerEditDescription": "Enter edit mode to move, resize, group, or add items independently on Mobile and Base layouts."
|
||||
"previewLabel": "Live preview of the first board layout"
|
||||
},
|
||||
"extend": {
|
||||
"title": "Add intelligence when it helps",
|
||||
"description": "Assistant, Workshop, and MCP work together but remain independent. Configure any now or return later.",
|
||||
"title": "Advanced features",
|
||||
"tabsLabel": "Assistant, Workshop, and MCP setup",
|
||||
"assistant": "Assistant",
|
||||
"workshop": "Workshop",
|
||||
"mcp": "MCP",
|
||||
"assistantSetup": {
|
||||
"title": "Homarr Assistant",
|
||||
"description": "Ask about this Homarr, create and edit apps or boards with approval, inspect integrations, and use the same conversations in the Assistant widget.",
|
||||
"loginTitle": "Administrator sign-in required",
|
||||
"loginDescription": "Provider keys and model access are privileged. Finish setup, sign in, and Homarr will open the Assistant configuration directly.",
|
||||
"loginAction": "Sign in to configure Assistant",
|
||||
"provider": "Provider",
|
||||
"baseUrl": "Provider URL",
|
||||
"apiKey": "API key",
|
||||
"connect": "Save connection and discover models",
|
||||
"connectHint": "Keys are encrypted and never returned by the API.",
|
||||
"model": "Default model",
|
||||
"modelPlaceholder": "Connect a provider first",
|
||||
"manualModelPlaceholder": "Enter a model ID",
|
||||
"manualModelDescription": "Model discovery is unavailable. Enter the exact model ID exposed by your provider.",
|
||||
"discovering": "Discovering models…",
|
||||
"enable": "Enable Assistant",
|
||||
"webSearch": "Allow supported web search",
|
||||
"advanced": "Advanced headers and provider settings",
|
||||
"save": "Save Assistant",
|
||||
"savedTitle": "Assistant is ready",
|
||||
"savedDescription": "The selected model is available from the header and Assistant widget.",
|
||||
"errorTitle": "Assistant could not be configured"
|
||||
"loginAction": "Sign in to configure Assistant"
|
||||
},
|
||||
"workshopSetup": {
|
||||
"title": "Homarr Workshop",
|
||||
@@ -232,18 +195,29 @@
|
||||
"review": {
|
||||
"title": "One board, built around your services",
|
||||
"description": "Homarr tests unsaved connections, imports the selected apps, applies appearance and layouts, then opens the exact board it configured.",
|
||||
"appearance": "Language and appearance",
|
||||
"services": "Selected services",
|
||||
"servicesValue": "{integrations} integrations · {apps} apps",
|
||||
"board": "First board",
|
||||
"columns": "Board columns",
|
||||
"columnsValue": "{count, plural, one {# column} other {# columns}}",
|
||||
"sidebars": "Sidebars",
|
||||
"sidebarsValue": "{count, plural, =0 {None} one {# sidebar} other {# sidebars}}",
|
||||
"layouts": "Responsive layouts",
|
||||
"layoutsValue": "Mobile + Base",
|
||||
"previewLabel": "Preview of the board being created",
|
||||
"automaticTitle": "What Homarr will infer",
|
||||
"integrations": "Integrations",
|
||||
"integrationsValue": "{count, plural, =0 {None selected} one {# integration} other {# integrations}}",
|
||||
"apps": "App tiles",
|
||||
"appsValue": "{count, plural, =0 {Starter apps only} one {# app tile} other {# app tiles}}",
|
||||
"language": "Language",
|
||||
"theme": "Theme",
|
||||
"themeAuto": "System preference",
|
||||
"themeLight": "Light",
|
||||
"themeDark": "Dark",
|
||||
"colors": "Board colors",
|
||||
"radius": "Widget radius",
|
||||
"automaticTitle": "What Homarr will create",
|
||||
"automaticDescription": "Compatible widgets, icons, app links, integration relationships, and responsive placement come from the shared Homarr catalog. You can edit every result later.",
|
||||
"dockerWarningTitle": "Some Docker labels changed during setup",
|
||||
"dockerWarningDescription": "{count, plural, one {# selected Docker result could not be applied because its service changed, targeted another board, or its widget was incompatible} other {# selected Docker results could not be applied because services changed, targeted another board, or their widgets were incompatible}}.",
|
||||
"errorTitle": "Setup paused safely",
|
||||
"errorTitle": "Board could not be built",
|
||||
"progress": {
|
||||
"applying": "Testing connections and building your board",
|
||||
"done": "Your board is ready"
|
||||
@@ -253,7 +227,6 @@
|
||||
"title": "Your first board is ready.",
|
||||
"description": "Homarr connected the pieces you selected and kept the rest editable. Open the board now; the short in-product tour can show you edit mode, widgets, layouts, and search.",
|
||||
"openBoard": "Open my board",
|
||||
"tutorial": "Tip: use edit mode to move or resize widgets. Mobile and Base layouts keep independent positions, so every screen can feel intentional.",
|
||||
"manageTitle": "Manage",
|
||||
"manageDescription": "Fine-tune apps, integrations, boards, users, and server settings.",
|
||||
"workshopTitle": "Workshop",
|
||||
@@ -6355,6 +6328,7 @@
|
||||
"provider": {
|
||||
"title": "Provider",
|
||||
"groups": {
|
||||
"free": "Free with Homarr",
|
||||
"hosted": "Hosted providers",
|
||||
"local": "Local providers",
|
||||
"custom": "Custom"
|
||||
@@ -6362,7 +6336,7 @@
|
||||
"options": {
|
||||
"homarr": {
|
||||
"label": "Homarr",
|
||||
"description": "Community-funded access to the model selected by the Homarr team. Each user signs in with the Community Workshop and receives a daily allowance."
|
||||
"description": "A limited number of Assistant uses are free each day, paid for by the Homarr team. Sign in with the Community Workshop to use your allowance."
|
||||
},
|
||||
"openrouter": {
|
||||
"label": "OpenRouter",
|
||||
@@ -6414,8 +6388,8 @@
|
||||
}
|
||||
},
|
||||
"homarrAuth": {
|
||||
"title": "No administrator API key required",
|
||||
"description": "Homarr keeps the upstream OpenRouter credential on the Community Workshop server. Each user authorizes requests with their own Workshop GitHub session, so their daily allowance stays separate."
|
||||
"title": "Free daily Assistant uses included",
|
||||
"description": "No API key is needed. The Homarr team covers a limited number of Assistant uses for you each day. Sign in with the Community Workshop to keep your allowance separate."
|
||||
}
|
||||
},
|
||||
"baseUrl": {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { ColorInput, useMantineTheme } from "@mantine/core";
|
||||
import type { ColorInputProps } from "@mantine/core";
|
||||
|
||||
export const BoardColorInput = (props: ColorInputProps) => {
|
||||
const theme = useMantineTheme();
|
||||
|
||||
return <ColorInput {...props} format="hex" swatches={Object.values(theme.colors).map((color) => color[6])} />;
|
||||
};
|
||||
@@ -0,0 +1,86 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { Combobox, Group, InputBase, Text, useCombobox } from "@mantine/core";
|
||||
import { IconCheck, IconDeviceDesktop, IconMoon, IconSun } from "@tabler/icons-react";
|
||||
|
||||
import type { ColorScheme } from "@homarr/definitions";
|
||||
import { colorSchemes } from "@homarr/definitions";
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
|
||||
const schemeIcons: Record<ColorScheme, React.ElementType> = {
|
||||
auto: IconDeviceDesktop,
|
||||
light: IconSun,
|
||||
dark: IconMoon,
|
||||
};
|
||||
|
||||
interface ColorSchemeComboboxProps {
|
||||
label?: string;
|
||||
value: ColorScheme;
|
||||
onChange: (value: ColorScheme) => void;
|
||||
width?: string;
|
||||
}
|
||||
|
||||
export const ColorSchemeCombobox = ({ label, value, onChange, width }: ColorSchemeComboboxProps) => {
|
||||
const tOptions = useScopedI18n("common.colorScheme.options");
|
||||
const combobox = useCombobox({ onDropdownClose: () => combobox.resetSelectedOption() });
|
||||
|
||||
return (
|
||||
<Combobox
|
||||
store={combobox}
|
||||
onOptionSubmit={(nextValue) => {
|
||||
onChange(nextValue as ColorScheme);
|
||||
combobox.closeDropdown();
|
||||
}}
|
||||
>
|
||||
<Combobox.Target>
|
||||
<InputBase
|
||||
component="button"
|
||||
type="button"
|
||||
pointer
|
||||
label={label}
|
||||
rightSection={<Combobox.Chevron />}
|
||||
rightSectionPointerEvents="none"
|
||||
onClick={() => combobox.toggleDropdown()}
|
||||
variant="filled"
|
||||
w={width}
|
||||
>
|
||||
<OptionItem scheme={value} currentScheme={value} tOptions={tOptions} />
|
||||
</InputBase>
|
||||
</Combobox.Target>
|
||||
<Combobox.Dropdown>
|
||||
<Combobox.Options>
|
||||
{colorSchemes.map((scheme) => (
|
||||
<Combobox.Option value={scheme} key={scheme}>
|
||||
<OptionItem scheme={scheme} currentScheme={value} tOptions={tOptions} showCheck />
|
||||
</Combobox.Option>
|
||||
))}
|
||||
</Combobox.Options>
|
||||
</Combobox.Dropdown>
|
||||
</Combobox>
|
||||
);
|
||||
};
|
||||
|
||||
const OptionItem = ({
|
||||
scheme,
|
||||
currentScheme,
|
||||
tOptions,
|
||||
showCheck,
|
||||
}: {
|
||||
scheme: ColorScheme;
|
||||
currentScheme: ColorScheme;
|
||||
tOptions: (key: ColorScheme) => string;
|
||||
showCheck?: boolean;
|
||||
}) => {
|
||||
const Icon = schemeIcons[scheme];
|
||||
|
||||
return (
|
||||
<Group wrap="nowrap" justify="space-between">
|
||||
<Group wrap="nowrap">
|
||||
<Icon size={16} stroke={1.5} />
|
||||
<Text>{tOptions(scheme)}</Text>
|
||||
</Group>
|
||||
{showCheck && scheme === currentScheme && <IconCheck color="currentColor" size={16} />}
|
||||
</Group>
|
||||
);
|
||||
};
|
||||
@@ -15,6 +15,9 @@ export { BetaBadge } from "./beta-badge";
|
||||
export { MaskedImage } from "./masked-image";
|
||||
export { MaskedOrNormalImage } from "./masked-or-normal-image";
|
||||
export { LanguageIcon } from "./language-icon";
|
||||
export { LanguageCombobox } from "./language-combobox";
|
||||
export { ColorSchemeCombobox } from "./color-scheme-combobox";
|
||||
export { BoardColorInput } from "./board-color-input";
|
||||
export { Link } from "./link";
|
||||
export {
|
||||
SelectGridLayout,
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { Combobox, Group, InputBase, Loader, ScrollArea, Text, useCombobox } from "@mantine/core";
|
||||
import { IconCheck } from "@tabler/icons-react";
|
||||
|
||||
import type { SupportedLanguage } from "@homarr/translation";
|
||||
import { localeConfigurations, supportedLanguages } from "@homarr/translation";
|
||||
|
||||
import { LanguageIcon } from "./language-icon";
|
||||
|
||||
interface LanguageComboboxProps {
|
||||
label?: string;
|
||||
value: SupportedLanguage;
|
||||
onChange: (value: SupportedLanguage) => void;
|
||||
isPending?: boolean;
|
||||
width?: string;
|
||||
withinPortal?: boolean;
|
||||
}
|
||||
|
||||
export const LanguageCombobox = ({
|
||||
label,
|
||||
value,
|
||||
onChange,
|
||||
isPending,
|
||||
width,
|
||||
withinPortal = false,
|
||||
}: LanguageComboboxProps) => {
|
||||
const combobox = useCombobox({ onDropdownClose: () => combobox.resetSelectedOption() });
|
||||
|
||||
return (
|
||||
<Combobox
|
||||
store={combobox}
|
||||
withinPortal={withinPortal}
|
||||
onOptionSubmit={(nextValue) => {
|
||||
onChange(nextValue as SupportedLanguage);
|
||||
combobox.closeDropdown();
|
||||
}}
|
||||
>
|
||||
<Combobox.Target>
|
||||
<InputBase
|
||||
component="button"
|
||||
type="button"
|
||||
pointer
|
||||
label={label}
|
||||
leftSection={isPending ? <Loader size={16} /> : null}
|
||||
rightSection={<Combobox.Chevron />}
|
||||
rightSectionPointerEvents="none"
|
||||
onClick={() => combobox.toggleDropdown()}
|
||||
variant="filled"
|
||||
w={width}
|
||||
>
|
||||
<OptionItem currentLocale={value} localeKey={value} />
|
||||
</InputBase>
|
||||
</Combobox.Target>
|
||||
<Combobox.Dropdown>
|
||||
<ScrollArea h={300}>
|
||||
<Combobox.Options>
|
||||
{supportedLanguages.map((locale) => (
|
||||
<Combobox.Option value={locale} key={locale}>
|
||||
<OptionItem currentLocale={value} localeKey={locale} showCheck />
|
||||
</Combobox.Option>
|
||||
))}
|
||||
</Combobox.Options>
|
||||
</ScrollArea>
|
||||
</Combobox.Dropdown>
|
||||
</Combobox>
|
||||
);
|
||||
};
|
||||
|
||||
const OptionItem = ({
|
||||
currentLocale,
|
||||
localeKey,
|
||||
showCheck,
|
||||
}: {
|
||||
currentLocale: SupportedLanguage;
|
||||
localeKey: SupportedLanguage;
|
||||
showCheck?: boolean;
|
||||
}) => (
|
||||
<Group wrap="nowrap" justify="space-between">
|
||||
<Group wrap="nowrap">
|
||||
<LanguageIcon icon={localeConfigurations[localeKey].icon} />
|
||||
<Group wrap="nowrap" gap="xs">
|
||||
<Text>{localeConfigurations[localeKey].name}</Text>
|
||||
<Text size="xs" c="dimmed" inherit>
|
||||
({localeConfigurations[localeKey].translatedName})
|
||||
</Text>
|
||||
</Group>
|
||||
</Group>
|
||||
{showCheck && localeKey === currentLocale && <IconCheck color="currentColor" size={16} />}
|
||||
</Group>
|
||||
);
|
||||
@@ -102,4 +102,28 @@ describe("onboarding URL validation", () => {
|
||||
onboardingCompleteSetupSchema.safeParse({ ...input, selectedDockerSourceIds: ["x".repeat(513)] }).success,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
test("accepts board column counts from 8 through 24", () => {
|
||||
const input = {
|
||||
server: { defaultLocale: "en", defaultColorScheme: "dark" },
|
||||
board: {
|
||||
name: "dashboard",
|
||||
primaryColor: "#228BE6",
|
||||
secondaryColor: "#15AABF",
|
||||
itemRadius: "md",
|
||||
columnCount: 8,
|
||||
},
|
||||
};
|
||||
|
||||
expect(onboardingCompleteSetupSchema.safeParse(input).success).toBe(true);
|
||||
expect(
|
||||
onboardingCompleteSetupSchema.safeParse({ ...input, board: { ...input.board, columnCount: 24 } }).success,
|
||||
).toBe(true);
|
||||
expect(
|
||||
onboardingCompleteSetupSchema.safeParse({ ...input, board: { ...input.board, columnCount: 7 } }).success,
|
||||
).toBe(false);
|
||||
expect(
|
||||
onboardingCompleteSetupSchema.safeParse({ ...input, board: { ...input.board, columnCount: 25 } }).success,
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -85,6 +85,7 @@ export const onboardingCompleteSetupSchema = z
|
||||
secondaryColor: hexColorSchema,
|
||||
itemRadius: z.enum(["xs", "sm", "md", "lg", "xl"]),
|
||||
layoutPreset: z.enum(onboardingLayoutPresets).default("balanced"),
|
||||
columnCount: z.number().int().min(8).max(24).optional(),
|
||||
leftSidebar: z.boolean().default(false),
|
||||
rightSidebar: z.boolean().default(false),
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user