diff --git a/web/apps/photos/src/pages/gallery/index.tsx b/web/apps/photos/src/pages/gallery/index.tsx index adce308172..1876fca7f4 100644 --- a/web/apps/photos/src/pages/gallery/index.tsx +++ b/web/apps/photos/src/pages/gallery/index.tsx @@ -675,7 +675,7 @@ export default function Gallery() { useEffect(() => { // TODO-Cluster - if (process.env.NEXT_PUBLIC_ENTE_WIP_CL) { + if (process.env.NEXT_PUBLIC_ENTE_WIP_CL_AUTO) { setTimeout(() => { if (!wipHasSwitchedOnceCmpAndSet()) { void wipClusterEnable().then( diff --git a/web/packages/new/photos/components/MLSettings.tsx b/web/packages/new/photos/components/MLSettings.tsx index fb3e6ea008..08e17c7ff1 100644 --- a/web/packages/new/photos/components/MLSettings.tsx +++ b/web/packages/new/photos/components/MLSettings.tsx @@ -1,5 +1,5 @@ import { EnteDrawer } from "@/base/components/EnteDrawer"; -import { MenuItemGroup } from "@/base/components/Menu"; +import { MenuItemGroup, MenuSectionTitle } from "@/base/components/Menu"; import { Titlebar } from "@/base/components/Titlebar"; import { pt, ut } from "@/base/i18n"; import log from "@/base/log"; @@ -8,6 +8,7 @@ import { enableML, mlStatusSnapshot, mlStatusSubscribe, + wipCluster, wipClusterEnable, type MLStatus, } from "@/new/photos/services/ml"; @@ -339,9 +340,9 @@ const ManageML: React.FC = ({ }; // TODO-Cluster - // const wipClusterNow = () => void wipCluster(); const router = useRouter(); - const wipClusterNow = () => router.push("/cluster-debug"); + const wipClusterNow = () => wipCluster(); + const wipClusterShowNow = () => router.push("/cluster-debug"); return ( @@ -390,17 +391,30 @@ const ManageML: React.FC = ({ - {/* */} + /> + + )} + {showClusterOpt && ( + + + + + )} diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.ts index 9b8db7cb9c..f53e755502 100644 --- a/web/packages/new/photos/services/ml/index.ts +++ b/web/packages/new/photos/services/ml/index.ts @@ -411,21 +411,7 @@ export const wipClusterDebugPageContents = async (): Promise< return { faceFNs, clusters, clusterIDForFaceID }; }; -export const wipCluster = async () => { - if (!(await wipClusterEnable())) return; - - log.info("clustering"); - _wip_isClustering = true; - _wip_searchPersons = undefined; - triggerStatusUpdate(); - - const { clusters, cgroups } = await clusterFaces(await faceIndexes()); - const searchPersons = await convertToSearchPersons(clusters, cgroups); - - _wip_isClustering = false; - _wip_searchPersons = searchPersons; - triggerStatusUpdate(); -}; +export const wipCluster = () => void wipClusterDebugPageContents(); const convertToSearchPersons = async ( clusters: FaceCluster[],