From 47c3874244a942d50fb0ef41f5ebcfd5336564e7 Mon Sep 17 00:00:00 2001 From: Supra4E8C Date: Mon, 16 Feb 2026 23:13:26 +0800 Subject: [PATCH] fix(auth-files): polish selection UI and animate batch action bar --- src/components/config/DiffModal.module.scss | 13 +++--- .../authFiles/components/AuthFileCard.tsx | 19 +++++---- src/pages/AuthFilesPage.module.scss | 41 ++++++++++++++++--- src/pages/AuthFilesPage.tsx | 19 +++++++++ 4 files changed, 73 insertions(+), 19 deletions(-) diff --git a/src/components/config/DiffModal.module.scss b/src/components/config/DiffModal.module.scss index 02b7b6e..7089c54 100644 --- a/src/components/config/DiffModal.module.scss +++ b/src/components/config/DiffModal.module.scss @@ -5,6 +5,7 @@ :global(.modal-body) { padding: $spacing-md $spacing-lg; max-height: none; + overflow: hidden; } } @@ -39,17 +40,17 @@ :global(.cm-mergeView) { height: 100%; + overflow: auto !important; + -webkit-overflow-scrolling: touch; background: var(--bg-primary); } - :global(.cm-mergeViewEditors), - :global(.cm-mergeViewEditor), - :global(.cm-editor) { - height: 100%; + :global(.cm-mergeViewEditors) { + min-height: 100%; } - :global(.cm-scroller) { - overflow: auto; + :global(.cm-mergeViewEditor) { + height: 100%; } :global(.cm-gutters) { diff --git a/src/features/authFiles/components/AuthFileCard.tsx b/src/features/authFiles/components/AuthFileCard.tsx index 5bec54e..f8f5f7e 100644 --- a/src/features/authFiles/components/AuthFileCard.tsx +++ b/src/features/authFiles/components/AuthFileCard.tsx @@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/Button'; import { LoadingSpinner } from '@/components/ui/LoadingSpinner'; import { ToggleSwitch } from '@/components/ui/ToggleSwitch'; -import { IconBot, IconCode, IconDownload, IconInfo, IconTrash2 } from '@/components/ui/icons'; +import { IconBot, IconCheck, IconCode, IconDownload, IconInfo, IconTrash2 } from '@/components/ui/icons'; import { ProviderStatusBar } from '@/components/providers/ProviderStatusBar'; import type { AuthFileItem } from '@/types'; import { resolveAuthProvider } from '@/utils/quota'; @@ -102,13 +102,16 @@ export function AuthFileCard(props: AuthFileCardProps) {
{!isRuntimeOnly && ( - onToggleSelect(file.name)} - aria-label={t('auth_files.batch_select_all')} - /> + )} (null); const [viewMode, setViewMode] = useState<'diagram' | 'list'>('list'); const floatingBatchActionsRef = useRef(null); + const previousSelectionCountRef = useRef(0); const { keyStats, usageDetails, loadKeyStats } = useAuthFilesStats(); const { @@ -331,6 +333,23 @@ export function AuthFilesPage() { }; }, [selectionCount]); + useLayoutEffect(() => { + const currentCount = selectionCount; + const previousCount = previousSelectionCountRef.current; + const actionsEl = floatingBatchActionsRef.current; + + if (currentCount > 0 && previousCount === 0 && actionsEl) { + gsap.killTweensOf(actionsEl); + gsap.fromTo( + actionsEl, + { y: 56, autoAlpha: 0 }, + { y: 0, autoAlpha: 1, duration: 0.28, ease: 'power3.out' } + ); + } + + previousSelectionCountRef.current = currentCount; + }, [selectionCount]); + const renderFilterTags = () => (
{existingTypes.map((type) => {