Skip to content

armgit / ente

Public Imported from GitHub
0

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

Person mode - 1

Manav Rathia14160f7998f
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index ff2d054e92..b89c7e5763 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -15,6 +15,7 @@ import {
getLocalTrashedFiles,
} from "@/new/photos/services/files";
import { wipHasSwitchedOnceCmpAndSet } from "@/new/photos/services/ml";
+import type { Person } from "@/new/photos/services/ml/cgroups";
import {
filterSearchableFiles,
setSearchCollectionsAndFiles,
@@ -314,23 +315,25 @@ export default function Gallery() {
const closeAuthenticateUserModal = () =>
setAuthenticateUserModalView(false);
+ // `true` if we're displaying the hidden section.
+ //
+ // - The search bar is replaced by a navbar with a back button.
+ // - The collections bar shows only the hidden collections.
+ // - The gallery itself shows hidden items.
const [isInHiddenSection, setIsInHiddenSection] = useState(false);
+ // If set, then display files belonging to this person.
+ //
+ // - The search bar is replaced by a navbar with a back button.
+ // - The collections bar is hidden.
+ // - The gallery itself shows files which contain this person.
+ const [person, setPerson] = useState<Person | undefined>();
+
const [
filesDownloadProgressAttributesList,
setFilesDownloadProgressAttributesList,
] = useState<FilesDownloadProgressAttributes[]>([]);
- const openHiddenSection: GalleryContextType["openHiddenSection"] = (
- callback,
- ) => {
- authenticateUser(() => {
- setIsInHiddenSection(true);
- setActiveCollectionID(HIDDEN_ITEMS_SECTION);
- callback?.();
- });
- };
-
const [isClipSearchResult, setIsClipSearchResult] =
useState<boolean>(false);
@@ -1010,6 +1013,16 @@ export default function Gallery() {
setExportModalView(false);
};
+ const openHiddenSection: GalleryContextType["openHiddenSection"] = (
+ callback,
+ ) => {
+ authenticateUser(() => {
+ setIsInHiddenSection(true);
+ setActiveCollectionID(HIDDEN_ITEMS_SECTION);
+ callback?.();
+ });
+ };
+
const exitHiddenSection = () => {
setIsInHiddenSection(false);
setActiveCollectionID(ALL_SECTION);