feat: improve workshop publishing flow
This commit is contained in:
19 files changed
+254
-82
No files matched your search
@@ -48,6 +48,7 @@ export default async function InitPage() {
|
||||
? resolveHomarrUrlConfig({
|
||||
homarrWebsiteUrl: env.HOMARR_WEBSITE_URL,
|
||||
workshopApiUrl: env.WORKSHOP_API_URL,
|
||||
workshopWebUrl: env.WORKSHOP_WEB_URL,
|
||||
})
|
||||
: { workshopApiUrl: "", workshopWebUrl: "" };
|
||||
const baseUrl = extractBaseUrlFromHeaders(requestHeaders);
|
||||
|
||||
@@ -121,6 +121,7 @@ export default async function Layout(props: {
|
||||
const publicUrls = resolveHomarrUrlConfig({
|
||||
homarrWebsiteUrl: env.HOMARR_WEBSITE_URL,
|
||||
workshopApiUrl: env.WORKSHOP_API_URL,
|
||||
workshopWebUrl: env.WORKSHOP_WEB_URL,
|
||||
});
|
||||
|
||||
const StackedProvider = composeWrappers([
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { Button } from "@mantine/core";
|
||||
import { IconExternalLink } from "@tabler/icons-react";
|
||||
import { Alert, Button, Stack } from "@mantine/core";
|
||||
import { IconExternalLink, IconInfoCircle } from "@tabler/icons-react";
|
||||
|
||||
import { auth } from "@homarr/auth/next";
|
||||
import { getScopedI18n } from "@homarr/translation/server";
|
||||
@@ -17,6 +17,7 @@ export default async function WorkshopPage() {
|
||||
const { workshopWebUrl } = resolveHomarrUrlConfig({
|
||||
homarrWebsiteUrl: env.HOMARR_WEBSITE_URL,
|
||||
workshopApiUrl: env.WORKSHOP_API_URL,
|
||||
workshopWebUrl: env.WORKSHOP_WEB_URL,
|
||||
});
|
||||
return (
|
||||
<ManagePageLayout
|
||||
@@ -34,7 +35,12 @@ export default async function WorkshopPage() {
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<WorkshopInstaller />
|
||||
<Stack gap="lg">
|
||||
<Alert icon={<IconInfoCircle size={18} />} title={t("manageSubmissionsTitle")} color="blue">
|
||||
{t("manageSubmissionsDescription")}
|
||||
</Alert>
|
||||
<WorkshopInstaller />
|
||||
</Stack>
|
||||
</ManagePageLayout>
|
||||
);
|
||||
}
|
||||
@@ -35,6 +35,7 @@ describe("assistant chat input", () => {
|
||||
clientContext: { pathname: "/en/boards/Home/settings", timeZone: "Europe/Paris" },
|
||||
currentTime: new Date("2026-08-13T08:00:00.000Z"),
|
||||
userName: "Alex",
|
||||
workshopWebUrl: "https://community.example.com/workshop",
|
||||
entities: [
|
||||
{ id: "board-1", type: "board", label: "Home", description: "Home board" },
|
||||
{ id: "app-1", type: "app", label: "Jellyfin", description: "Media" },
|
||||
@@ -51,6 +52,7 @@ describe("assistant chat input", () => {
|
||||
|
||||
expect(context).toContain('"currentTimeUtc":"2026-08-13T08:00:00.000Z"');
|
||||
expect(context).toContain('"currentUser":"Alex"');
|
||||
expect(context).toContain('"workshopWebUrl":"https://community.example.com/workshop"');
|
||||
expect(context).toContain('"currentBoard":{"id":"board-1","name":"Home"}');
|
||||
expect(context).toContain('"availableResources":{"boards":1,"apps":1,"integrations":1,"widgets":1}');
|
||||
expect(context).toContain('"explicitMentions":[{"type":"app","id":"app-1","label":"Jellyfin"');
|
||||
|
||||
@@ -59,12 +59,14 @@ export const buildAssistantRequestContext = ({
|
||||
entities,
|
||||
messages,
|
||||
userName,
|
||||
workshopWebUrl,
|
||||
}: {
|
||||
clientContext?: AssistantClientContext;
|
||||
currentTime: Date;
|
||||
entities: AssistantContextEntity[];
|
||||
messages: { role: "user" | "assistant"; parts: unknown[] }[];
|
||||
userName: string | null | undefined;
|
||||
workshopWebUrl?: string;
|
||||
}) => {
|
||||
const boards = entities.filter((entity) => entity.type === "board");
|
||||
const homeBoard = boards.find((board) => board.description === "Home board");
|
||||
@@ -88,6 +90,7 @@ export const buildAssistantRequestContext = ({
|
||||
currentTimeUtc: currentTime.toISOString(),
|
||||
userTimeZone: clientContext?.timeZone ?? "UTC",
|
||||
currentUser: userName?.trim() || "Signed-in user",
|
||||
workshopWebUrl: workshopWebUrl ?? null,
|
||||
currentPage: clientContext?.pathname ?? null,
|
||||
currentBoard: currentBoard ? { id: currentBoard.id, name: currentBoard.label } : null,
|
||||
homeBoard: homeBoard ? { id: homeBoard.id, name: homeBoard.label } : null,
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
assistantProviderRequiresApiKey,
|
||||
assistantReasoningModes,
|
||||
} from "@homarr/definitions";
|
||||
import { resolveHomarrUrlConfig } from "@homarr/workshop/schema";
|
||||
|
||||
import { browserToolContracts } from "~/components/assistant/assistant-tool-contracts";
|
||||
import { env as appEnv } from "~/env";
|
||||
@@ -461,6 +462,11 @@ export async function POST(request: Request) {
|
||||
entities: contextEntities,
|
||||
messages: parsed.data.messages,
|
||||
userName: session.user.name,
|
||||
workshopWebUrl: resolveHomarrUrlConfig({
|
||||
homarrWebsiteUrl: appEnv.HOMARR_WEBSITE_URL,
|
||||
workshopApiUrl: appEnv.WORKSHOP_API_URL,
|
||||
workshopWebUrl: appEnv.WORKSHOP_WEB_URL,
|
||||
}).workshopWebUrl,
|
||||
});
|
||||
if (modelLookup.error !== null) {
|
||||
logger.warn("Assistant model discovery failed before the response started", {
|
||||
|
||||
Reference in new issue
Block a user