Skip to content

armgit / ente

Public Imported from GitHub
0

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

Occam

Manav Rathidfa782068fc3
diff --git a/web/apps/photos/src/components/MemberSubscriptionManage.tsx b/web/apps/photos/src/components/MemberSubscriptionManage.tsx
index 71235e468f..5fec26cbdf 100644
--- a/web/apps/photos/src/components/MemberSubscriptionManage.tsx
+++ b/web/apps/photos/src/components/MemberSubscriptionManage.tsx
@@ -1,4 +1,4 @@
-import { useIsMobileWidth } from "@/base/hooks";
+import { useIsSmallWidth } from "@/base/hooks";
import { AppContext } from "@/new/photos/types/context";
import {
FlexWrapper,
@@ -13,7 +13,7 @@ import { getFamilyPlanAdmin } from "utils/user/family";
export function MemberSubscriptionManage({ open, userDetails, onClose }) {
const { setDialogMessage } = useContext(AppContext);
- const fullScreen = useIsMobileWidth();
+ const fullScreen = useIsSmallWidth();
async function onLeaveFamilyClick() {
try {
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 4158da8395..73b1b435f1 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -2,7 +2,7 @@ import { stashRedirect } from "@/accounts/services/redirect";
import { NavbarBase } from "@/base/components/Navbar";
import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
import { useModalVisibility } from "@/base/components/utils/modal";
-import { useIsMobileWidth } from "@/base/hooks";
+import { useIsSmallWidth } from "@/base/hooks";
import log from "@/base/log";
import type { Collection } from "@/media/collection";
import {
@@ -1428,13 +1428,13 @@ const SidebarButton: React.FC<IconButtonProps> = (props) => (
const UploadButton: React.FC<ButtonProps & IconButtonProps> = (props) => {
const disabled = !uploadManager.shouldAllowNewUpload();
- const isMobileWidth = useIsMobileWidth();
+ const isSmallWidth = useIsSmallWidth();
const icon = <FileUploadOutlinedIcon />;
return (
<Box>
- {isMobileWidth ? (
+ {isSmallWidth ? (
<IconButton {...props} disabled={disabled}>
{icon}
</IconButton>
diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsx
index 07515c9636..c7e567419a 100644
--- a/web/apps/photos/src/pages/shared-albums.tsx
+++ b/web/apps/photos/src/pages/shared-albums.tsx
@@ -2,7 +2,7 @@ import { EnteLogoSVG } from "@/base/components/EnteLogo";
import { ActivityIndicator } from "@/base/components/mui/ActivityIndicator";
import { NavbarBase, SelectionBar } from "@/base/components/Navbar";
import { sharedCryptoWorker } from "@/base/crypto";
-import { useIsMobileWidth, useIsTouchscreen } from "@/base/hooks";
+import { useIsSmallWidth, useIsTouchscreen } from "@/base/hooks";
import log from "@/base/log";
import type { Collection } from "@/media/collection";
import {
@@ -603,13 +603,13 @@ const EnteLogoLink = styled("a")(({ theme }) => ({
const AddPhotosButton: React.FC<ButtonProps & IconButtonProps> = (props) => {
const disabled = !uploadManager.shouldAllowNewUpload();
- const isMobileWidth = useIsMobileWidth();
+ const isSmallWidth = useIsSmallWidth();
const icon = <AddPhotoAlternateOutlined />;
return (
<Box>
- {isMobileWidth ? (
+ {isSmallWidth ? (
<IconButton {...props} disabled={disabled}>
{icon}
</IconButton>
diff --git a/web/packages/base/hooks.ts b/web/packages/base/hooks.ts
index 4620458e40..909fbbd179 100644
--- a/web/packages/base/hooks.ts
+++ b/web/packages/base/hooks.ts
@@ -1,16 +1,17 @@
import { useMediaQuery, useTheme } from "@mui/material";
/**
- * Return true if the screen width is classified as a "mobile" size.
+ * Return true if the screen width is classified as a small size. This is often
+ * treated as an (rather arbitrary) cutoff for "mobile" sized screens.
*
* We use the MUI "sm" (small, 600px) breakpoint as the cutoff. This hook will
* return true if the size of the window's width is less than 600px.
*/
-export const useIsMobileWidth = () =>
+export const useIsSmallWidth = () =>
useMediaQuery(useTheme().breakpoints.down("sm"));
/**
- * Heuristic "isMobileOrTablet" check using a pointer media query.
+ * Heuristic "isMobileOrTablet"-ish check using a pointer media query.
*
* The absence of fine-resolution pointing device can be taken a quick and proxy
* for detecting if the user is using a mobile or tablet.
diff --git a/web/packages/new/photos/components/DevSettings.tsx b/web/packages/new/photos/components/DevSettings.tsx
index 1c17b9cabc..263d19904a 100644
--- a/web/packages/new/photos/components/DevSettings.tsx
+++ b/web/packages/new/photos/components/DevSettings.tsx
@@ -1,5 +1,5 @@
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
-import { useIsMobileWidth } from "@/base/hooks";
+import { useIsSmallWidth } from "@/base/hooks";
import { ensureOk } from "@/base/http";
import { getKVS, removeKV, setKV } from "@/base/kv";
import log from "@/base/log";
@@ -33,7 +33,7 @@ interface DevSettingsProps {
* See: [Note: Configuring custom server].
*/
export const DevSettings: React.FC<DevSettingsProps> = ({ open, onClose }) => {
- const fullScreen = useIsMobileWidth();
+ const fullScreen = useIsSmallWidth();
const handleDialogClose: ModalProps["onClose"] = (_, reason: string) => {
// Don't close on backdrop clicks.
diff --git a/web/packages/new/photos/components/PeopleList.tsx b/web/packages/new/photos/components/PeopleList.tsx
index 4f54c9a164..327e112645 100644
--- a/web/packages/new/photos/components/PeopleList.tsx
+++ b/web/packages/new/photos/components/PeopleList.tsx
@@ -1,4 +1,4 @@
-import { useIsMobileWidth } from "@/base/hooks";
+import { useIsSmallWidth } from "@/base/hooks";
import { pt } from "@/base/i18n";
import { faceCrop, type AnnotatedFaceID } from "@/new/photos/services/ml";
import type { Person } from "@/new/photos/services/ml/people";
@@ -20,12 +20,12 @@ export const SearchPeopleList: React.FC<SearchPeopleListProps> = ({
people,
onSelectPerson,
}) => {
- const isMobileWidth = useIsMobileWidth();
+ const isSmallWidth = useIsSmallWidth();
return (
<SearchPeopleContainer
sx={{ justifyContent: people.length > 3 ? "center" : "start" }}
>
- {people.slice(0, isMobileWidth ? 6 : 7).map((person) => (
+ {people.slice(0, isSmallWidth ? 6 : 7).map((person) => (
<SearchPersonButton
key={person.id}
onClick={() => onSelectPerson(person)}
diff --git a/web/packages/new/photos/components/RecoveryKey.tsx b/web/packages/new/photos/components/RecoveryKey.tsx
index ece1eb50ed..17a1980bd8 100644
--- a/web/packages/new/photos/components/RecoveryKey.tsx
+++ b/web/packages/new/photos/components/RecoveryKey.tsx
@@ -1,7 +1,7 @@
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
import { errorDialogAttributes } from "@/base/components/utils/mini-dialog";
import type { ModalVisibilityProps } from "@/base/components/utils/modal";
-import { useIsMobileWidth } from "@/base/hooks";
+import { useIsSmallWidth } from "@/base/hooks";
import log from "@/base/log";
import { useAppContext } from "@/new/photos/types/context";
import { ensure } from "@/utils/ensure";
@@ -31,7 +31,7 @@ export const RecoveryKey: React.FC<ModalVisibilityProps> = ({
const { showMiniDialog } = useAppContext();
const [recoveryKey, setRecoveryKey] = useState<string | undefined>();
- const fullScreen = useIsMobileWidth();
+ const fullScreen = useIsSmallWidth();
const handleLoadError = useCallback(
(e: unknown) => {
diff --git a/web/packages/new/photos/components/SearchBar.tsx b/web/packages/new/photos/components/SearchBar.tsx
index 0c733e92fc..9414ef388c 100644
--- a/web/packages/new/photos/components/SearchBar.tsx
+++ b/web/packages/new/photos/components/SearchBar.tsx
@@ -1,5 +1,5 @@
import { assertionFailed } from "@/base/assert";
-import { useIsMobileWidth } from "@/base/hooks";
+import { useIsSmallWidth } from "@/base/hooks";
import { ItemCard, PreviewItemTile } from "@/new/photos/components/Tiles";
import {
isMLSupported,
@@ -104,11 +104,11 @@ export const SearchBar: React.FC<SearchBarProps> = ({
onShowSearchInput,
...rest
}) => {
- const isMobileWidth = useIsMobileWidth();
+ const isSmallWidth = useIsSmallWidth();
return (
<Box sx={{ flex: 1, px: ["4px", "24px"] }}>
- {isMobileWidth && !isInSearchMode ? (
+ {isSmallWidth && !isInSearchMode ? (
<MobileSearchArea onSearch={onShowSearchInput} />
) : (
<SearchInput {...{ isInSearchMode }} {...rest} />
diff --git a/web/packages/new/photos/components/WhatsNew.tsx b/web/packages/new/photos/components/WhatsNew.tsx
index 30bcb1f81a..e54d268c1f 100644
--- a/web/packages/new/photos/components/WhatsNew.tsx
+++ b/web/packages/new/photos/components/WhatsNew.tsx
@@ -1,6 +1,6 @@
import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
import { ensureElectron } from "@/base/electron";
-import { useIsMobileWidth } from "@/base/hooks";
+import { useIsSmallWidth } from "@/base/hooks";
import { ut } from "@/base/i18n";
import ArrowForward from "@mui/icons-material/ArrowForward";
import {
@@ -29,7 +29,7 @@ interface WhatsNewProps {
* last time this dialog was shown.
*/
export const WhatsNew: React.FC<WhatsNewProps> = ({ open, onClose }) => {
- const fullScreen = useIsMobileWidth();
+ const fullScreen = useIsSmallWidth();
useEffect(() => {
if (open) void didShowWhatsNew(ensureElectron());
diff --git a/web/packages/new/photos/components/gallery/BarImpl.tsx b/web/packages/new/photos/components/gallery/BarImpl.tsx
index 382b067652..1b2b2d4dc1 100644
--- a/web/packages/new/photos/components/gallery/BarImpl.tsx
+++ b/web/packages/new/photos/components/gallery/BarImpl.tsx
@@ -1,4 +1,4 @@
-import { useIsMobileWidth } from "@/base/hooks";
+import { useIsSmallWidth } from "@/base/hooks";
import { CollectionsSortOptions } from "@/new/photos/components/CollectionsSortOptions";
import { FilledIconButton } from "@/new/photos/components/mui";
import {
@@ -119,7 +119,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
activePerson,
onSelectPerson,
}) => {
- const isMobile = useIsMobileWidth();
+ const isSmallWidth = useIsSmallWidth();
const [canScrollLeft, setCanScrollLeft] = useState(false);
const [canScrollRight, setCanScrollRight] = useState(false);
@@ -226,7 +226,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
],
);
- const controls1 = isMobile && (
+ const controls1 = isSmallWidth && (
<Box display="flex" alignItems={"center"} gap={1} minHeight={"64px"}>
{mode != "people" && (
<>
@@ -243,7 +243,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
</Box>
);
- const controls2 = !isMobile && mode != "people" && (
+ const controls2 = !isSmallWidth && mode != "people" && (
<Box display="flex" alignItems={"center"} gap={1} height={"64px"}>
<CollectionsSortOptions
activeSortBy={collectionsSortBy}
diff --git a/web/packages/new/photos/components/gallery/PeopleHeader.tsx b/web/packages/new/photos/components/gallery/PeopleHeader.tsx
index f600ea50e8..a601484034 100644
--- a/web/packages/new/photos/components/gallery/PeopleHeader.tsx
+++ b/web/packages/new/photos/components/gallery/PeopleHeader.tsx
@@ -2,6 +2,7 @@ import {
useModalVisibility,
type ModalVisibilityProps,
} from "@/base/components/utils/modal";
+import { useIsSmallWidth } from "@/base/hooks";
import { pt } from "@/base/i18n";
import { deleteCGroup, renameCGroup } from "@/new/photos/services/ml";
import {
@@ -13,7 +14,7 @@ import OverflowMenu from "@ente/shared/components/OverflowMenu/menu";
import { OverflowMenuOption } from "@ente/shared/components/OverflowMenu/option";
import AddIcon from "@mui/icons-material/Add";
import EditIcon from "@mui/icons-material/Edit";
-import FaceRetouchingNatural from "@mui/icons-material/FaceRetouchingNatural";
+import ListAltOutlined from "@mui/icons-material/ListAltOutlined";
import MoreHoriz from "@mui/icons-material/MoreHoriz";
import { Dialog, DialogTitle, IconButton, Stack, Tooltip } from "@mui/material";
import { ClearIcon } from "@mui/x-date-pickers";
@@ -141,7 +142,7 @@ const CGroupPersonHeader: React.FC<CGroupPersonHeaderProps> = ({
</OverflowMenuOption>
{process.env.NEXT_PUBLIC_ENTE_WIP_CL /* TODO-Cluster */ && (
<OverflowMenuOption
- startIcon={<FaceRetouchingNatural />}
+ startIcon={<ListAltOutlined />}
centerAlign
onClick={showSuggestions}
>
@@ -228,9 +229,11 @@ const SuggestionsDialog: React.FC<SuggestionsDialogProps> = ({
person,
...rest
}) => {
+ const isSmallWidth = useIsSmallWidth();
+
console.log(person);
return (
- <Dialog {...rest}>
+ <Dialog {...rest} maxWidth="sm" fullWidth fullScreen={isSmallWidth}>
<DialogTitle>Test</DialogTitle>
</Dialog>
);