From 2e97b337d2eda870b9b7ba36270d0e691c357512 Mon Sep 17 00:00:00 2001 From: ajnart Date: Wed, 19 Aug 2026 16:29:30 +0200 Subject: [PATCH] fix: remove universal create search --- apps/docs/docs/management/boards/index.mdx | 2 +- .../create/universal-create-modal.tsx | 87 ++++++++----------- 2 files changed, 36 insertions(+), 53 deletions(-) diff --git a/apps/docs/docs/management/boards/index.mdx b/apps/docs/docs/management/boards/index.mdx index cc6a5feb6..6f1710e3b 100644 --- a/apps/docs/docs/management/boards/index.mdx +++ b/apps/docs/docs/management/boards/index.mdx @@ -205,7 +205,7 @@ changes, Homarr asks whether to discard them. If the editor cannot load, the boa /> While edit mode is active, **Add board content** opens the same Universal Create surface as the global header action and -Spotlight. It can add a widget, app, integration, Container, board, Workshop item, or Custom Widget when the +Spotlight. It lists the available actions directly and can add a widget, app, integration, Container, board, Workshop item, or Custom Widget when the current user and context allow it. Widget setup offers the main canvas, enabled rails, and existing Containers as destinations before the widget is created, so the common flow does not require a second move step. diff --git a/apps/nextjs/src/components/create/universal-create-modal.tsx b/apps/nextjs/src/components/create/universal-create-modal.tsx index f071c8413..55b4439e9 100644 --- a/apps/nextjs/src/components/create/universal-create-modal.tsx +++ b/apps/nextjs/src/components/create/universal-create-modal.tsx @@ -1,8 +1,8 @@ "use client"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useRef } from "react"; import { useRouter } from "next/navigation"; -import { Group, Stack, Text, TextInput, ThemeIcon, UnstyledButton } from "@mantine/core"; +import { Group, Stack, Text, ThemeIcon, UnstyledButton } from "@mantine/core"; import { IconApps, IconBox, @@ -10,7 +10,6 @@ import { IconLayoutDashboard, IconLayoutGridAdd, IconPlugConnected, - IconSearch, } from "@tabler/icons-react"; import { useSession } from "@homarr/auth/client"; @@ -26,7 +25,7 @@ import type { UniversalCreateActionGroup, UniversalCreateActionKey, } from "./universal-create-actions"; -import { filterAndRankUniversalCreateActions, getUniversalCreateActionDefinitions } from "./universal-create-actions"; +import { getUniversalCreateActionDefinitions } from "./universal-create-actions"; import type { SetupMetricEntryPoint } from "./setup-analytics"; import { useSetupAnalytics } from "./setup-analytics"; @@ -52,7 +51,6 @@ export const UniversalCreateModal = createModal(({ ac const router = useRouter(); const t = useScopedI18n("universalCreate"); const { openModal: openAddBoardModal } = useModalAction(AddBoardModal); - const [query, setQuery] = useState(""); const trackedOpen = useRef(false); const boardActions = innerProps.boardActions; const entryPoint = innerProps.entryPoint ?? (boardActions ? "board" : "header"); @@ -118,58 +116,43 @@ export const UniversalCreateModal = createModal(({ ac keywords: t(`action.${definition.key}.keywords`).split(" "), }) satisfies RankedUniversalCreateAction, ); - const visibleActions = filterAndRankUniversalCreateActions(resolvedActions, query); + const orderedActions = resolvedActions.toSorted((left, right) => right.priority - left.priority); const groups = ["currentBoard", "library", "boards"] satisfies UniversalCreateActionGroup[]; return ( - setQuery(event.currentTarget.value)} - leftSection={} - placeholder={t("search.placeholder")} - aria-label={t("search.label")} - /> + {groups.map((group) => { + const groupActions = orderedActions.filter((action) => action.group === group); + if (groupActions.length === 0) return null; - {visibleActions.length === 0 ? ( - - {t("search.noResults")} - - ) : ( - groups.map((group) => { - const groupActions = visibleActions.filter((action) => action.group === group); - if (groupActions.length === 0) return null; - - return ( - - - {t(`group.${group}`)} - - {groupActions.map((action) => { - const Icon = actionIcons[action.key]; - return ( - invokeAction(action.key)}> - - - - - - - {action.name} - - - {action.description} - - - - - ); - })} - - ); - }) - )} + return ( + + + {t(`group.${group}`)} + + {groupActions.map((action) => { + const Icon = actionIcons[action.key]; + return ( + invokeAction(action.key)}> + + + + + + + {action.name} + + + {action.description} + + + + + ); + })} + + ); + })} ); }).withOptions({