Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Provide both options

Manav Rathi14ac034c0ba5
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<ManageMLProps> = ({
};
// 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 (
<Stack px={"16px"} py={"20px"} gap={4}>
@@ -390,17 +391,30 @@ const ManageML: React.FC<ManageMLProps> = ({
<Box>
<MenuItemGroup>
<EnteMenuItem
- label={ut(
- "View clusters ––– internal only option",
- )}
+ label={ut("Create clusters β€’ internal only option")}
onClick={wipClusterNow}
/>
</MenuItemGroup>
- {/* <MenuSectionTitle
+ <MenuSectionTitle
title={ut(
- "Create clusters locally, afresh and in-memory. Existing local clusters will be overwritten. Nothing will be saved or synced to remote.",
+ "Create clusters locally, afresh and in-memory. Nothing will be saved or synced to remote. You can view the results in search dropdown.",
)}
- /> */}
+ />
+ </Box>
+ )}
+ {showClusterOpt && (
+ <Box>
+ <MenuItemGroup>
+ <EnteMenuItem
+ label={ut("View clusters β€’ internal only option")}
+ onClick={wipClusterShowNow}
+ />
+ </MenuItemGroup>
+ <MenuSectionTitle
+ title={ut(
+ "Variant of above that opens a page with debug info. WARNING: Unoptimized, likely will cause a crash for accounts with few k photos.",
+ )}
+ />
</Box>
)}
</Stack>
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[],