From e3e5f888097f7194bc10edd061bcc14efd1e121c Mon Sep 17 00:00:00 2001 From: Hyu Date: Sun, 11 Oct 2026 00:50:49 +0800 Subject: [PATCH] feat(bots): highlight empty routing action with amber glow --- .../bot-form/EventBindingsEditor.module.css | 32 +++++++++++++++++++ .../bot-form/EventBindingsEditor.tsx | 8 ++++- web/src/i18n/locales/bot-setup.ts | 16 +++++----- 3 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 web/src/app/home/bots/components/bot-form/EventBindingsEditor.module.css diff --git a/web/src/app/home/bots/components/bot-form/EventBindingsEditor.module.css b/web/src/app/home/bots/components/bot-form/EventBindingsEditor.module.css new file mode 100644 index 000000000..0318c496a --- /dev/null +++ b/web/src/app/home/bots/components/bot-form/EventBindingsEditor.module.css @@ -0,0 +1,32 @@ +.emptyRouteHint { + --route-glow-soft: 6%; + --route-glow-strong: 30%; + animation: route-hint-glow 3.6s ease-in-out infinite; +} + +:global(.dark) .emptyRouteHint { + --route-glow-soft: 4%; + --route-glow-strong: 22%; +} + +.emptyRouteHint:hover, +.emptyRouteHint:focus-visible, +.emptyRouteHint[data-state='open'] { + animation: none; +} + +@keyframes route-hint-glow { + 0%, + 100% { + box-shadow: 0 0 6px 1px color-mix(in srgb, var(--color-amber-400) var(--route-glow-soft), transparent); + } + 50% { + box-shadow: 0 0 14px 4px color-mix(in srgb, var(--color-amber-400) var(--route-glow-strong), transparent); + } +} + +@media (prefers-reduced-motion: reduce) { + .emptyRouteHint { + animation: none; + } +} diff --git a/web/src/app/home/bots/components/bot-form/EventBindingsEditor.tsx b/web/src/app/home/bots/components/bot-form/EventBindingsEditor.tsx index c96a364c4..7a2b05200 100644 --- a/web/src/app/home/bots/components/bot-form/EventBindingsEditor.tsx +++ b/web/src/app/home/bots/components/bot-form/EventBindingsEditor.tsx @@ -11,6 +11,7 @@ import { import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import { cn } from '@/lib/utils'; +import styles from './EventBindingsEditor.module.css'; import type { TFunction } from 'i18next'; import { UseFormReturn } from 'react-hook-form'; import { @@ -1800,7 +1801,12 @@ export default function EventBindingsEditor({
-