From b1fdcfbb1be1e1e0a69e51275d4e44407e56726c Mon Sep 17 00:00:00 2001 From: Wikid82 Date: Tue, 25 Nov 2025 22:23:02 +0000 Subject: [PATCH] feat: add HelpTooltip component for improved OAuth field guidance --- frontend/src/pages/Security/Providers.tsx | 101 ++++++++++++++-------- 1 file changed, 66 insertions(+), 35 deletions(-) diff --git a/frontend/src/pages/Security/Providers.tsx b/frontend/src/pages/Security/Providers.tsx index 6ed02ccc..876de7a3 100644 --- a/frontend/src/pages/Security/Providers.tsx +++ b/frontend/src/pages/Security/Providers.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useState, useRef } from 'react'; import { useAuthProviders } from '../../hooks/useSecurity'; import { Button } from '../../components/ui/Button'; import { Plus, Edit, Trash2, Globe } from 'lucide-react'; @@ -19,6 +19,47 @@ interface ProviderFormData { enabled: boolean; } +interface HelpTooltipProps { + content: React.ReactNode; + position?: 'left' | 'right'; +} + +const HelpTooltip = ({ content, position = 'left' }: HelpTooltipProps) => { + const [isOpen, setIsOpen] = useState(false); + const timeoutRef = useRef | null>(null); + + const handleMouseEnter = () => { + if (timeoutRef.current) clearTimeout(timeoutRef.current); + setIsOpen(true); + }; + + const handleMouseLeave = () => { + timeoutRef.current = setTimeout(() => { + setIsOpen(false); + }, 300); + }; + + return ( +
+ + {isOpen && ( +
+ {content} +
+
+ )} +
+ ); +}; + export default function Providers() { const { providers, createProvider, updateProvider, deleteProvider, isLoading } = useAuthProviders(); const [isModalOpen, setIsModalOpen] = useState(false); @@ -230,23 +271,18 @@ export default function Providers() {
-
- -
-
The public identifier for your OAuth application.
- -
-
-
+ +
The public identifier for your OAuth application.
+ + + } + />
{editingProvider ? 'Client Secret (leave blank to keep)' : 'Client Secret'} -
- -
-
The private key for your OAuth application. Keep this secret and secure!
- -
-
-
+ +
The private key for your OAuth application. Keep this secret and secure!
+
+ + +
+ + } + />