Skip to content

armgit / ente

Public Imported from GitHub
0

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

chore(sidebar):update-app-lock-position

Aswin Asok1607a2789cdf
diff --git a/docs/docs/photos/faq/security-and-privacy.md b/docs/docs/photos/faq/security-and-privacy.md
index 8fd6711dc8..4ba57be142 100644
--- a/docs/docs/photos/faq/security-and-privacy.md
+++ b/docs/docs/photos/faq/security-and-privacy.md
@@ -167,7 +167,7 @@ Yes. You can protect the Ente Photos app with an additional lock screen.
- Configure **Auto lock** to lock the app automatically after a chosen delay
- Enable **Hide content** in the mobile app to hide app previews in the app switcher
-Open `Settings > Security > App lock` on mobile, or `Settings > Account > App lock` on desktop/web.
+Open `Settings > Security > App lock` on mobile, or `Settings > Preferences > App lock` on desktop.
Learn more in the [App lock guide](/photos/features/account/app-lock).
diff --git a/docs/docs/photos/features/account/app-lock.md b/docs/docs/photos/features/account/app-lock.md
index cb5feb9ec2..de486e500f 100644
--- a/docs/docs/photos/features/account/app-lock.md
+++ b/docs/docs/photos/features/account/app-lock.md
@@ -13,8 +13,8 @@ authentication when opened.
**On mobile:**
Open `Settings > Security > App lock`, then turn on **App lock**.
-**On desktop / web:**
-Open `Settings > Account > App lock`, then turn on **App lock**.
+**On desktop:**
+Open `Settings > Preferences > App lock`, then turn on **App lock**.
## Lock methods
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsx
index f503e73720..123cadfe3f 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@ -919,6 +919,7 @@ const UtilitySection: React.FC<UtilitySectionProps> = ({
onRootClose={onCloseSidebar}
pendingAction={pendingPreferencesAction}
onActionHandled={onPreferencesActionHandled}
+ onAuthenticateUser={onAuthenticateUser}
/>
<FreeUpSpace
{...freeUpSpaceVisibilityProps}
@@ -1144,12 +1145,6 @@ const Account: React.FC<AccountProps> = ({
onClick={handleActiveSessions}
/>
</RowButtonGroup>
- {isDesktop && (
- <DesktopAppLockSettings
- onAuthenticateUser={onAuthenticateUser}
- onRootClose={onRootClose}
- />
- )}
<RowButtonGroup>
<RowButton
label={t("change_password")}
@@ -1196,7 +1191,8 @@ const Account: React.FC<AccountProps> = ({
};
const DesktopAppLockSettings: React.FC<
- Pick<SidebarProps, "onAuthenticateUser"> & Pick<AccountProps, "onRootClose">
+ Pick<SidebarProps, "onAuthenticateUser"> &
+ Pick<NestedSidebarDrawerVisibilityProps, "onRootClose">
> = ({ onAuthenticateUser, onRootClose }) => {
const appLock = useAppLockSnapshot();
const { show, props } = useModalVisibility();
@@ -1232,15 +1228,17 @@ const DesktopAppLockSettings: React.FC<
);
};
-type PreferencesProps = NestedSidebarDrawerVisibilityProps & {
- pendingAction?: PreferencesAction;
- onActionHandled?: (action?: PreferencesAction) => void;
-};
+type PreferencesProps = NestedSidebarDrawerVisibilityProps &
+ Pick<SidebarProps, "onAuthenticateUser"> & {
+ pendingAction?: PreferencesAction;
+ onActionHandled?: (action?: PreferencesAction) => void;
+ };
const Preferences: React.FC<PreferencesProps> = ({
open,
onClose,
onRootClose,
+ onAuthenticateUser,
pendingAction,
onActionHandled,
}) => {
@@ -1334,6 +1332,12 @@ const Preferences: React.FC<PreferencesProps> = ({
label={t("advanced")}
onClick={showAdvancedSettings}
/>
+ {isDesktop && (
+ <DesktopAppLockSettings
+ onAuthenticateUser={onAuthenticateUser}
+ onRootClose={onRootClose}
+ />
+ )}
{isHLSGenerationSupported && (
<RowButtonGroup>
<RowSwitch
diff --git a/web/packages/new/photos/services/search/sidebar-search-registry.ts b/web/packages/new/photos/services/search/sidebar-search-registry.ts
index 430a8fe0f5..c70c9ca874 100644
--- a/web/packages/new/photos/services/search/sidebar-search-registry.ts
+++ b/web/packages/new/photos/services/search/sidebar-search-registry.ts
@@ -200,6 +200,13 @@ const sidebarActions = (): SidebarAction[] => {
path: [preferencesCategory, t("theme")],
keywords: ["appearance", "dark mode", "light mode"],
},
+ {
+ id: "preferences.appLock",
+ label: t("app_lock"),
+ path: [preferencesCategory, t("app_lock")],
+ keywords: ["lock", "pin", "password", "biometric", "privacy"],
+ available: () => isDesktop,
+ },
{
id: "preferences.customDomains",
label: t("custom_domains"),
@@ -389,6 +396,7 @@ export const performSidebarAction = async (
case "preferences.language":
case "preferences.theme":
+ case "preferences.appLock":
case "preferences.customDomains":
case "preferences.map":
case "preferences.advanced":
diff --git a/web/packages/new/photos/services/search/types.ts b/web/packages/new/photos/services/search/types.ts
index 9a6eb25036..16af62e126 100644
--- a/web/packages/new/photos/services/search/types.ts
+++ b/web/packages/new/photos/services/search/types.ts
@@ -17,7 +17,7 @@ import type { LocationTag } from "../user-entity";
* - `shortcuts.*`: Quick access actions like uncategorized items, archive, hidden items, and trash
* - `utility.*`: General utility actions such as account management, folder watching, deduplication, preferences, help, export, and logout
* - `account.*`: Account-specific settings including recovery key, two-factor authentication, passkeys, password/email management, and account deletion
- * - `preferences.*`: User preference options like language, theme, custom domains, map settings, advanced options, ML search, and streamable videos
+ * - `preferences.*`: User preference options like language, theme, app lock, custom domains, map settings, advanced options, ML search, and streamable videos
* - `help.*`: Help-related actions including help center, blog, feature requests, support, log viewing, and test upload
*
* @remarks
@@ -48,6 +48,7 @@ export type SidebarActionID =
| "account.sessions"
| "preferences.language"
| "preferences.theme"
+ | "preferences.appLock"
| "preferences.customDomains"
| "preferences.map"
| "preferences.advanced"