π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix selection UI behavior around file context menu
Anand Baburajan5c97a79c3876
diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsxindex 3822de3a80..6e423d335f 100644--- a/web/apps/photos/src/components/FileList.tsx+++ b/web/apps/photos/src/components/FileList.tsx@@ -334,7 +334,6 @@ export const FileList: React.FC<FileListProps> = ({file: EnteFile;fileIndex: number;} | null>(null);- const isContextMenuOpen = contextMenu !== null;// Track selection state before right-click modified it.// If there are already 3 files explicitly selected via checkmarks,@@ -781,7 +780,8 @@ export const FileList: React.FC<FileListProps> = ({const renderListItem = useCallback((item: FileListItem, isScrolling: boolean) => {const haveSelection = selected.count > 0;- const showGroupCheckbox = haveSelection && !isContextMenuOpen;+ const showGroupCheckbox =+ haveSelection && !(contextMenu && selected.count === 1);switch (item.type) {case "date":return intersperseWithGaps(@@ -886,13 +886,13 @@ export const FileList: React.FC<FileListProps> = ({activeCollectionID,activePersonID,checkedTimelineDateStrings,+ contextMenu,emailByUserID,favoriteFileIDs,handleContextMenu,handleRangeSelect,handleSelect,hoverIndex,- isContextMenuOpen,isShiftKeyPressed,mode,onChangeSelectAllCheckBox,diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsxindex 24d167d41f..ecc78727a1 100644--- a/web/apps/photos/src/pages/gallery.tsx+++ b/web/apps/photos/src/pages/gallery.tsx@@ -182,6 +182,7 @@ const Page: React.FC = () => {const [state, dispatch] = useGalleryReducer();const [isFirstLoad, setIsFirstLoad] = useState(false);+ const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);const [selected, setSelected] = useState<SelectedState>({ownCount: 0,count: 0,@@ -194,7 +195,6 @@ const Page: React.FC = () => {[],);const [isFileViewerOpen, setIsFileViewerOpen] = useState(false);- const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);// Pending navigation from feed item clickconst [pendingFileNavigation, setPendingFileNavigation] = useState<{@@ -1544,7 +1544,7 @@ const Page: React.FC = () => {const showSelectionBar =selected.count > 0 &&selected.collectionID === activeCollectionID &&- !isContextMenuOpen;+ !(isContextMenuOpen && selected.count === 1);if (!user) {// Don't render until we dispatch "mount" with the logged in user.