diff --git a/apps/desktop/layer/renderer/src/modules/action/action-setting.tsx b/apps/desktop/layer/renderer/src/modules/action/action-setting.tsx index 35cff542f..8a16f171b 100644 --- a/apps/desktop/layer/renderer/src/modules/action/action-setting.tsx +++ b/apps/desktop/layer/renderer/src/modules/action/action-setting.tsx @@ -9,6 +9,7 @@ import { import { actionActions } from "@follow/store/action/store" import { JsonObfuscatedCodec } from "@follow/utils/json-codec" import { useQueryClient } from "@tanstack/react-query" +import { m } from "motion/react" import { useTranslation } from "react-i18next" import { unstable_usePrompt } from "react-router" import { toast } from "sonner" @@ -26,6 +27,55 @@ import { RuleCard } from "~/modules/action/rule-card" import { generateExportFilename } from "./utils" +const EmptyActionPlaceholder = () => { + const { t } = useTranslation("settings") + + return ( +
+ + {/* Magic wand icon for actions */} +
+ +
+ +
+

+ {t("actions.action_card.empty.title")} +

+

+ {t("actions.action_card.empty.description")} +

+
+
+ + {/* Animated arrow pointing to the New Action button */} + +
+ {t("actions.action_card.empty.start")} + +
+
+
+ ) +} + export const ActionSetting = () => { const actions = useActionRules() @@ -35,14 +85,20 @@ export const ActionSetting = () => { return } size="large" /> } + const hasActions = actions.length > 0 + return (
-
- {actions.map((_, actionIdx) => { - return - })} -
+ {hasActions ? ( +
+ {actions.map((_, actionIdx) => { + return + })} +
+ ) : ( + + )}
) } @@ -143,36 +199,39 @@ const ActionButtonGroup = () => { } } + const hasActions = actionLength > 0 + return (
- - - - - - - - Export to File - - - - Import from File - - - - - Copy to Clipboard - - - - Import from Clipboard - - - - + {hasActions && ( + + + + + + + + Export to File + + + + Import from File + + + + + Copy to Clipboard + + + + Import from Clipboard + + + + )} - + {hasActions && ( + + )}
) } diff --git a/locales/settings/en.json b/locales/settings/en.json index cce51ba7d..46778c7a1 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -13,6 +13,9 @@ "actions.action_card.block": "Block", "actions.action_card.block_rules": "Block Rules", "actions.action_card.custom_filters": "Custom Filters", + "actions.action_card.empty.description": "Create your first action rule to automatically process your feeds", + "actions.action_card.empty.start": "Start here!", + "actions.action_card.empty.title": "No Actions Yet", "actions.action_card.enable_readability": "Enable Readability", "actions.action_card.feed_options.entry_author": "Entry Author", "actions.action_card.feed_options.entry_content": "Entry Content",