π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
refractor(locker):update-folder-structure
Aswin Asokf5f176b5e1ca
diff --git a/web/apps/locker/src/components/LockerNavbar.tsx b/web/apps/locker/src/components/LockerNavbar.tsxindex c2036c7586..f57414a437 100644--- a/web/apps/locker/src/components/LockerNavbar.tsx+++ b/web/apps/locker/src/components/LockerNavbar.tsx@@ -11,7 +11,7 @@ import {import { t } from "i18next";import React, { useDeferredValue, useEffect, useState } from "react";-import { lockerContentMaxWidth } from "./locker-tokens";+import { lockerContentMaxWidth } from "../styles/tokens";interface LockerNavbarProps {onOpenSidebar: () => void;diff --git a/web/apps/locker/src/components/LockerAuthShell.tsx b/web/apps/locker/src/components/auth/LockerAuthShell.tsxsimilarity index 100%rename from web/apps/locker/src/components/LockerAuthShell.tsxrename to web/apps/locker/src/components/auth/LockerAuthShell.tsxdiff --git a/web/apps/locker/src/components/LockerAuthenticateUser.tsx b/web/apps/locker/src/components/auth/LockerAuthenticateUser.tsxsimilarity index 98%rename from web/apps/locker/src/components/LockerAuthenticateUser.tsxrename to web/apps/locker/src/components/auth/LockerAuthenticateUser.tsxindex 39fe15e398..631feccc66 100644--- a/web/apps/locker/src/components/LockerAuthenticateUser.tsx+++ b/web/apps/locker/src/components/auth/LockerAuthenticateUser.tsx@@ -28,16 +28,16 @@ import log from "ente-base/log";import { t } from "i18next";import React, { useCallback, useEffect, useState } from "react";-import { FormField } from "./createItemDialog/ItemFormFields";+import { FormField } from "@/components/ui/FormField";import {lockerSheetContainerSx,lockerSheetPaperSx,-} from "./locker-dialog-styles";+} from "../../styles/dialog";import {lockerColorSx,lockerTextBodyBoldSx,lockerTextH2Sx,-} from "./locker-tokens";+} from "../../styles/tokens";type LockerAuthenticateUserProps = ModalVisibilityProps & {onAuthenticate: () => void;diff --git a/web/apps/locker/src/components/lockerPage/DeleteCollectionDialog.tsx b/web/apps/locker/src/components/collections/DeleteCollectionDialog.tsxsimilarity index 89%rename from web/apps/locker/src/components/lockerPage/DeleteCollectionDialog.tsxrename to web/apps/locker/src/components/collections/DeleteCollectionDialog.tsxindex 2df9359bf9..913a69175a 100644--- a/web/apps/locker/src/components/lockerPage/DeleteCollectionDialog.tsx+++ b/web/apps/locker/src/components/collections/DeleteCollectionDialog.tsx@@ -1,7 +1,7 @@-import { LockerConfirmDialog } from "@/components/LockerConfirmDialog";+import { LockerConfirmDialog } from "@/components/ui/LockerConfirmDialog";import { t } from "i18next";import React from "react";-import type { DeleteCollectionDialogState } from "./use-locker-actions";+import type { DeleteCollectionDialogState } from "../locker/use-locker-actions";interface DeleteCollectionDialogProps {dialogState: DeleteCollectionDialogState | null;diff --git a/web/apps/locker/src/components/LockerCollectionShareDrawer.tsx b/web/apps/locker/src/components/collections/LockerCollectionShareDrawer.tsxsimilarity index 98%rename from web/apps/locker/src/components/LockerCollectionShareDrawer.tsxrename to web/apps/locker/src/components/collections/LockerCollectionShareDrawer.tsxindex 87ce76141c..032e916728 100644--- a/web/apps/locker/src/components/LockerCollectionShareDrawer.tsx+++ b/web/apps/locker/src/components/collections/LockerCollectionShareDrawer.tsx@@ -1,4 +1,8 @@-import { LockerMenuOption, LockerOverflowMenu } from "@/components/LockerMenu";+import { FormField } from "@/components/ui/FormField";+import {+ LockerMenuOption,+ LockerOverflowMenu,+} from "@/components/ui/LockerMenu";import {canLeaveCollection,canManageCollectionSharing,@@ -27,23 +31,22 @@ import {} from "ente-contacts";import { t } from "i18next";import React, { useEffect, useMemo, useState } from "react";-import { LockerConfirmDialog } from "./LockerConfirmDialog";-import {- LockerSidebarDrawer,- LockerSidebarTitlebar,-} from "./LockerSidebarShell";-import { FormField } from "./createItemDialog/ItemFormFields";import {lockerSheetContainerSx,lockerSheetPaperSx,-} from "./locker-dialog-styles";+} from "../../styles/dialog";import {lockerColorSx,lockerTextBodyBoldSx,lockerTextBodySx,lockerTextH2Sx,lockerTextMiniSx,-} from "./locker-tokens";+} from "../../styles/tokens";+import {+ LockerSidebarDrawer,+ LockerSidebarTitlebar,+} from "../sidebar/LockerSidebarShell";+import { LockerConfirmDialog } from "../ui/LockerConfirmDialog";interface LockerCollectionShareDrawerProps {open: boolean;diff --git a/web/apps/locker/src/components/createItemDialog/CollectionChipRow.tsx b/web/apps/locker/src/components/create-item/CollectionChipRow.tsxsimilarity index 100%rename from web/apps/locker/src/components/createItemDialog/CollectionChipRow.tsxrename to web/apps/locker/src/components/create-item/CollectionChipRow.tsxdiff --git a/web/apps/locker/src/components/createItemDialog/CreateCollectionRow.tsx b/web/apps/locker/src/components/create-item/CreateCollectionRow.tsxsimilarity index 94%rename from web/apps/locker/src/components/createItemDialog/CreateCollectionRow.tsxrename to web/apps/locker/src/components/create-item/CreateCollectionRow.tsxindex 5ef3c0afba..dd40d974ed 100644--- a/web/apps/locker/src/components/createItemDialog/CreateCollectionRow.tsx+++ b/web/apps/locker/src/components/create-item/CreateCollectionRow.tsx@@ -1,7 +1,4 @@-import {- lockerFieldSx,- lockerPrimaryButtonSx,-} from "@/components/createItemDialog/create-item-dialog-styles";+import { lockerFieldSx, lockerPrimaryButtonSx } from "@/styles/fields";import { Tick02Icon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import { Stack, TextField } from "@mui/material";diff --git a/web/apps/locker/src/components/CreateItemDialog.tsx b/web/apps/locker/src/components/create-item/CreateItemDialog.tsxsimilarity index 97%rename from web/apps/locker/src/components/CreateItemDialog.tsxrename to web/apps/locker/src/components/create-item/CreateItemDialog.tsxindex 925d6df76f..3e0bd36628 100644--- a/web/apps/locker/src/components/CreateItemDialog.tsx+++ b/web/apps/locker/src/components/create-item/CreateItemDialog.tsx@@ -1,25 +1,25 @@-import {- lockerHeaderIconButtonSx,- lockerPrimaryButtonSx,- lockerScrollAreaSx,-} from "@/components/createItemDialog/create-item-dialog-styles";+import { lockerScrollAreaSx } from "@/components/create-item/create-item-dialog-styles";import {addCollectionName,toggleCollectionName,uploadQueueItemKey,-} from "@/components/createItemDialog/file-upload-helpers";-import { FileUploadSection } from "@/components/createItemDialog/FileUploadSection";-import { typeDisplayName } from "@/components/createItemDialog/item-form-fields-utils";+} from "@/components/create-item/file-upload-helpers";+import { FileUploadSection } from "@/components/create-item/FileUploadSection";+import { typeDisplayName } from "@/components/create-item/item-form-fields-utils";import {CollectionSelector,ItemFormFields,-} from "@/components/createItemDialog/ItemFormFields";+} from "@/components/create-item/ItemFormFields";import {createDocumentIconConfig,lockerItemIconConfig,-} from "@/components/locker-item-icons";+} from "@/components/items/locker-item-icons";import type { LockerUploadLimitState } from "@/services/locker-limits";import type { LockerUploadProgress } from "@/services/remote";+import {+ lockerHeaderIconButtonSx,+ lockerPrimaryButtonSx,+} from "@/styles/fields";import type {LockerCollection,LockerItemType,@@ -51,7 +51,7 @@ import {type CreateItemDialogEditItem,type CreateOption,useCreateItemDialogState,-} from "./createItemDialog/use-create-item-dialog-state";+} from "./use-create-item-dialog-state";const CREATABLE_TYPES: {type: CreateOption;diff --git a/web/apps/locker/src/components/createItemDialog/FileUploadSection.tsx b/web/apps/locker/src/components/create-item/FileUploadSection.tsxsimilarity index 98%rename from web/apps/locker/src/components/createItemDialog/FileUploadSection.tsxrename to web/apps/locker/src/components/create-item/FileUploadSection.tsxindex 13642fd2c1..79678fe2f0 100644--- a/web/apps/locker/src/components/createItemDialog/FileUploadSection.tsx+++ b/web/apps/locker/src/components/create-item/FileUploadSection.tsx@@ -1,11 +1,9 @@-import { CollectionChipRow } from "@/components/createItemDialog/CollectionChipRow";-import {- lockerPrimaryButtonSx,- lockerScrollAreaSx,-} from "@/components/createItemDialog/create-item-dialog-styles";-import { CreateCollectionRow } from "@/components/createItemDialog/CreateCollectionRow";-import { lockerItemIcon } from "@/components/locker-item-icons";+import { CollectionChipRow } from "@/components/create-item/CollectionChipRow";+import { lockerScrollAreaSx } from "@/components/create-item/create-item-dialog-styles";+import { CreateCollectionRow } from "@/components/create-item/CreateCollectionRow";+import { lockerItemIcon } from "@/components/items/locker-item-icons";import type { LockerUploadProgress } from "@/services/remote";+import { lockerPrimaryButtonSx } from "@/styles/fields";import type { LockerCollection, LockerUploadCandidate } from "@/types";import { Cancel01Icon, FileUploadIcon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";diff --git a/web/apps/locker/src/components/createItemDialog/ItemFormFields.tsx b/web/apps/locker/src/components/create-item/ItemFormFields.tsxsimilarity index 86%rename from web/apps/locker/src/components/createItemDialog/ItemFormFields.tsxrename to web/apps/locker/src/components/create-item/ItemFormFields.tsxindex 0293a8114b..3c6cfaea1e 100644--- a/web/apps/locker/src/components/createItemDialog/ItemFormFields.tsx+++ b/web/apps/locker/src/components/create-item/ItemFormFields.tsx@@ -1,6 +1,6 @@-import { CollectionChipRow } from "@/components/createItemDialog/CollectionChipRow";-import { lockerFieldSx } from "@/components/createItemDialog/create-item-dialog-styles";-import { CreateCollectionRow } from "@/components/createItemDialog/CreateCollectionRow";+import { CollectionChipRow } from "@/components/create-item/CollectionChipRow";+import { CreateCollectionRow } from "@/components/create-item/CreateCollectionRow";+import { FormField } from "@/components/ui/FormField";import type { LockerCollection, LockerItemType } from "@/types";import VisibilityIcon from "@mui/icons-material/Visibility";import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";@@ -9,71 +9,10 @@ import {IconButton,InputAdornment,Stack,- TextField,Typography,- type TextFieldProps,} from "@mui/material";import { t } from "i18next";-import React, { useCallback, useId, useMemo, useState } from "react";--type FormFieldProps = Omit<TextFieldProps, "label"> & {- label: string;- multilineMinHeight?: number;-};--export function FormField({- label,- required,- multiline,- multilineMinHeight,- ...rest-}: FormFieldProps) {- const id = useId();-- return (- <Stack sx={{ gap: "8px" }}>- <Typography- variant="small"- component="label"- htmlFor={id}- sx={{- fontWeight: 500,- lineHeight: "20px",- display: "flex",- gap: "2px",- color: "text.base",- }}- >- {label}- {required && (- <Box- component="span"- aria-hidden- sx={{ color: "critical.main", fontWeight: 600 }}- >- *- </Box>- )}- </Typography>- <TextField- {...rest}- id={id}- required={required}- multiline={multiline}- hiddenLabel- fullWidth- variant="outlined"- margin="none"- sx={(theme) =>- lockerFieldSx(theme, {- multiline,- minHeight: multilineMinHeight,- })- }- />- </Stack>- );-}+import React, { useCallback, useMemo, useState } from "react";export const ItemFormFields: React.FC<{type: LockerItemType;diff --git a/web/apps/locker/src/components/create-item/create-item-dialog-styles.ts b/web/apps/locker/src/components/create-item/create-item-dialog-styles.tsnew file mode 100644index 0000000000..51960d32bb--- /dev/null+++ b/web/apps/locker/src/components/create-item/create-item-dialog-styles.ts@@ -0,0 +1,18 @@+import type { Theme } from "@mui/material/styles";++export const lockerScrollAreaSx = (theme: Theme) => ({+ overflowY: "auto",+ marginRight: "-14px",+ paddingRight: "14px",+ scrollbarWidth: "thin",+ scrollbarColor: `${theme.vars.palette.fill.muted} transparent`,+ "&::-webkit-scrollbar": { width: 6 },+ "&::-webkit-scrollbar-track": { background: "transparent" },+ "&::-webkit-scrollbar-thumb": {+ borderRadius: "999px",+ backgroundColor: theme.vars.palette.fill.muted,+ },+ "&::-webkit-scrollbar-thumb:hover": {+ backgroundColor: theme.vars.palette.stroke.muted,+ },+});diff --git a/web/apps/locker/src/components/createItemDialog/file-upload-helpers.ts b/web/apps/locker/src/components/create-item/file-upload-helpers.tssimilarity index 100%rename from web/apps/locker/src/components/createItemDialog/file-upload-helpers.tsrename to web/apps/locker/src/components/create-item/file-upload-helpers.tsdiff --git a/web/apps/locker/src/components/createItemDialog/item-form-fields-utils.ts b/web/apps/locker/src/components/create-item/item-form-fields-utils.tssimilarity index 100%rename from web/apps/locker/src/components/createItemDialog/item-form-fields-utils.tsrename to web/apps/locker/src/components/create-item/item-form-fields-utils.tsdiff --git a/web/apps/locker/src/components/createItemDialog/use-create-item-dialog-state.ts b/web/apps/locker/src/components/create-item/use-create-item-dialog-state.tssimilarity index 100%rename from web/apps/locker/src/components/createItemDialog/use-create-item-dialog-state.tsrename to web/apps/locker/src/components/create-item/use-create-item-dialog-state.tsdiff --git a/web/apps/locker/src/components/ItemCard.tsx b/web/apps/locker/src/components/items/ItemCard.tsxsimilarity index 98%rename from web/apps/locker/src/components/ItemCard.tsxrename to web/apps/locker/src/components/items/ItemCard.tsxindex e7553df2a7..ce6d2c2a2e 100644--- a/web/apps/locker/src/components/ItemCard.tsx+++ b/web/apps/locker/src/components/items/ItemCard.tsx@@ -1,5 +1,8 @@-import { lockerItemIcon } from "@/components/locker-item-icons";-import { LockerMenuOption, LockerOverflowMenu } from "@/components/LockerMenu";+import { lockerItemIcon } from "@/components/items/locker-item-icons";+import {+ LockerMenuOption,+ LockerOverflowMenu,+} from "@/components/ui/LockerMenu";import { downloadLockerFile } from "@/services/remote";import type { GenericFileData, LockerItem } from "@/types";import { getItemTitle, hasDownloadableObject } from "@/types";@@ -32,7 +35,7 @@ import {lockerColorSx,lockerTextBodySx,lockerTextMiniSx,-} from "./locker-tokens";+} from "../../styles/tokens";interface ItemCardProps {item: LockerItem;diff --git a/web/apps/locker/src/components/ItemDetailView.tsx b/web/apps/locker/src/components/items/ItemDetailView.tsxsimilarity index 99%rename from web/apps/locker/src/components/ItemDetailView.tsxrename to web/apps/locker/src/components/items/ItemDetailView.tsxindex e41bddf9a0..feedab350d 100644--- a/web/apps/locker/src/components/ItemDetailView.tsx+++ b/web/apps/locker/src/components/items/ItemDetailView.tsx@@ -1,4 +1,4 @@-import { lockerItemIcon } from "@/components/locker-item-icons";+import { lockerItemIcon } from "@/components/items/locker-item-icons";import { downloadLockerFile } from "@/services/remote";import type {AccountCredentialData,@@ -36,7 +36,7 @@ import { formattedDateTime } from "ente-base/i18n-date";import log from "ente-base/log";import { t } from "i18next";import React, { useCallback, useState } from "react";-import { typeDisplayName } from "./createItemDialog/item-form-fields-utils";+import { typeDisplayName } from "../create-item/item-form-fields-utils";const textStyles = {display2: {diff --git a/web/apps/locker/src/components/ItemList.tsx b/web/apps/locker/src/components/items/ItemList.tsxsimilarity index 99%rename from web/apps/locker/src/components/ItemList.tsxrename to web/apps/locker/src/components/items/ItemList.tsxindex 4790799beb..661ace2280 100644--- a/web/apps/locker/src/components/ItemList.tsx+++ b/web/apps/locker/src/components/items/ItemList.tsx@@ -1,4 +1,7 @@-import { LockerMenuOption, LockerOverflowMenu } from "@/components/LockerMenu";+import {+ LockerMenuOption,+ LockerOverflowMenu,+} from "@/components/ui/LockerMenu";import {deleteLockerFileShareLink,downloadLockerFile,@@ -56,9 +59,6 @@ import React, {useRef,useState,} from "react";-import { ItemCard } from "./ItemCard";-import { ItemDetailView } from "./ItemDetailView";-import { ItemListDialogs } from "./itemList/ItemListDialogs";import {lockerColors,lockerColorSx,@@ -67,7 +67,10 @@ import {lockerTextDisplay2Sx,lockerTextLargeSx,lockerTextMiniSx,-} from "./locker-tokens";+} from "../../styles/tokens";+import { ItemCard } from "./ItemCard";+import { ItemDetailView } from "./ItemDetailView";+import { ItemListDialogs } from "./ItemListDialogs";const uniqueCollectionsByID = (collections: LockerCollection[]) => {const seen = new Set<number>();diff --git a/web/apps/locker/src/components/itemList/ItemListDialogs.tsx b/web/apps/locker/src/components/items/ItemListDialogs.tsxsimilarity index 98%rename from web/apps/locker/src/components/itemList/ItemListDialogs.tsxrename to web/apps/locker/src/components/items/ItemListDialogs.tsxindex 486418790e..9e7373d844 100644--- a/web/apps/locker/src/components/itemList/ItemListDialogs.tsx+++ b/web/apps/locker/src/components/items/ItemListDialogs.tsx@@ -1,17 +1,17 @@+import { FormField } from "@/components/ui/FormField";+import { LockerMenuFooter, LockerMenuOption } from "@/components/ui/LockerMenu";+import { lockerMenuPaperSx } from "@/styles/dialog";import {lockerHeaderIconButtonSx,lockerPrimaryButtonSx,-} from "@/components/createItemDialog/create-item-dialog-styles";-import { FormField } from "@/components/createItemDialog/ItemFormFields";-import { lockerMenuPaperSx } from "@/components/locker-dialog-styles";+} from "@/styles/fields";import {lockerColorSx,lockerTextBodyBoldSx,lockerTextBodySx,lockerTextH2Sx,lockerTextMiniSx,-} from "@/components/locker-tokens";-import { LockerMenuFooter, LockerMenuOption } from "@/components/LockerMenu";+} from "@/styles/tokens";import type { LockerCollection } from "@/types";import { Cancel01Icon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";@@ -32,9 +32,9 @@ import React, { useId } from "react";import {lockerSheetContainerSx,lockerSheetPaperSx,-} from "../locker-dialog-styles";-import { LockerConfirmDialog } from "../LockerConfirmDialog";-import { LockerFileLinkDialog } from "../LockerFileLinkDialog";+} from "../../styles/dialog";+import { LockerConfirmDialog } from "../ui/LockerConfirmDialog";+import { LockerFileLinkDialog } from "./LockerFileLinkDialog";interface ItemListDialogsProps {activeFileLinkItemTitle: string;diff --git a/web/apps/locker/src/components/LockerFileLinkDialog.tsx b/web/apps/locker/src/components/items/LockerFileLinkDialog.tsxsimilarity index 98%rename from web/apps/locker/src/components/LockerFileLinkDialog.tsxrename to web/apps/locker/src/components/items/LockerFileLinkDialog.tsxindex 2616374e3d..dafc64174e 100644--- a/web/apps/locker/src/components/LockerFileLinkDialog.tsx+++ b/web/apps/locker/src/components/items/LockerFileLinkDialog.tsx@@ -1,14 +1,11 @@-import {- lockerSheetContainerSx,- lockerSheetPaperSx,-} from "@/components/locker-dialog-styles";+import { lockerSheetContainerSx, lockerSheetPaperSx } from "@/styles/dialog";import {lockerColorSx,lockerShadowFloating,lockerTextBodyBoldSx,lockerTextBodySx,lockerTextH2Sx,-} from "@/components/locker-tokens";+} from "@/styles/tokens";import { Cancel01Icon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import ContentCopyIcon from "@mui/icons-material/ContentCopy";diff --git a/web/apps/locker/src/components/locker-item-icons.tsx b/web/apps/locker/src/components/items/locker-item-icons.tsxsimilarity index 100%rename from web/apps/locker/src/components/locker-item-icons.tsxrename to web/apps/locker/src/components/items/locker-item-icons.tsxdiff --git a/web/apps/locker/src/components/lockerPage/EmptyTrashDialog.tsx b/web/apps/locker/src/components/locker/EmptyTrashDialog.tsxsimilarity index 92%rename from web/apps/locker/src/components/lockerPage/EmptyTrashDialog.tsxrename to web/apps/locker/src/components/locker/EmptyTrashDialog.tsxindex ac6a8fce64..11f7a7d48d 100644--- a/web/apps/locker/src/components/lockerPage/EmptyTrashDialog.tsx+++ b/web/apps/locker/src/components/locker/EmptyTrashDialog.tsx@@ -1,4 +1,4 @@-import { LockerConfirmDialog } from "@/components/LockerConfirmDialog";+import { LockerConfirmDialog } from "@/components/ui/LockerConfirmDialog";import { t } from "i18next";export interface EmptyTrashDialogState {diff --git a/web/apps/locker/src/components/lockerPage/LockerDragOverlay.tsx b/web/apps/locker/src/components/locker/LockerDragOverlay.tsxsimilarity index 100%rename from web/apps/locker/src/components/lockerPage/LockerDragOverlay.tsxrename to web/apps/locker/src/components/locker/LockerDragOverlay.tsxdiff --git a/web/apps/locker/src/components/lockerPage/use-locker-actions.tsx b/web/apps/locker/src/components/locker/use-locker-actions.tsxsimilarity index 99%rename from web/apps/locker/src/components/lockerPage/use-locker-actions.tsxrename to web/apps/locker/src/components/locker/use-locker-actions.tsxindex 4e7cd79996..92b18682a6 100644--- a/web/apps/locker/src/components/lockerPage/use-locker-actions.tsx+++ b/web/apps/locker/src/components/locker/use-locker-actions.tsx@@ -39,8 +39,8 @@ import { t } from "i18next";import type { DragEvent } from "react";import { useCallback, useEffect, useRef, useState } from "react";import { Trans } from "react-i18next";-import { filterNonEmptyUploadItems } from "../createItemDialog/file-upload-helpers";-import type { CreateItemDialogEditItem } from "../createItemDialog/use-create-item-dialog-state";+import { filterNonEmptyUploadItems } from "../create-item/file-upload-helpers";+import type { CreateItemDialogEditItem } from "../create-item/use-create-item-dialog-state";import type { EmptyTrashDialogState } from "./EmptyTrashDialog";type DragDataTransferItem = DataTransferItem & {diff --git a/web/apps/locker/src/components/lockerPage/use-locker-data.ts b/web/apps/locker/src/components/locker/use-locker-data.tssimilarity index 100%rename from web/apps/locker/src/components/lockerPage/use-locker-data.tsrename to web/apps/locker/src/components/locker/use-locker-data.tsdiff --git a/web/apps/locker/src/components/lockerPage/use-locker-navigation.ts b/web/apps/locker/src/components/locker/use-locker-navigation.tssimilarity index 100%rename from web/apps/locker/src/components/lockerPage/use-locker-navigation.tsrename to web/apps/locker/src/components/locker/use-locker-navigation.tsdiff --git a/web/apps/locker/src/components/LockerAboutDrawer.tsx b/web/apps/locker/src/components/sidebar/LockerAboutDrawer.tsxsimilarity index 100%rename from web/apps/locker/src/components/LockerAboutDrawer.tsxrename to web/apps/locker/src/components/sidebar/LockerAboutDrawer.tsxdiff --git a/web/apps/locker/src/components/LockerAccountDrawer.tsx b/web/apps/locker/src/components/sidebar/LockerAccountDrawer.tsxsimilarity index 97%rename from web/apps/locker/src/components/LockerAccountDrawer.tsxrename to web/apps/locker/src/components/sidebar/LockerAccountDrawer.tsxindex 0b6fbe903c..6d8236cef9 100644--- a/web/apps/locker/src/components/LockerAccountDrawer.tsx+++ b/web/apps/locker/src/components/sidebar/LockerAccountDrawer.tsx@@ -7,7 +7,7 @@ import ChevronRightIcon from "@mui/icons-material/ChevronRight";import { t } from "i18next";import { useRouter } from "next/router";import React, { useEffect, useState } from "react";-import { LockerAuthenticateUser } from "./LockerAuthenticateUser";+import { LockerAuthenticateUser } from "../auth/LockerAuthenticateUser";import { LockerRecoveryKeyDrawer } from "./LockerRecoveryKeyDrawer";import { LockerSidebarCardButton } from "./LockerSidebarCardButton";import {diff --git a/web/apps/locker/src/components/LockerLegacyDrawer.tsx b/web/apps/locker/src/components/sidebar/LockerLegacyDrawer.tsxsimilarity index 100%rename from web/apps/locker/src/components/LockerLegacyDrawer.tsxrename to web/apps/locker/src/components/sidebar/LockerLegacyDrawer.tsxdiff --git a/web/apps/locker/src/components/LockerRecoveryKeyDrawer.tsx b/web/apps/locker/src/components/sidebar/LockerRecoveryKeyDrawer.tsxsimilarity index 100%rename from web/apps/locker/src/components/LockerRecoveryKeyDrawer.tsxrename to web/apps/locker/src/components/sidebar/LockerRecoveryKeyDrawer.tsxdiff --git a/web/apps/locker/src/components/LockerSecurityDrawer.tsx b/web/apps/locker/src/components/sidebar/LockerSecurityDrawer.tsxsimilarity index 98%rename from web/apps/locker/src/components/LockerSecurityDrawer.tsxrename to web/apps/locker/src/components/sidebar/LockerSecurityDrawer.tsxindex d264df7bc9..3cac3db9d0 100644--- a/web/apps/locker/src/components/LockerSecurityDrawer.tsx+++ b/web/apps/locker/src/components/sidebar/LockerSecurityDrawer.tsx@@ -9,7 +9,7 @@ import { openAccountsManagePasskeysPage } from "ente-accounts/services/passkey";import { useBaseContext } from "ente-base/context";import { t } from "i18next";import React, { useEffect, useState } from "react";-import { LockerAuthenticateUser } from "./LockerAuthenticateUser";+import { LockerAuthenticateUser } from "../auth/LockerAuthenticateUser";import { LockerSessionsDrawer } from "./LockerSessionsDrawer";import { LockerSidebarCardButton } from "./LockerSidebarCardButton";import {diff --git a/web/apps/locker/src/components/LockerSessionsDrawer.tsx b/web/apps/locker/src/components/sidebar/LockerSessionsDrawer.tsxsimilarity index 99%rename from web/apps/locker/src/components/LockerSessionsDrawer.tsxrename to web/apps/locker/src/components/sidebar/LockerSessionsDrawer.tsxindex 95ee313194..cb7f34d850 100644--- a/web/apps/locker/src/components/LockerSessionsDrawer.tsx+++ b/web/apps/locker/src/components/sidebar/LockerSessionsDrawer.tsx@@ -22,7 +22,8 @@ import log from "ente-base/log";import { savedAuthToken } from "ente-base/token";import { t } from "i18next";import React, { useCallback, useEffect, useState } from "react";-import { LockerConfirmDialog } from "./LockerConfirmDialog";+import { lockerColorSx } from "../../styles/tokens";+import { LockerConfirmDialog } from "../ui/LockerConfirmDialog";import {LockerTitledNestedSidebarDrawer,type LockerNestedSidebarDrawerVisibilityProps,@@ -36,7 +37,6 @@ import {textLightSx,titlebarActionButtonSx,} from "./locker-sidebar-styles";-import { lockerColorSx } from "./locker-tokens";const mobileUserAgentRegex = /iphone|ipad|android|mobile/i;diff --git a/web/apps/locker/src/components/LockerSidebar.tsx b/web/apps/locker/src/components/sidebar/LockerSidebar.tsxsimilarity index 99%rename from web/apps/locker/src/components/LockerSidebar.tsxrename to web/apps/locker/src/components/sidebar/LockerSidebar.tsxindex ec6e1f6d10..b8bfc97a2e 100644--- a/web/apps/locker/src/components/LockerSidebar.tsx+++ b/web/apps/locker/src/components/sidebar/LockerSidebar.tsx@@ -19,9 +19,9 @@ import {import { t } from "i18next";import dynamic from "next/dynamic";import React, { useEffect, useMemo, useState } from "react";+import { LockerAuthenticateUser } from "../auth/LockerAuthenticateUser";import { LockerAboutDrawer } from "./LockerAboutDrawer";import { LockerAccountDrawer } from "./LockerAccountDrawer";-import { LockerAuthenticateUser } from "./LockerAuthenticateUser";import { LockerSidebarCardButton } from "./LockerSidebarCardButton";import {LockerSidebarDrawer,diff --git a/web/apps/locker/src/components/LockerSidebarCardButton.tsx b/web/apps/locker/src/components/sidebar/LockerSidebarCardButton.tsxsimilarity index 100%rename from web/apps/locker/src/components/LockerSidebarCardButton.tsxrename to web/apps/locker/src/components/sidebar/LockerSidebarCardButton.tsxdiff --git a/web/apps/locker/src/components/LockerSidebarShell.tsx b/web/apps/locker/src/components/sidebar/LockerSidebarShell.tsxsimilarity index 100%rename from web/apps/locker/src/components/LockerSidebarShell.tsxrename to web/apps/locker/src/components/sidebar/LockerSidebarShell.tsxdiff --git a/web/apps/locker/src/components/LockerSocialFooter.tsx b/web/apps/locker/src/components/sidebar/LockerSocialFooter.tsxsimilarity index 100%rename from web/apps/locker/src/components/LockerSocialFooter.tsxrename to web/apps/locker/src/components/sidebar/LockerSocialFooter.tsxdiff --git a/web/apps/locker/src/components/LockerSupportDrawer.tsx b/web/apps/locker/src/components/sidebar/LockerSupportDrawer.tsxsimilarity index 98%rename from web/apps/locker/src/components/LockerSupportDrawer.tsxrename to web/apps/locker/src/components/sidebar/LockerSupportDrawer.tsxindex aa7a103a25..91a16e42db 100644--- a/web/apps/locker/src/components/LockerSupportDrawer.tsx+++ b/web/apps/locker/src/components/sidebar/LockerSupportDrawer.tsx@@ -18,8 +18,8 @@ import { initiateEmail, openURL } from "ente-new/photos/utils/web";import { t } from "i18next";import React, { useState } from "react";import { Trans } from "react-i18next";-import { lockerColorSx } from "./locker-tokens";-import { LockerConfirmDialog } from "./LockerConfirmDialog";+import { lockerColorSx } from "../../styles/tokens";+import { LockerConfirmDialog } from "../ui/LockerConfirmDialog";import {LockerSidebarCardButton,LockerSidebarLink,diff --git a/web/apps/locker/src/components/LockerTwoFactorDrawer.tsx b/web/apps/locker/src/components/sidebar/LockerTwoFactorDrawer.tsxsimilarity index 99%rename from web/apps/locker/src/components/LockerTwoFactorDrawer.tsxrename to web/apps/locker/src/components/sidebar/LockerTwoFactorDrawer.tsxindex 5bb0c0084d..d01cce0709 100644--- a/web/apps/locker/src/components/LockerTwoFactorDrawer.tsx+++ b/web/apps/locker/src/components/sidebar/LockerTwoFactorDrawer.tsx@@ -26,8 +26,8 @@ import {lockerTextBodyBoldSx,lockerTextBodySx,lockerTextMiniSx,-} from "./locker-tokens";-import { LockerConfirmDialog } from "./LockerConfirmDialog";+} from "../../styles/tokens";+import { LockerConfirmDialog } from "../ui/LockerConfirmDialog";import { LockerSidebarCardButton } from "./LockerSidebarCardButton";import {LockerTitledNestedSidebarDrawer,diff --git a/web/apps/locker/src/components/locker-sidebar-styles.ts b/web/apps/locker/src/components/sidebar/locker-sidebar-styles.tssimilarity index 100%rename from web/apps/locker/src/components/locker-sidebar-styles.tsrename to web/apps/locker/src/components/sidebar/locker-sidebar-styles.tsdiff --git a/web/apps/locker/src/components/ui/FormField.tsx b/web/apps/locker/src/components/ui/FormField.tsxnew file mode 100644index 0000000000..26e58ba06b--- /dev/null+++ b/web/apps/locker/src/components/ui/FormField.tsx@@ -0,0 +1,68 @@+import { lockerFieldSx } from "@/styles/fields";+import {+ Box,+ Stack,+ TextField,+ Typography,+ type TextFieldProps,+} from "@mui/material";+import { useId } from "react";++type FormFieldProps = Omit<TextFieldProps, "label"> & {+ label: string;+ multilineMinHeight?: number;+};++export function FormField({+ label,+ required,+ multiline,+ multilineMinHeight,+ ...rest+}: FormFieldProps) {+ const id = useId();++ return (+ <Stack sx={{ gap: "8px" }}>+ <Typography+ variant="small"+ component="label"+ htmlFor={id}+ sx={{+ fontWeight: 500,+ lineHeight: "20px",+ display: "flex",+ gap: "2px",+ color: "text.base",+ }}+ >+ {label}+ {required && (+ <Box+ component="span"+ aria-hidden+ sx={{ color: "critical.main", fontWeight: 600 }}+ >+ *+ </Box>+ )}+ </Typography>+ <TextField+ {...rest}+ id={id}+ required={required}+ multiline={multiline}+ hiddenLabel+ fullWidth+ variant="outlined"+ margin="none"+ sx={(theme) =>+ lockerFieldSx(theme, {+ multiline,+ minHeight: multilineMinHeight,+ })+ }+ />+ </Stack>+ );+}diff --git a/web/apps/locker/src/components/LockerConfirmDialog.tsx b/web/apps/locker/src/components/ui/LockerConfirmDialog.tsxsimilarity index 98%rename from web/apps/locker/src/components/LockerConfirmDialog.tsxrename to web/apps/locker/src/components/ui/LockerConfirmDialog.tsxindex e0d8a4dd66..446a2c495b 100644--- a/web/apps/locker/src/components/LockerConfirmDialog.tsx+++ b/web/apps/locker/src/components/ui/LockerConfirmDialog.tsx@@ -1,14 +1,11 @@-import {- lockerSheetContainerSx,- lockerSheetPaperSx,-} from "@/components/locker-dialog-styles";+import { lockerSheetContainerSx, lockerSheetPaperSx } from "@/styles/dialog";import {lockerColorSx,lockerTextBodyBoldSx,lockerTextBodySx,lockerTextH2Sx,lockerTextMiniSx,-} from "@/components/locker-tokens";+} from "@/styles/tokens";import { Cancel01Icon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import {diff --git a/web/apps/locker/src/components/LockerMenu.tsx b/web/apps/locker/src/components/ui/LockerMenu.tsxsimilarity index 98%rename from web/apps/locker/src/components/LockerMenu.tsxrename to web/apps/locker/src/components/ui/LockerMenu.tsxindex 4de61d4ba7..dba7a71c5b 100644--- a/web/apps/locker/src/components/LockerMenu.tsx+++ b/web/apps/locker/src/components/ui/LockerMenu.tsx@@ -10,12 +10,12 @@ import {import Menu, { type MenuProps } from "@mui/material/Menu";import { t } from "i18next";import React, { createContext, useContext, useMemo, useState } from "react";-import { lockerMenuPaperSx } from "./locker-dialog-styles";+import { lockerMenuPaperSx } from "../../styles/dialog";import {lockerColorSx,lockerTextBodySx,lockerTextMiniSx,-} from "./locker-tokens";+} from "../../styles/tokens";const LockerMenuContext = createContext<{ close: () => void } | undefined>(undefined,diff --git a/web/apps/locker/src/pages/change-password.tsx b/web/apps/locker/src/pages/change-password.tsxindex f1ad528fe6..5c8424cc48 100644--- a/web/apps/locker/src/pages/change-password.tsx+++ b/web/apps/locker/src/pages/change-password.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { SetPasswordForm } from "ente-accounts/components/auth/SetPasswordForm";import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";import AccountsChangePasswordPage from "ente-accounts/pages/change-password";diff --git a/web/apps/locker/src/pages/credentials.tsx b/web/apps/locker/src/pages/credentials.tsxindex 0cc156e30e..f0ce2a3b83 100644--- a/web/apps/locker/src/pages/credentials.tsx+++ b/web/apps/locker/src/pages/credentials.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import {CredentialsForm,PasswordForm,diff --git a/web/apps/locker/src/pages/generate.tsx b/web/apps/locker/src/pages/generate.tsxindex fc2413a271..2a59b11176 100644--- a/web/apps/locker/src/pages/generate.tsx+++ b/web/apps/locker/src/pages/generate.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { RecoveryKeyForm } from "ente-accounts/components/auth/RecoveryKeyForm";import { SetPasswordForm } from "ente-accounts/components/auth/SetPasswordForm";import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";diff --git a/web/apps/locker/src/pages/locker.tsx b/web/apps/locker/src/pages/locker.tsxindex 2d92ba4cde..8f70a102b3 100644--- a/web/apps/locker/src/pages/locker.tsx+++ b/web/apps/locker/src/pages/locker.tsx@@ -1,18 +1,18 @@-import { CreateItemDialog } from "@/components/CreateItemDialog";-import { ItemList } from "@/components/ItemList";-import { LockerCollectionShareDrawer } from "@/components/LockerCollectionShareDrawer";-import { LockerConfirmDialog } from "@/components/LockerConfirmDialog";+import { DeleteCollectionDialog } from "@/components/collections/DeleteCollectionDialog";+import { LockerCollectionShareDrawer } from "@/components/collections/LockerCollectionShareDrawer";+import { CreateItemDialog } from "@/components/create-item/CreateItemDialog";+import { ItemList } from "@/components/items/ItemList";+import { EmptyTrashDialog } from "@/components/locker/EmptyTrashDialog";+import { LockerDragOverlay } from "@/components/locker/LockerDragOverlay";+import { useLockerActions } from "@/components/locker/use-locker-actions";+import { useLockerData } from "@/components/locker/use-locker-data";+import { useLockerNavigation } from "@/components/locker/use-locker-navigation";import { LockerNavbar } from "@/components/LockerNavbar";-import { LockerSidebar } from "@/components/LockerSidebar";-import { lockerColorSx } from "@/components/locker-tokens";-import { DeleteCollectionDialog } from "@/components/lockerPage/DeleteCollectionDialog";-import { EmptyTrashDialog } from "@/components/lockerPage/EmptyTrashDialog";-import { LockerDragOverlay } from "@/components/lockerPage/LockerDragOverlay";-import { useLockerActions } from "@/components/lockerPage/use-locker-actions";-import { useLockerData } from "@/components/lockerPage/use-locker-data";-import { useLockerNavigation } from "@/components/lockerPage/use-locker-navigation";+import { LockerSidebar } from "@/components/sidebar/LockerSidebar";+import { LockerConfirmDialog } from "@/components/ui/LockerConfirmDialog";import { useSetupLockerI18n } from "@/i18n/locker";import { fetchCollectionSharees } from "@/services/remote";+import { lockerColorSx } from "@/styles/tokens";import { PlusSignIcon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import { Box, Button, Fab, Snackbar, Stack, Typography } from "@mui/material";diff --git a/web/apps/locker/src/pages/login.tsx b/web/apps/locker/src/pages/login.tsxindex 5efc47c7a9..4a8d9e80c9 100644--- a/web/apps/locker/src/pages/login.tsx+++ b/web/apps/locker/src/pages/login.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { LoginForm } from "ente-accounts/components/auth/LoginForm";import {LoginContents,diff --git a/web/apps/locker/src/pages/passkeys/recover.tsx b/web/apps/locker/src/pages/passkeys/recover.tsxindex 5750611e43..dd758ce7d9 100644--- a/web/apps/locker/src/pages/passkeys/recover.tsx+++ b/web/apps/locker/src/pages/passkeys/recover.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { RecoverTwoFactorForm } from "ente-accounts/components/auth/RecoveryForm";import AccountsTwoFactorRecoverPage, {type TwoFactorRecoverPresentationProps,diff --git a/web/apps/locker/src/pages/recover.tsx b/web/apps/locker/src/pages/recover.tsxindex 89f505a2b0..a9a0abb229 100644--- a/web/apps/locker/src/pages/recover.tsx+++ b/web/apps/locker/src/pages/recover.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { RecoverAccountForm } from "ente-accounts/components/auth/RecoveryForm";import AccountsRecoverPage, {type RecoverAccountPresentationProps,diff --git a/web/apps/locker/src/pages/signup.tsx b/web/apps/locker/src/pages/signup.tsxindex 398ca98d53..a9e9788bb9 100644--- a/web/apps/locker/src/pages/signup.tsx+++ b/web/apps/locker/src/pages/signup.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { SignUpForm } from "ente-accounts/components/auth/SignUpForm";import type { SignUpPresentationProps } from "ente-accounts/components/SignUpContents";import AccountsSignUpPage from "ente-accounts/pages/signup";diff --git a/web/apps/locker/src/pages/two-factor/recover.tsx b/web/apps/locker/src/pages/two-factor/recover.tsxindex baf7505c7a..ff1cad949b 100644--- a/web/apps/locker/src/pages/two-factor/recover.tsx+++ b/web/apps/locker/src/pages/two-factor/recover.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { RecoverTwoFactorForm } from "ente-accounts/components/auth/RecoveryForm";import AccountsTwoFactorRecoverPage, {type TwoFactorRecoverPresentationProps,diff --git a/web/apps/locker/src/pages/two-factor/verify.tsx b/web/apps/locker/src/pages/two-factor/verify.tsxindex a4161b20ee..88a0291426 100644--- a/web/apps/locker/src/pages/two-factor/verify.tsx+++ b/web/apps/locker/src/pages/two-factor/verify.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { TwoFactorForm } from "ente-accounts/components/auth/TwoFactorForm";import AccountsTwoFactorVerifyPage, {type TwoFactorVerifyPresentationProps,diff --git a/web/apps/locker/src/pages/verify.tsx b/web/apps/locker/src/pages/verify.tsxindex 98d963cf45..0c8bbc12f8 100644--- a/web/apps/locker/src/pages/verify.tsx+++ b/web/apps/locker/src/pages/verify.tsx@@ -1,4 +1,4 @@-import { LockerAuthShell } from "@/components/LockerAuthShell";+import { LockerAuthShell } from "@/components/auth/LockerAuthShell";import { SecondFactorChoiceDialog } from "ente-accounts/components/auth/SecondFactorChoiceDialog";import { VerifyEmailForm } from "ente-accounts/components/auth/VerifyEmailForm";import AccountsVerifyPage, {diff --git a/web/apps/locker/src/components/locker-dialog-styles.ts b/web/apps/locker/src/styles/dialog.tssimilarity index 92%rename from web/apps/locker/src/components/locker-dialog-styles.tsrename to web/apps/locker/src/styles/dialog.tsindex 1259efbf63..fdb8ff8b58 100644--- a/web/apps/locker/src/components/locker-dialog-styles.ts+++ b/web/apps/locker/src/styles/dialog.ts@@ -1,5 +1,5 @@import type { Theme } from "@mui/material";-import { lockerColorSx, lockerShadowFloating } from "./locker-tokens";+import { lockerColorSx, lockerShadowFloating } from "./tokens";export const lockerMenuPaperSx = (theme: Theme) => ({width: 180,diff --git a/web/apps/locker/src/components/createItemDialog/create-item-dialog-styles.ts b/web/apps/locker/src/styles/fields.tssimilarity index 79%rename from web/apps/locker/src/components/createItemDialog/create-item-dialog-styles.tsrename to web/apps/locker/src/styles/fields.tsindex f4a9ea19b3..30a8ae524e 100644--- a/web/apps/locker/src/components/createItemDialog/create-item-dialog-styles.ts+++ b/web/apps/locker/src/styles/fields.ts@@ -1,22 +1,5 @@import type { Theme } from "@mui/material/styles";-export const lockerScrollAreaSx = (theme: Theme) => ({- overflowY: "auto",- marginRight: "-14px",- paddingRight: "14px",- scrollbarWidth: "thin",- scrollbarColor: `${theme.vars.palette.fill.muted} transparent`,- "&::-webkit-scrollbar": { width: 6 },- "&::-webkit-scrollbar-track": { background: "transparent" },- "&::-webkit-scrollbar-thumb": {- borderRadius: "999px",- backgroundColor: theme.vars.palette.fill.muted,- },- "&::-webkit-scrollbar-thumb:hover": {- backgroundColor: theme.vars.palette.stroke.muted,- },-});-export const lockerFieldSx = (theme: Theme,{diff --git a/web/apps/locker/src/components/locker-tokens.ts b/web/apps/locker/src/styles/tokens.tssimilarity index 100%rename from web/apps/locker/src/components/locker-tokens.tsrename to web/apps/locker/src/styles/tokens.ts