Skip to content

armgit / ente

Public Imported from GitHub
0

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

remove(photos):remove-fallback-feature-flag

Aswin Asoka5e4eaa56a90
diff --git a/web/apps/photos/src/feature-flags.ts b/web/apps/photos/src/feature-flags.ts
deleted file mode 100644
index d3ffbe30c4..0000000000
--- a/web/apps/photos/src/feature-flags.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const featureFlags: Record<"enableNewPhotosAuthFlow", boolean> = {
- enableNewPhotosAuthFlow: true,
-};
diff --git a/web/apps/photos/src/pages/change-password.tsx b/web/apps/photos/src/pages/change-password.tsx
index f762a262bf..af6e358a9a 100644
--- a/web/apps/photos/src/pages/change-password.tsx
+++ b/web/apps/photos/src/pages/change-password.tsx
@@ -1,5 +1,4 @@
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";
import { SetPasswordForm } from "ente-accounts/components/auth/SetPasswordForm";
import AccountsChangePasswordPage from "ente-accounts/pages/change-password";
@@ -16,10 +15,6 @@ function ResetPasswordPresentation(
}
function ChangePasswordPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsChangePasswordPage />;
- }
-
return (
<AccountsChangePasswordPage
resetPresentation={ResetPasswordPresentation}
diff --git a/web/apps/photos/src/pages/credentials.tsx b/web/apps/photos/src/pages/credentials.tsx
index 9ea700ea61..6173eea342 100644
--- a/web/apps/photos/src/pages/credentials.tsx
+++ b/web/apps/photos/src/pages/credentials.tsx
@@ -1,6 +1,5 @@
import { PasskeyVerificationForm } from "@/components/auth/PasskeyVerificationForm";
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import {
CredentialsForm,
PasswordForm,
@@ -33,10 +32,6 @@ function PasskeyPresentation(
}
function CredentialsPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsCredentialsPage />;
- }
-
return (
<AccountsCredentialsPage
presentation={CredentialsPresentation}
diff --git a/web/apps/photos/src/pages/generate.tsx b/web/apps/photos/src/pages/generate.tsx
index 412f72a2ed..90b8f29cfc 100644
--- a/web/apps/photos/src/pages/generate.tsx
+++ b/web/apps/photos/src/pages/generate.tsx
@@ -1,5 +1,4 @@
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import type { NewPasswordPresentationProps } from "ente-accounts/components/NewPasswordForm";
import type { RecoveryKeyPresentationProps } from "ente-accounts/components/RecoveryKey";
import { RecoveryKeyForm } from "ente-accounts/components/auth/RecoveryKeyForm";
@@ -28,10 +27,6 @@ function SetPasswordPresentation(
}
function GeneratePage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsGeneratePage />;
- }
-
return (
<AccountsGeneratePage
passwordPresentation={SetPasswordPresentation}
diff --git a/web/apps/photos/src/pages/index.tsx b/web/apps/photos/src/pages/index.tsx
index 801edd30a7..e2535e7def 100644
--- a/web/apps/photos/src/pages/index.tsx
+++ b/web/apps/photos/src/pages/index.tsx
@@ -1,16 +1,12 @@
import { DevSettingsDialog } from "@/components/auth/DevSettingsDialog";
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
-import { Box, Stack, Typography, styled } from "@mui/material";
import { LoginForm } from "ente-accounts/components/auth/LoginForm";
import { SignUpForm } from "ente-accounts/components/auth/SignUpForm";
import { LoginContents } from "ente-accounts/components/LoginContents";
import { SignUpContents } from "ente-accounts/components/SignUpContents";
import { savedPartialLocalUser } from "ente-accounts/services/accounts-db";
-import { CenteredFill, CenteredRow } from "ente-base/components/containers";
-import { EnteLogo } from "ente-base/components/EnteLogo";
+import { CenteredFill } from "ente-base/components/containers";
import { ActivityIndicator } from "ente-base/components/mui/ActivityIndicator";
-import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton";
import { useBaseContext } from "ente-base/context";
import {
JOIN_ALBUM_CONTEXT_KEY,
@@ -27,8 +23,7 @@ import { canAccessIndexedDB } from "ente-gallery/services/files-db";
import { DevSettings } from "ente-new/photos/components/DevSettings";
import { t } from "i18next";
import { useRouter } from "next/router";
-import React, { useCallback, useEffect, useRef, useState } from "react";
-import { Trans } from "react-i18next";
+import React, { useCallback, useEffect, useState } from "react";
const Page: React.FC = () => {
const { showMiniDialog } = useBaseContext();
@@ -121,7 +116,7 @@ const Page: React.FC = () => {
<TappableContainer onMaybeChangeHost={refreshHost}>
{loading ? (
<ActivityIndicator />
- ) : featureFlags.enableNewPhotosAuthFlow ? (
+ ) : (
<PhotosAuthShell>
{showLogin ? (
<LoginContents
@@ -137,52 +132,6 @@ const Page: React.FC = () => {
/>
)}
</PhotosAuthShell>
- ) : (
- <>
- <SlideshowPanel>
- <Logo_>
- <EnteLogo height={24} />
- </Logo_>
- <Slideshow />
- </SlideshowPanel>
- <MobileBox>
- <FocusVisibleButton
- color="accent"
- onClick={() => router.push("/signup")}
- >
- {t("new_to_ente")}
- </FocusVisibleButton>
- <FocusVisibleButton
- onClick={() => router.push("/login")}
- >
- {t("existing_user")}
- </FocusVisibleButton>
- <MobileBoxFooter {...{ host }} />
- </MobileBox>
- <DesktopBox
- sx={[
- { bgcolor: "background.default" },
- (theme) =>
- theme.applyStyles("dark", {
- bgcolor: "background.paper2",
- }),
- ]}
- >
- <Stack sx={{ width: "320px", py: 4, gap: 4 }}>
- {showLogin ? (
- <LoginContents
- {...{ host }}
- onSignUp={handleShowSignUp}
- />
- ) : (
- <SignUpContents
- {...{ router, host }}
- onLogin={handleShowLogin}
- />
- )}
- </Stack>
- </DesktopBox>
- </>
)}
</TappableContainer>
);
@@ -237,11 +186,7 @@ const TappableContainer: React.FC<
<DevSettings
open={showDevSettings}
onClose={handleClose}
- presentation={
- featureFlags.enableNewPhotosAuthFlow
- ? DevSettingsDialog
- : undefined
- }
+ presentation={DevSettingsDialog}
/>
{children}
</CenteredFill>
@@ -256,163 +201,3 @@ const shouldAllowChangingAPIOrigin = () => {
hostname.endsWith(".ente.sh")
);
};
-
-const SlideshowPanel = styled("div")`
- align-self: stretch;
-
- flex-shrink: 1;
- flex-grow: 1;
- flex-basis: auto;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
-
- @media (width <= 1024px) {
- flex-grow: 0;
- }
- @media (width > 1024px) {
- width: 700px;
- }
-`;
-
-const Logo_ = styled("div")`
- padding-inline-end: 1rem;
-
- margin-block-start: 32px;
- margin-block-end: 40px;
- @media (width >= 1024px) {
- margin-block-end: 48px;
- }
-`;
-
-const MobileBox = styled("div")`
- display: none;
-
- @media (width <= 1024px) {
- max-width: 375px;
- width: 100%;
- padding: 12px;
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
-`;
-
-interface MobileBoxFooterProps {
- host: string | undefined;
-}
-
-const MobileBoxFooter: React.FC<MobileBoxFooterProps> = ({ host }) => {
- return (
- <Box sx={{ pt: 4, textAlign: "center" }}>
- {host && (
- <Typography variant="mini" sx={{ color: "text.faint" }}>
- {host}
- </Typography>
- )}
- </Box>
- );
-};
-
-const DesktopBox = styled(CenteredRow)`
- flex-shrink: 0;
- flex-grow: 2;
- flex-basis: auto;
-
- height: 100%;
- padding-inline: 20px;
-
- @media (width <= 1024px) {
- display: none;
- }
-`;
-
-const Slideshow: React.FC = () => {
- const [selectedIndex, setSelectedIndex] = useState(0);
- const containerRef = useRef<HTMLDivElement | null>(null);
-
- useEffect(() => {
- const intervalID = setInterval(() => {
- setSelectedIndex((selectedIndex + 1) % 3);
- }, 5000);
- return () => clearInterval(intervalID);
- });
-
- useEffect(() => {
- const container = containerRef.current!;
- const left = containerRef.current!.offsetWidth * selectedIndex;
- // Chrome intermittently ignores the smooth scroll.
- // Repeat it without animation as a fallback.
- container.scrollTo({ left, behavior: "smooth" });
- setTimeout(() => container.scrollTo({ left }), 500);
- }, [selectedIndex]);
-
- return (
- <SlidesContainer ref={containerRef}>
- <Slide>
- <Img
- src="/images/onboarding-lock/1x.png"
- srcSet="/images/onboarding-lock/2x.png 2x, /images/onboarding-lock/3x.png 3x"
- />
- <SlideTitle>
- <Trans i18nKey={"intro_slide_1_title"} />
- </SlideTitle>
- <SlideDescription>{t("intro_slide_1")}</SlideDescription>
- </Slide>
- <Slide>
- <Img
- src="/images/onboarding-safe/1x.png"
- srcSet="/images/onboarding-safe/2x.png 2x, /images/onboarding-safe/3x.png 3x"
- />
- <SlideTitle>
- <Trans i18nKey={"intro_slide_2_title"} />
- </SlideTitle>
- <SlideDescription>{t("intro_slide_2")}</SlideDescription>
- </Slide>
- <Slide>
- <Img
- src="/images/onboarding-sync/1x.png"
- srcSet="/images/onboarding-sync/2x.png 2x, /images/onboarding-sync/3x.png 3x"
- />
- <SlideTitle>
- <Trans i18nKey={"intro_slide_3_title"} />
- </SlideTitle>
- <SlideDescription>{t("intro_slide_3")}</SlideDescription>
- </Slide>
- </SlidesContainer>
- );
-};
-
-const SlidesContainer = styled("div")`
- align-self: stretch;
- display: flex;
- overflow-x: hidden;
-`;
-
-const Slide = styled(Stack)`
- min-width: 100%;
- align-items: center;
- text-align: center;
-`;
-
-const SlideTitle: React.FC<React.PropsWithChildren> = ({ children }) => (
- <Typography variant="h3" sx={{ mt: 4 }}>
- {children}
- </Typography>
-);
-
-const SlideDescription: React.FC<React.PropsWithChildren> = ({ children }) => (
- <Typography sx={{ color: "text.muted", mt: 2, mb: 3 }}>
- {children}
- </Typography>
-);
-
-const Img = styled("img")`
- height: 250px;
- object-fit: contain;
-
- @media (width <= 400px) {
- height: 180px;
- }
-`;
diff --git a/web/apps/photos/src/pages/login.tsx b/web/apps/photos/src/pages/login.tsx
index 63dabb89af..1fafaf5a8c 100644
--- a/web/apps/photos/src/pages/login.tsx
+++ b/web/apps/photos/src/pages/login.tsx
@@ -1,5 +1,4 @@
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import type { LoginPresentationProps } from "ente-accounts/components/LoginContents";
import { LoginForm } from "ente-accounts/components/auth/LoginForm";
import AccountsLoginPage from "ente-accounts/pages/login";
@@ -14,10 +13,6 @@ function LoginPresentation(props: LoginPresentationProps): React.JSX.Element {
}
function LoginPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsLoginPage />;
- }
-
return <AccountsLoginPage presentation={LoginPresentation} />;
}
diff --git a/web/apps/photos/src/pages/passkeys/recover.tsx b/web/apps/photos/src/pages/passkeys/recover.tsx
index e9ccb65d79..dc00f11363 100644
--- a/web/apps/photos/src/pages/passkeys/recover.tsx
+++ b/web/apps/photos/src/pages/passkeys/recover.tsx
@@ -1,5 +1,4 @@
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import { RecoverTwoFactorForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsTwoFactorRecoverPage, {
type TwoFactorRecoverPresentationProps,
@@ -17,10 +16,6 @@ function RecoverTwoFactorPresentation(
}
function PasskeyRecoverPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsTwoFactorRecoverPage twoFactorType="passkey" />;
- }
-
return (
<AccountsTwoFactorRecoverPage
twoFactorType="passkey"
diff --git a/web/apps/photos/src/pages/recover.tsx b/web/apps/photos/src/pages/recover.tsx
index c4103e0bcf..4087698f89 100644
--- a/web/apps/photos/src/pages/recover.tsx
+++ b/web/apps/photos/src/pages/recover.tsx
@@ -1,5 +1,4 @@
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import { RecoverAccountForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsRecoverPage, {
type RecoverAccountPresentationProps,
@@ -17,10 +16,6 @@ function RecoverAccountPresentation(
}
function RecoverPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsRecoverPage />;
- }
-
return <AccountsRecoverPage presentation={RecoverAccountPresentation} />;
}
diff --git a/web/apps/photos/src/pages/signup.tsx b/web/apps/photos/src/pages/signup.tsx
index 7d225a1948..ceb16ca387 100644
--- a/web/apps/photos/src/pages/signup.tsx
+++ b/web/apps/photos/src/pages/signup.tsx
@@ -1,5 +1,4 @@
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import type { SignUpPresentationProps } from "ente-accounts/components/SignUpContents";
import { SignUpForm } from "ente-accounts/components/auth/SignUpForm";
import AccountsSignUpPage from "ente-accounts/pages/signup";
@@ -14,10 +13,6 @@ function SignUpPresentation(props: SignUpPresentationProps): React.JSX.Element {
}
function SignUpPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsSignUpPage />;
- }
-
return <AccountsSignUpPage presentation={SignUpPresentation} />;
}
diff --git a/web/apps/photos/src/pages/two-factor/recover.tsx b/web/apps/photos/src/pages/two-factor/recover.tsx
index d793985230..4b49ee55d5 100644
--- a/web/apps/photos/src/pages/two-factor/recover.tsx
+++ b/web/apps/photos/src/pages/two-factor/recover.tsx
@@ -1,5 +1,4 @@
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import { RecoverTwoFactorForm } from "ente-accounts/components/auth/RecoveryForm";
import AccountsTwoFactorRecoverPage, {
type TwoFactorRecoverPresentationProps,
@@ -17,10 +16,6 @@ function RecoverTwoFactorPresentation(
}
function TwoFactorRecoverPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsTwoFactorRecoverPage twoFactorType="totp" />;
- }
-
return (
<AccountsTwoFactorRecoverPage
twoFactorType="totp"
diff --git a/web/apps/photos/src/pages/two-factor/verify.tsx b/web/apps/photos/src/pages/two-factor/verify.tsx
index ada85f3178..3f43a41cb1 100644
--- a/web/apps/photos/src/pages/two-factor/verify.tsx
+++ b/web/apps/photos/src/pages/two-factor/verify.tsx
@@ -1,5 +1,4 @@
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import { TwoFactorForm } from "ente-accounts/components/auth/TwoFactorForm";
import AccountsTwoFactorVerifyPage, {
type TwoFactorVerifyPresentationProps,
@@ -17,10 +16,6 @@ function TwoFactorPresentation(
}
function TwoFactorVerifyPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsTwoFactorVerifyPage />;
- }
-
return <AccountsTwoFactorVerifyPage presentation={TwoFactorPresentation} />;
}
diff --git a/web/apps/photos/src/pages/verify.tsx b/web/apps/photos/src/pages/verify.tsx
index 62f78d4ae7..c60f1a968a 100644
--- a/web/apps/photos/src/pages/verify.tsx
+++ b/web/apps/photos/src/pages/verify.tsx
@@ -1,6 +1,5 @@
import { PasskeyVerificationForm } from "@/components/auth/PasskeyVerificationForm";
import { PhotosAuthShell } from "@/components/PhotosAuthShell";
-import { featureFlags } from "@/feature-flags";
import { SecondFactorChoiceDialog } from "ente-accounts/components/auth/SecondFactorChoiceDialog";
import { VerifyEmailForm } from "ente-accounts/components/auth/VerifyEmailForm";
import type { VerifyingPasskeyPresentationProps } from "ente-accounts/components/LoginComponents";
@@ -30,10 +29,6 @@ function PasskeyPresentation(
}
function VerifyPage(): React.JSX.Element {
- if (!featureFlags.enableNewPhotosAuthFlow) {
- return <AccountsVerifyPage />;
- }
-
return (
<AccountsVerifyPage
presentation={VerifyEmailPresentation}