From 6b160abe525cac2f3fb1825f8ea87fcee3163a5d Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Thu, 12 Nov 2026 23:07:37 -0800 Subject: [PATCH] feat(macos): redesign Full Disk Access toast with prompt count illustration (#41849) * feat(macos): redesign Full Disk Access toast with prompt count illustration * fix(macos): stack FDA toast actions on narrow cards so the button never overflows --- .../FullDiskAccessNudgeToast.fixture.tsx | 52 +++++++++++ .../FullDiskAccessNudgeToast.tsx | 92 +++++++++++++++++++ ...tNotice.ts => useMacosTccPromptNotice.tsx} | 65 +++++++------ src/renderer/src/i18n/locales/de.json | 3 - src/renderer/src/i18n/locales/en.json | 8 +- src/renderer/src/i18n/locales/es.json | 3 - src/renderer/src/i18n/locales/fr.json | 3 - src/renderer/src/i18n/locales/ja.json | 3 - src/renderer/src/i18n/locales/ko.json | 3 - src/renderer/src/i18n/locales/pt.json | 3 - src/renderer/src/i18n/locales/ru.json | 3 - src/renderer/src/i18n/locales/tr.json | 3 - src/renderer/src/i18n/locales/zh-Hant.json | 3 - src/renderer/src/i18n/locales/zh.json | 3 - 14 files changed, 181 insertions(+), 66 deletions(-) create mode 100644 src/renderer/src/components/macos-permissions/FullDiskAccessNudgeToast.fixture.tsx create mode 100644 src/renderer/src/components/macos-permissions/FullDiskAccessNudgeToast.tsx rename src/renderer/src/hooks/{useMacosTccPromptNotice.ts => useMacosTccPromptNotice.tsx} (57%) diff --git a/src/renderer/src/components/macos-permissions/FullDiskAccessNudgeToast.fixture.tsx b/src/renderer/src/components/macos-permissions/FullDiskAccessNudgeToast.fixture.tsx new file mode 100644 index 00000000000..9718e48aab0 --- /dev/null +++ b/src/renderer/src/components/macos-permissions/FullDiskAccessNudgeToast.fixture.tsx @@ -0,0 +1,52 @@ +import { defineFixture } from '../../component-fixtures/component-fixture' +import { FullDiskAccessNudgeToast } from './FullDiskAccessNudgeToast' + +const noop = (): void => {} + +export const singlePrompt = defineFixture({ + width: 448, + render: () => ( + + ) +}) + +export const repeatedPrompts = defineFixture({ + width: 448, + render: () => ( + + ) +}) + +export const narrowWindow = defineFixture({ + width: 300, + render: () => ( + + ) +}) + +export const mediumWindow = defineFixture({ + width: 360, + render: () => ( + + ) +}) diff --git a/src/renderer/src/components/macos-permissions/FullDiskAccessNudgeToast.tsx b/src/renderer/src/components/macos-permissions/FullDiskAccessNudgeToast.tsx new file mode 100644 index 00000000000..694e9dc6262 --- /dev/null +++ b/src/renderer/src/components/macos-permissions/FullDiskAccessNudgeToast.tsx @@ -0,0 +1,92 @@ +import { X } from 'lucide-react' +import { Button } from '@/components/ui/button' +import { useTranslate } from '@/i18n/use-translate' + +type FullDiskAccessNudgeToastProps = { + promptCount: number + onEnable: () => void + onClose: () => void + onDontShowAgain: () => void +} + +function StackedPromptsIllustration({ promptCount }: { promptCount: number }): React.JSX.Element { + return ( +