diff --git a/apps/docs/docs/management/workshop/index.mdx b/apps/docs/docs/management/workshop/index.mdx index 84a2bd07b..00789bfaa 100644 --- a/apps/docs/docs/management/workshop/index.mdx +++ b/apps/docs/docs/management/workshop/index.mdx @@ -27,9 +27,10 @@ The workshop contains community-made content. Widgets may contain unwanted or ma - Filter by **Widgets** or **CSS**, show or hide outdated entries, and sort by popularity, creation date, recent updates, or discussion activity. - Sign in with **GitHub** to upvote/downvote, submit your own creations, or report a submission. -- Each submission shows its title, description, linked GitHub author, revision, optional screenshots, reports, comments, and full content. +- Each submission shows its title, description, linked GitHub author, revision, optional screenshots, comments, and full content. - A new submission receives one real upvote owned by its author. Votes remain unique per user and submission. -- Reports and the manual **Outdated** badge are warnings, not automatic removal. Reported and outdated entries remain installable after confirmation. +- Report details and reporter identities are visible only to Workshop administrators. Reports do not automatically remove a submission. +- The manual **Outdated** badge warns visitors that a submission may need an update. ## Comments @@ -38,7 +39,7 @@ Comments are publicly readable. Signed-in users can post; authors can edit or de ## Submitting 1. Sign in with GitHub. -2. Click **Submit** and choose the type: +2. Click **Share yours** and choose the type: - **Custom widget** — paste the JSON exported from **Manage → Custom Widgets → Export**. It must match the `homarr-custom-widget-v2` schema (validated before submission). - **Custom CSS** — paste your stylesheet (max 16384 characters). @@ -62,8 +63,7 @@ You can install workshop entries without leaving Homarr: - **Custom CSS** — open a board's **Settings → Custom CSS**, click **Install from Workshop**, and pick a theme to load it into the editor before saving. -Alternatively, use **Copy** (or **Download** for widgets) on any submission and import it -manually. +Alternatively, open a submission in the Workshop and use **Download widget JSON** or **Copy CSS**. The submission page shows the matching manual installation steps before the source code. Custom Widget imports detect required bearer, basic, header, or query credentials. You can enter them during import or explicitly defer them; secret values are never stored in Workshop content. Missing credentials remain visible on the local Custom Widget afterward. diff --git a/apps/docs/docusaurus.config.ts b/apps/docs/docusaurus.config.ts index 2995580ee..230644992 100644 --- a/apps/docs/docusaurus.config.ts +++ b/apps/docs/docusaurus.config.ts @@ -46,17 +46,6 @@ const config: Config = { themes: ["@docusaurus/theme-mermaid"], - scripts: [ - { - src: "https://widget.kapa.ai/kapa-widget.bundle.js", - "data-website-id": "1e4656f4-abeb-4343-bbae-1d8626f52378", - "data-project-name": "Homarr", - "data-project-color": "#2B2B2B", - "data-project-logo": "https://homarr.dev/img/favicon.png", - async: true, - }, - ], - presets: [ [ "classic", diff --git a/apps/docs/src/components/custom-widget-code-client.tsx b/apps/docs/src/components/custom-widget-code-client.tsx index f057400dc..ce35fc60a 100644 --- a/apps/docs/src/components/custom-widget-code-client.tsx +++ b/apps/docs/src/components/custom-widget-code-client.tsx @@ -1,19 +1,8 @@ import { useState } from "react"; +import { useColorMode } from "@docusaurus/theme-common"; import { MantineProvider, Select, Stack, Text } from "@mantine/core"; /* oxlint-disable import/no-unassigned-import -- Mantine component styles intentionally load for side effects. */ -import "@mantine/core/styles/Badge.css"; -import "@mantine/core/styles/Button.css"; -import "@mantine/core/styles/Combobox.css"; -import "@mantine/core/styles/Group.css"; -import "@mantine/core/styles/Input.css"; -import "@mantine/core/styles/Loader.css"; -import "@mantine/core/styles/Pill.css"; -import "@mantine/core/styles/PillsInput.css"; -import "@mantine/core/styles/Popover.css"; -import "@mantine/core/styles/ScrollArea.css"; -import "@mantine/core/styles/Stack.css"; -import "@mantine/core/styles/Text.css"; -import "@mantine/core/styles/UnstyledButton.css"; +import "@mantine/core/styles.layer.css"; /* oxlint-enable import/no-unassigned-import */ import { @@ -64,8 +53,10 @@ export function CanonicalCustomWidgetExampleClient({ id, label, example, height } export function CustomWidgetCodeExampleClient(props: CustomWidgetCodeExampleProps) { + const { colorMode } = useColorMode(); + return ( - + + ); } export function BundledCustomWidgetGalleryClient() { + const { colorMode } = useColorMode(); const [selectedId, setSelectedId] = useState(BUNDLED_CUSTOM_WIDGETS[0]?.id ?? null); const selected = BUNDLED_CUSTOM_WIDGETS.find(({ id }) => id === selectedId) ?? BUNDLED_CUSTOM_WIDGETS[0]; if (!selected) return null; const manifest = { ...selected.widget, template: "__HOMARR_TEMPLATE__" }; return ( - + - @@ -134,7 +134,16 @@ export const CommentsSection = ({

)} - {loading &&

Loading comments…

} + {loading && ( +
+ {Array.from({ length: 2 }, (_, index) => ( +
+
+
+
+ ))} +
+ )} {!loading && fetchError &&

Failed to load comments

} {!loading && !fetchError && rows.length === 0 && (

No comments yet

@@ -165,6 +174,7 @@ export const CommentsSection = ({ {canManage && !isEditing && (
+ +
+
+ ); + } + if (notFound || !submission) { return (
@@ -308,7 +372,7 @@ const MarketplaceDetail = ({ workshopUrl }: { workshopUrl: string }) => { } const score = submission.upvotes - submission.downvotes; - const { Icon: CopyIcon, label: copyLabel, iconClass: copyIconClass } = copyState[Number(copied)]; + const { Icon: CopyIcon, iconClass: copyIconClass } = copyState[Number(copied)]; return (
@@ -340,7 +404,6 @@ const MarketplaceDetail = ({ workshopUrl }: { workshopUrl: string }) => { {typeLabels[submission.type]} {submission.outdated && Outdated} - {submission.reportCount > 0 && Reported}

{

+ )} + - {submission.type === "customWidget" && ( - - )} + {(user?.id === submission.author || user?.isAdmin === true) && ( - )} {user?.id === submission.author && ( - )} {(user?.id === submission.author || user?.isAdmin === true) && }
+
+ +
+

Install in Homarr

+

+ {submission.type === "customWidget" + ? "Download the JSON, then open Manage → Custom Widgets → Import in your Homarr instance. Homarr asks for any required credentials during import." + : "Copy the CSS, then open your board settings and paste it into Custom CSS."}{" "} + + Read the installation guide + +

+
+
+
{submission.type === "customWidget" ? ( { onError={setError} />
- - + { + if (reportPending) return; + setReportOpen(open); + if (!open) setReportError(null); + }} + > + + + Report submission + + Only Workshop administrators can review report details and reporter identities. + + + {reportError && ( +
+ {reportError} +
+ )} + +