From 64b5162000d1d29e549177c349815f2f8284fa52 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 30 Dec 2025 15:23:54 -0700 Subject: [PATCH] Improve usability of GenAI summary dialog and make clicking on the description directly open it --- web/public/locales/en/views/explore.json | 3 +++ .../components/overlay/chip/GenAISummaryChip.tsx | 14 +++++++++----- web/src/components/timeline/DetailStream.tsx | 14 +++++++++++++- web/src/views/recording/RecordingView.tsx | 13 ++++++++++--- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/web/public/locales/en/views/explore.json b/web/public/locales/en/views/explore.json index ff95e2fc6..53b04e6c4 100644 --- a/web/public/locales/en/views/explore.json +++ b/web/public/locales/en/views/explore.json @@ -166,6 +166,9 @@ "tips": { "descriptionSaved": "Successfully saved description", "saveDescriptionFailed": "Failed to update the description: {{errorMessage}}" + }, + "title": { + "label": "Title" } }, "itemMenu": { diff --git a/web/src/components/overlay/chip/GenAISummaryChip.tsx b/web/src/components/overlay/chip/GenAISummaryChip.tsx index 64eb4a10b..ead0104b1 100644 --- a/web/src/components/overlay/chip/GenAISummaryChip.tsx +++ b/web/src/components/overlay/chip/GenAISummaryChip.tsx @@ -6,16 +6,15 @@ import { ThreatLevel, THREAT_LEVEL_LABELS, } from "@/types/review"; -import { useEffect, useMemo, useState } from "react"; +import React, { useEffect, useMemo, useState } from "react"; import { isDesktop } from "react-device-detect"; import { useTranslation } from "react-i18next"; import { MdAutoAwesome } from "react-icons/md"; type GenAISummaryChipProps = { review?: ReviewSegment; - onClick: () => void; }; -export function GenAISummaryChip({ review, onClick }: GenAISummaryChipProps) { +export function GenAISummaryChip({ review }: GenAISummaryChipProps) { const [isVisible, setIsVisible] = useState(false); useEffect(() => { @@ -29,7 +28,6 @@ export function GenAISummaryChip({ review, onClick }: GenAISummaryChipProps) { isVisible ? "translate-y-0 opacity-100" : "-translate-y-4 opacity-0", isDesktop ? "bg-card" : "bg-secondary-foreground", )} - onClick={onClick} > {review?.data.metadata?.title} @@ -40,10 +38,12 @@ export function GenAISummaryChip({ review, onClick }: GenAISummaryChipProps) { type GenAISummaryDialogProps = { review?: ReviewSegment; onOpen?: (open: boolean) => void; + children: React.ReactNode; }; export function GenAISummaryDialog({ review, onOpen, + children, }: GenAISummaryDialogProps) { const { t } = useTranslation(["views/explore"]); @@ -104,7 +104,7 @@ export function GenAISummaryDialog({ return ( - setOpen(true)} /> +
{children}
{t("aiAnalysis.title")} +
+ {t("details.title.label")} +
+
{aiAnalysis.title}
{t("details.description.label")}
diff --git a/web/src/components/timeline/DetailStream.tsx b/web/src/components/timeline/DetailStream.tsx index 2444aa92e..9258ca457 100644 --- a/web/src/components/timeline/DetailStream.tsx +++ b/web/src/components/timeline/DetailStream.tsx @@ -31,6 +31,7 @@ import { PiSlidersHorizontalBold } from "react-icons/pi"; import { MdAutoAwesome } from "react-icons/md"; import { isPWA } from "@/utils/isPWA"; import { isInIframe } from "@/utils/isIFrame"; +import { GenAISummaryDialog } from "../overlay/chip/GenAISummaryChip"; type DetailStreamProps = { reviewItems?: ReviewSegment[]; @@ -438,7 +439,18 @@ function ReviewGroup({ {review.data.metadata.title} - {review.data.metadata.title} + { + if (open) { + onSeek(review.start_time, false); + } + }} + > + + {review.data.metadata.title} + + )}
diff --git a/web/src/views/recording/RecordingView.tsx b/web/src/views/recording/RecordingView.tsx index b0dde285a..aee3d09da 100644 --- a/web/src/views/recording/RecordingView.tsx +++ b/web/src/views/recording/RecordingView.tsx @@ -66,7 +66,10 @@ import { import { CameraNameLabel } from "@/components/camera/FriendlyNameLabel"; import { useAllowedCameras } from "@/hooks/use-allowed-cameras"; import { DetailStreamProvider } from "@/context/detail-stream-context"; -import { GenAISummaryDialog } from "@/components/overlay/chip/GenAISummaryChip"; +import { + GenAISummaryDialog, + GenAISummaryChip, +} from "@/components/overlay/chip/GenAISummaryChip"; const DATA_REFRESH_TIME = 600000; // 10 minutes @@ -739,7 +742,9 @@ export function RecordingView({ + > + + )} {isMobile && timelineType == "timeline" && ( - + + + )} {timelineType != "detail" && (