Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

fix(header): add consistent account and board action feedback (#7293)

Thomasfc7b5f8a9d9c
diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx
index 41552ff34..d2ef0ccd4 100644
--- a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx
+++ b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx
@@ -3,6 +3,7 @@
import { useCallback, useEffect, useRef, useState } from "react";
import dynamic from "next/dynamic";
import { useRouter, useSearchParams } from "next/navigation";
+import { Tooltip } from "@mantine/core";
import { useHotkeys } from "@mantine/hooks";
import { notifications } from "@mantine/notifications";
import { IconDeviceFloppy, IconPencil, IconPencilOff, IconSettings, IconX } from "@tabler/icons-react";
@@ -63,9 +64,11 @@ export const BoardContentSettingsAction = ({ demoReadOnly }: { demoReadOnly: boo
return (
<TourTarget id="board-settings">
- <HeaderButton href={`/boards/${board.name}/settings`} aria-label={t("action.settings")}>
- <IconSettings stroke={1.5} />
- </HeaderButton>
+ <Tooltip label={t("action.settings")} events={{ hover: true, focus: true, touch: false }}>
+ <HeaderButton href={`/boards/${board.name}/settings`} aria-label={t("action.settings")}>
+ <IconSettings stroke={1.5} />
+ </HeaderButton>
+ </Tooltip>
</TourTarget>
);
};
@@ -189,39 +192,50 @@ const EditModeMenu = ({ demoReadOnly }: { demoReadOnly: boolean }) => {
if (returnToLayoutSettings) {
return (
<>
- <HeaderButton
- onClick={() => saveBoard(board)}
- loading={isPending}
- aria-label={tBoardSetting("section.layout.edit.save")}
- >
- <IconDeviceFloppy stroke={1.5} />
- </HeaderButton>
- <HeaderButton
- onClick={cancelLayoutEdit}
- disabled={isPending}
- aria-label={tBoardSetting("section.layout.edit.cancel.action")}
+ <Tooltip label={tBoardSetting("section.layout.edit.save")} events={{ hover: true, focus: true, touch: false }}>
+ <HeaderButton
+ onClick={() => saveBoard(board)}
+ loading={isPending}
+ aria-label={tBoardSetting("section.layout.edit.save")}
+ >
+ <IconDeviceFloppy stroke={1.5} />
+ </HeaderButton>
+ </Tooltip>
+ <Tooltip
+ label={tBoardSetting("section.layout.edit.cancel.action")}
+ events={{ hover: true, focus: true, touch: false }}
>
- <IconX stroke={1.5} />
- </HeaderButton>
+ <HeaderButton
+ onClick={cancelLayoutEdit}
+ disabled={isPending}
+ aria-label={tBoardSetting("section.layout.edit.cancel.action")}
+ >
+ <IconX stroke={1.5} />
+ </HeaderButton>
+ </Tooltip>
</>
);
}
+ const editLabel = isEditMode ? (demoReadOnly ? t("exit") : t("save")) : t("enter");
+
return (
<TourTarget id="board-edit-mode">
- <HeaderButton
- onClick={() => void toggle()}
- onFocus={prewarmEditor}
- onPointerEnter={prewarmEditor}
- loading={isPending || isEnteringEditMode}
- data-testid="board-edit-mode-toggle"
- data-board-editor-preload-state={editorLoadState}
- aria-busy={isPending || isEnteringEditMode}
- aria-label={isEditMode ? (demoReadOnly ? t("exit") : t("save")) : t("enter")}
- aria-pressed={isEditMode}
- >
- {isEditMode ? <IconPencilOff stroke={1.5} /> : <IconPencil stroke={1.5} />}
- </HeaderButton>
+ <Tooltip label={editLabel} events={{ hover: true, focus: true, touch: false }}>
+ <HeaderButton
+ onClick={() => void toggle()}
+ onFocus={prewarmEditor}
+ onPointerEnter={prewarmEditor}
+ loading={isPending || isEnteringEditMode}
+ data-testid="board-edit-mode-toggle"
+ data-board-editor-preload-state={editorLoadState}
+ aria-busy={isPending || isEnteringEditMode}
+ aria-label={editLabel}
+ aria-pressed={isEditMode}
+ >
+ {isEditMode ? <IconPencilOff stroke={1.5} /> : <IconPencil stroke={1.5} />}
+ </HeaderButton>
+ </Tooltip>
</TourTarget>
);
};
diff --git a/apps/nextjs/src/components/layout/header/user-client.tsx b/apps/nextjs/src/components/layout/header/user-client.tsx
index 4b1cb5ed9..5fe79a5c7 100644
--- a/apps/nextjs/src/components/layout/header/user-client.tsx
+++ b/apps/nextjs/src/components/layout/header/user-client.tsx
@@ -2,7 +2,7 @@
import type { ReactNode } from "react";
import { useEffect, useState } from "react";
-import { UnstyledButton, useMantineColorScheme } from "@mantine/core";
+import { ActionIcon, Tooltip, useMantineColorScheme } from "@mantine/core";
import { useHotkeys } from "@mantine/hooks";
import { clientApi } from "@homarr/api/client";
@@ -50,11 +50,13 @@ export const UserButtonClient = ({ avatar, isAdmin, isDockerEnabled, boardSwitch
return (
<UserAvatarMenu availableUpdates={visibleUpdates} isDockerEnabled={isDockerEnabled} boardSwitcher={boardSwitcher}>
- <UnstyledButton aria-label={t("open")}>
- <UpdateIndicator availableUpdates={visibleUpdates} disabled={!isCurrentSessionAdmin}>
- {avatar}
- </UpdateIndicator>
- </UnstyledButton>
+ <UpdateIndicator availableUpdates={visibleUpdates} disabled={!isCurrentSessionAdmin}>
+ <Tooltip label={t("open")} events={{ hover: true, focus: true, touch: false }}>
+ <ActionIcon aria-label={t("open")} variant="subtle" color="gray" size={44} radius="xl">
+ {avatar}
+ </ActionIcon>
+ </Tooltip>
+ </UpdateIndicator>
</UserAvatarMenu>
);
};