From f61688cac828dd136b45d0b6f9dcb53e4706a6de Mon Sep 17 00:00:00 2001 From: Nishal Poojary Date: Wed, 19 Nov 2025 15:57:11 +0530 Subject: [PATCH 1/3] feat: add tooltips to navbar elements --- .../components/Navigation/Navbar/Navbar.tsx | 83 +++++++++++++------ frontend/src/components/ThemeToggle.tsx | 83 +++++++++++-------- 2 files changed, 105 insertions(+), 61 deletions(-) diff --git a/frontend/src/components/Navigation/Navbar/Navbar.tsx b/frontend/src/components/Navigation/Navbar/Navbar.tsx index c565b7f6d..d369b3f0b 100644 --- a/frontend/src/components/Navigation/Navbar/Navbar.tsx +++ b/frontend/src/components/Navigation/Navbar/Navbar.tsx @@ -6,6 +6,11 @@ import { selectAvatar, selectName } from '@/features/onboardingSelectors'; import { clearSearch } from '@/features/searchSlice'; import { convertFileSrc } from '@tauri-apps/api/core'; import { FaceSearchDialog } from '@/components/Dialog/FaceSearchDialog'; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from '@/components/ui/tooltip'; export function Navbar() { const userName = useSelector(selectName); @@ -42,14 +47,20 @@ export function Navbar() { className="h-7 w-7 rounded object-cover" /> {isSearchActive && ( - + + + + + +

Clear search

+
+
)} )} @@ -62,16 +73,31 @@ export function Navbar() { /> {/* FaceSearch Dialog */} + + +
+ +
+
+ +

Search by face

+
+
- - - + {/* Search Button */} + + + + + +

Search images

+
+
@@ -82,15 +108,22 @@ export function Navbar() { Welcome {userName} - - User avatar - + + + + User avatar + + + +

Profile settings

+
+
); -} +} \ No newline at end of file diff --git a/frontend/src/components/ThemeToggle.tsx b/frontend/src/components/ThemeToggle.tsx index a21d592ee..3bea0f992 100644 --- a/frontend/src/components/ThemeToggle.tsx +++ b/frontend/src/components/ThemeToggle.tsx @@ -7,46 +7,57 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from '@/components/ui/tooltip'; import { useTheme } from '@/contexts/ThemeContext'; export function ThemeSelector() { const { setTheme } = useTheme(); return ( - - - - - - setTheme('light')} - > - Light - - setTheme('dark')} - > - Dark - - setTheme('system')} - > - System - - - + + + + + + + + setTheme('light')} + > + Light + + setTheme('dark')} + > + Dark + + setTheme('system')} + > + System + + + + + +

Toggle theme

+
+
); -} +} \ No newline at end of file From 7963b8fca7a301f685f5cd22555ed4bccdd4c2d1 Mon Sep 17 00:00:00 2001 From: Nishal Poojary Date: Wed, 19 Nov 2025 16:16:48 +0530 Subject: [PATCH 2/3] fix: move tooltip inside FaceSearchDialog for proper interaction --- .../components/Dialog/FaceSearchDialog.tsx | 41 ++++++++++++------- .../components/Navigation/Navbar/Navbar.tsx | 11 +---- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/Dialog/FaceSearchDialog.tsx b/frontend/src/components/Dialog/FaceSearchDialog.tsx index 6adab5794..b16d215f8 100644 --- a/frontend/src/components/Dialog/FaceSearchDialog.tsx +++ b/frontend/src/components/Dialog/FaceSearchDialog.tsx @@ -9,6 +9,11 @@ import { DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from '@/components/ui/tooltip'; import { useDispatch } from 'react-redux'; import { useFile } from '@/hooks/selectFile'; import { startSearch, clearSearch } from '@/features/searchSlice'; @@ -43,7 +48,7 @@ export function FaceSearchDialog() { showInfoDialog({ title: 'No Matches Found', message: - 'We couldn’t find any matching faces in your gallery for this photo.', + "We couldn't find any matching faces in your gallery for this photo.", variant: 'info', }), ); @@ -91,21 +96,29 @@ export function FaceSearchDialog() { return ( <> - - - + + + + + + + +

Search by face

+
+
- Face Detection Search + Search by Face Search for images containing specific faces by uploading a photo or using your webcam. @@ -150,4 +163,4 @@ export function FaceSearchDialog() { /> ); -} +} \ No newline at end of file diff --git a/frontend/src/components/Navigation/Navbar/Navbar.tsx b/frontend/src/components/Navigation/Navbar/Navbar.tsx index d369b3f0b..904e78648 100644 --- a/frontend/src/components/Navigation/Navbar/Navbar.tsx +++ b/frontend/src/components/Navigation/Navbar/Navbar.tsx @@ -73,16 +73,7 @@ export function Navbar() { /> {/* FaceSearch Dialog */} - - -
- -
-
- -

Search by face

-
-
+ {/* Search Button */} From 9632189403a8a5555ba1e475d2c3e909fcea89ad Mon Sep 17 00:00:00 2001 From: Nishal Poojary Date: Wed, 19 Nov 2025 16:26:57 +0530 Subject: [PATCH 3/3] fix: remove redundant onClick handler from DialogTrigger --- frontend/src/components/Dialog/FaceSearchDialog.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Dialog/FaceSearchDialog.tsx b/frontend/src/components/Dialog/FaceSearchDialog.tsx index b16d215f8..6330318c1 100644 --- a/frontend/src/components/Dialog/FaceSearchDialog.tsx +++ b/frontend/src/components/Dialog/FaceSearchDialog.tsx @@ -48,7 +48,7 @@ export function FaceSearchDialog() { showInfoDialog({ title: 'No Matches Found', message: - "We couldn't find any matching faces in your gallery for this photo.", + "We couldn't find any matching faces in your gallery for this photo.", variant: 'info', }), ); @@ -100,7 +100,6 @@ export function FaceSearchDialog() {