From 5efabb8e0cbc846d022f69176c675a9da7a6c39e Mon Sep 17 00:00:00 2001 From: shittu adewale Date: Tue, 27 Oct 2026 06:47:22 +0100 Subject: [PATCH 1/5] feat: enhance navbar and user profile layouts, improve prediction handling, and update recent activities UI --- .../src/components/layouts/navbar/navbar.tsx | 42 +++++- .../layouts/user-profile-layout.tsx | 2 +- .../src/components/ui/button/back-button.tsx | 10 +- .../components/advanced-settings-panel.tsx | 6 +- .../__tests__/prediction-confidence.test.tsx | 126 ++++++++++++++++++ .../components/map/draggable-grid.tsx | 9 +- .../map/try-fair-prediction-results.tsx | 9 +- .../components/prediction-history-button.tsx | 2 +- .../map-requests-actions-menu.tsx | 26 ++-- .../__tests__/overview-mapping.test.tsx | 2 +- .../components/overview/advanced-overview.tsx | 8 +- .../components/overview/basic-overview.tsx | 11 +- .../components/overview/overview-hero.tsx | 4 +- .../components/overview/recent-activities.tsx | 18 +-- .../overview/recent-mapping-card.tsx | 16 +-- .../components/page-empty-state.tsx | 2 +- .../components/profile-section-header.tsx | 4 +- 17 files changed, 235 insertions(+), 62 deletions(-) create mode 100644 frontend/src/features/try-fair/components/map/__tests__/prediction-confidence.test.tsx diff --git a/frontend/src/components/layouts/navbar/navbar.tsx b/frontend/src/components/layouts/navbar/navbar.tsx index 54f689101..93722f7f0 100644 --- a/frontend/src/components/layouts/navbar/navbar.tsx +++ b/frontend/src/components/layouts/navbar/navbar.tsx @@ -7,7 +7,7 @@ import { DashboardLink } from "./dashboard-link"; import { NavLogo } from "@/components/layouts"; import { APPLICATION_ROUTES, SHARED_CONTENT } from "@/constants"; import { useAuth } from "@/app/providers/auth-provider"; -import { useLocation, useNavigate } from "react-router-dom"; +import { useLocation, useMatch, useNavigate } from "react-router-dom"; import { useState } from "react"; // import { UserNotifications } from "@/features/user-profile/components/notifications/user-notifications"; import { AUTH_PROVIDER, FRONTEND_URL } from "@/config"; @@ -23,6 +23,8 @@ import { import { BackButton } from "@/components/ui/button"; import { useNavbarState } from "@/components/layouts/navbar/hooks/use-navbar-state"; import { CloudSaveStatus } from "@/components/layouts/navbar/cloud-save-status"; +import { useGetSinglePrediction } from "@/features/user-profile/hooks/use-predictions"; +import type { TOfflinePrediction } from "@/types"; const IS_HANKO_AUTH = AUTH_PROVIDER === "hanko"; @@ -41,6 +43,15 @@ export const NavBar = () => { showDashboardLink, isMapRequestResult, } = useNavbarState(); + const resultMatch = useMatch(APPLICATION_ROUTES.MAP_REQUEST_RESULT); + const initialPrediction = ( + location.state as { prediction?: TOfflinePrediction } | null + )?.prediction; + const { data: prediction } = useGetSinglePrediction( + resultMatch?.params.id, + isMapRequestResult ? initialPrediction : undefined, + ); + const resultTitle = prediction?.description || "Map Request Result"; const isTryFairPage = location.pathname.includes(APPLICATION_ROUTES.TRY_FAIR); const isProfilePage = location.pathname.includes( @@ -100,19 +111,40 @@ export const NavBar = () => {