From fd024e32d2343365be48bdd6a054fd13814fe756 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Sun, 2 Aug 2026 17:39:28 +0200 Subject: [PATCH] fix: simplify widget feedback --- packages/widgets/src/audio-stats/component.tsx | 14 ++++---------- .../src/smart-home/entity-state/component.tsx | 13 +++---------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/packages/widgets/src/audio-stats/component.tsx b/packages/widgets/src/audio-stats/component.tsx index 2fdb6484e..e3b447ab9 100644 --- a/packages/widgets/src/audio-stats/component.tsx +++ b/packages/widgets/src/audio-stats/component.tsx @@ -1,6 +1,6 @@ "use client"; -import { Badge, Group, ScrollArea, SimpleGrid, Stack, Text, Tooltip } from "@mantine/core"; +import { Badge, Group, ScrollArea, SimpleGrid, Stack, Text } from "@mantine/core"; import { getQueryKey } from "@trpc/react-query"; import { clientApi } from "@homarr/api/client"; @@ -75,15 +75,9 @@ export default function AudioStatsWidget({ {currentlyPlaying.seasonName ?? currentlyPlaying.albumName ?? session.user.username} - - - {session.sessionName} - - + + {session.sessionName} + ); })} diff --git a/packages/widgets/src/smart-home/entity-state/component.tsx b/packages/widgets/src/smart-home/entity-state/component.tsx index e3f776f66..179ab3c3e 100644 --- a/packages/widgets/src/smart-home/entity-state/component.tsx +++ b/packages/widgets/src/smart-home/entity-state/component.tsx @@ -1,7 +1,7 @@ "use client"; import { useCallback } from "react"; -import { Badge, Center, Group, Stack, Text, Tooltip, UnstyledButton } from "@mantine/core"; +import { Badge, Center, Group, Stack, Text, UnstyledButton } from "@mantine/core"; import { IconBinaryTree } from "@tabler/icons-react"; import { clientApi } from "@homarr/api/client"; @@ -38,7 +38,7 @@ export default function SmartHomeEntityStateWidget({ const canInteract = useIntegrationsWithInteractAccess().some(({ id }) => id === integrationId); const utils = clientApi.useUtils(); - const { mutate, isPending, error } = clientApi.widget.smartHome.switchEntity.useMutation({ + const { mutate, isPending } = clientApi.widget.smartHome.switchEntity.useMutation({ onSettled: () => void utils.widget.smartHome.entityDetails.invalidate(input), onError: () => showErrorNotification({ @@ -110,7 +110,7 @@ export default function SmartHomeEntityStateWidget({ onClick={handleClick} disabled={!isActionable} aria-label={`${displayName}: ${state}${attribute}`} - aria-description={queryErrorLabel ?? (error ? t("widget.smartHome-entityState.error.toggleFailed") : undefined)} + aria-description={queryErrorLabel} w="100%" h="100%" styles={{ @@ -153,13 +153,6 @@ export default function SmartHomeEntityStateWidget({ )} - {error && ( - - - {t("widget.smartHome-entityState.error.toggleFailed")} - - - )}