From c7dd5dcbcaa26a53d66aa00f8dc31f8a3a58db93 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 10 Oct 2024 09:59:08 +0530 Subject: [PATCH] zi --- web/apps/accounts/src/pages/_app.tsx | 1 - web/apps/auth/src/pages/_app.tsx | 1 - .../src/components/Collections/AlbumCastDialog.tsx | 3 ++- .../photos/src/components/FilesDownloadProgress.tsx | 3 ++- .../PhotoViewer/FileInfo/FileNameEditDialog.tsx | 3 ++- .../src/components/PhotoViewer/FileInfo/index.tsx | 4 ++-- .../PhotoViewer/ImageEditorOverlay/index.tsx | 3 ++- web/apps/photos/src/pages/_app.tsx | 5 +++-- .../new/photos/components/PhotoDateTimePicker.tsx | 4 ++-- web/packages/new/photos/components/z-index.tsx | 12 ++++++++++++ 10 files changed, 27 insertions(+), 12 deletions(-) diff --git a/web/apps/accounts/src/pages/_app.tsx b/web/apps/accounts/src/pages/_app.tsx index e23692b86e..4c46ed4e56 100644 --- a/web/apps/accounts/src/pages/_app.tsx +++ b/web/apps/accounts/src/pages/_app.tsx @@ -56,7 +56,6 @@ const App: React.FC = ({ Component, pageProps }) => { = ({ Component, pageProps }) => { = ({ open={open} onClose={onClose} title={t("cast_album_to_tv")} - sx={{ zIndex: 1600 }} + sx={{ zIndex: photosDialogZIndex }} > {view == "choose" && ( diff --git a/web/apps/photos/src/components/FilesDownloadProgress.tsx b/web/apps/photos/src/components/FilesDownloadProgress.tsx index 86e5e0508c..7b82b17ee4 100644 --- a/web/apps/photos/src/components/FilesDownloadProgress.tsx +++ b/web/apps/photos/src/components/FilesDownloadProgress.tsx @@ -1,3 +1,4 @@ +import { photosDialogZIndex } from "@/new/photos/components/z-index"; import { AppContext } from "@/new/photos/types/context"; import Notification from "components/Notification"; import { t } from "i18next"; @@ -123,7 +124,7 @@ export const FilesDownloadProgress: React.FC = ({ horizontal="left" sx={{ "&&": { bottom: `${index * 80 + 20}px` }, - zIndex: 1600, + zIndex: photosDialogZIndex, }} open={isFilesDownloadStarted(attributes)} onClose={handleClose(attributes)} diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/FileNameEditDialog.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/FileNameEditDialog.tsx index 886328ddbf..555b52ad0c 100644 --- a/web/apps/photos/src/components/PhotoViewer/FileInfo/FileNameEditDialog.tsx +++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/FileNameEditDialog.tsx @@ -1,4 +1,5 @@ import { TitledMiniDialog } from "@/base/components/MiniDialog"; +import { photosDialogZIndex } from "@/new/photos/components/z-index"; import SingleInputForm, { type SingleInputFormProps, } from "@ente/shared/components/SingleInputForm"; @@ -24,7 +25,7 @@ export const FileNameEditDialog = ({ }; return ( ( ))({ - zIndex: photoSwipeZIndex + 1, + zIndex: fileInfoDrawerZIndex, "& .MuiPaper-root": { padding: 8, }, diff --git a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx index 7be07c08e4..02cd636e09 100644 --- a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx @@ -6,6 +6,7 @@ import { } from "@/base/components/Menu"; import { nameAndExtension } from "@/base/file"; import log from "@/base/log"; +import { photosDialogZIndex } from "@/new/photos/components/z-index"; import downloadManager from "@/new/photos/services/download"; import { AppContext } from "@/new/photos/types/context"; import { EnteFile } from "@/new/photos/types/file"; @@ -522,7 +523,7 @@ const ImageEditorOverlay = (props: IProps) => { = ({ photo viewer and the info drawer */ dialog: { sx: { - zIndex: photoSwipeZIndex + 2, + zIndex: fileInfoDrawerZIndex + 1, }, }, }} diff --git a/web/packages/new/photos/components/z-index.tsx b/web/packages/new/photos/components/z-index.tsx index e66e8435c8..a988a362b6 100644 --- a/web/packages/new/photos/components/z-index.tsx +++ b/web/packages/new/photos/components/z-index.tsx @@ -3,3 +3,15 @@ * than that for our drawers and dialogs to get them to show above it. */ export const photoSwipeZIndex = 1500; + +/** + * The file info drawer needs to be higher than the photo viewer. + */ +export const fileInfoDrawerZIndex = photoSwipeZIndex + 1; + +/** + * Dialogs (not necessarily always) need to be higher still so to ensure they + * are visible above the drawer in case they are shown in response to some + * action taken in the file info drawer. + */ +export const photosDialogZIndex = 1600;