Skip to content

armgit / ente

Public Imported from GitHub
0

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

revert(photos):remove-links-navigation-gates

Aswin Asok06e762a275aa
diff --git a/web/apps/photos/src/components/gallery/PhotosNavigationShell.tsx b/web/apps/photos/src/components/gallery/PhotosNavigationShell.tsx
index 9c32dbdc6b..47756ba741 100644
--- a/web/apps/photos/src/components/gallery/PhotosNavigationShell.tsx
+++ b/web/apps/photos/src/components/gallery/PhotosNavigationShell.tsx
@@ -27,10 +27,8 @@ import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton"
import { NavbarBase } from "ente-base/components/Navbar";
import { useIsSmallWidth } from "ente-base/components/utils/hooks";
import { useModalVisibility } from "ente-base/components/utils/modal";
-import { isDevBuild } from "ente-base/env";
import { ut } from "ente-base/i18n";
import { thumbnailGridPadding } from "ente-new/photos/components/utils/thumbnail-grid-layout";
-import { useSettingsSnapshot } from "ente-new/photos/components/utils/use-snapshot";
import { PseudoCollectionID } from "ente-new/photos/services/collection-summary";
import { isMLSupported } from "ente-new/photos/services/ml";
import { t } from "i18next";
@@ -69,7 +67,6 @@ export const PhotosNavigationShell: React.FC<
children,
...props
}) => {
- const { isInternalUser } = useSettingsSnapshot();
const [railOpen, setRailOpen] = useState(true);
const [navigationCollapsed, setNavigationCollapsed] = useState(false);
const toggleRail = () => setRailOpen((open) => !open);
@@ -179,7 +176,6 @@ export const PhotosNavigationShell: React.FC<
{showNormalNavigation && (
<NormalNavigationRail
{...props}
- isInternalUser={isInternalUser}
isHome={
props.mode == "albums" &&
!props.isInSearchMode &&
@@ -316,7 +312,6 @@ const NormalNavigationRail: React.FC<
isHome: boolean;
opensDialog: boolean;
navigationOpen: boolean;
- isInternalUser: boolean;
}
> = ({
onSidebar,
@@ -326,7 +321,6 @@ const NormalNavigationRail: React.FC<
isHome,
opensDialog,
navigationOpen,
- isInternalUser,
...props
}) => (
<>
@@ -344,8 +338,7 @@ const NormalNavigationRail: React.FC<
})}
/>
{(["albums", "people", "links"] as const).map((item) =>
- (item == "people" && !isMLSupported) ||
- (item == "links" && !isInternalUser && !isDevBuild) ? null : (
+ item == "people" && !isMLSupported ? null : (
<Tooltip key={item} title={t(item)}>
<FocusVisibleButton
color="secondary"
diff --git a/web/apps/photos/src/utils/album-filters.ts b/web/apps/photos/src/utils/album-filters.ts
index 17a9d3c9c6..1442ad99d0 100644
--- a/web/apps/photos/src/utils/album-filters.ts
+++ b/web/apps/photos/src/utils/album-filters.ts
@@ -4,8 +4,7 @@ import {
} from "ente-new/photos/services/collection-summary";
import { t } from "i18next";
-export type AlbumFilter =
- "ente" | "shared" | "received" | "links" | "empty-albums";
+export type AlbumFilter = "ente" | "shared" | "received" | "empty-albums";
export const albumFilters: {
value: AlbumFilter;
@@ -23,11 +22,6 @@ export const albumFilters: {
label: () => t("received_albums_label"),
title: () => t("received_albums_title"),
},
- {
- value: "links",
- label: () => t("links_albums_label"),
- title: () => t("links_albums_title"),
- },
{
value: "empty-albums",
label: () => t("empty_albums"),
@@ -61,8 +55,6 @@ export const matchesAlbumFilter = (
!cs.attributes.has("archived") &&
cs.attributes.has("sharedIncoming")
);
- case "links":
- return cs.attributes.has("quickLink");
case "empty-albums":
return isBulkDeletableEmptyAlbum(cs);
}
diff --git a/web/apps/photos/tests/album-filters.test.ts b/web/apps/photos/tests/album-filters.test.ts
index 7a3d657498..ec63a24730 100644
--- a/web/apps/photos/tests/album-filters.test.ts
+++ b/web/apps/photos/tests/album-filters.test.ts
@@ -85,7 +85,6 @@ describe("album filters shared by the dialog and sidebar", () => {
expect(ids("ente")).toEqual([1, 2, 3, 4]);
expect(ids("shared")).toEqual([2, 4]);
expect(ids("received")).toEqual([3]);
- expect(ids("links")).toEqual([5]);
expect(albums.map(({ id }) => id)).toEqual([1, 2, 3, 4, 5]);
});
@@ -130,7 +129,6 @@ describe("album filters shared by the dialog and sidebar", () => {
"ente",
"shared",
"received",
- "links",
"empty-albums",
]);
expect(visibleAlbumFilters([]).map(({ value }) => value)).toEqual([
@@ -147,11 +145,11 @@ describe("album filters shared by the dialog and sidebar", () => {
];
const groups = (query: string) =>
visibleAlbumFilters(albums, query).map(({ value }) => value);
- expect(groups("holiday")).toEqual(["links"]);
+ expect(groups("holiday")).toEqual([]);
expect(groups(" WINTER ")).toEqual(["ente", "shared", "received"]);
expect(groups("summer")).toEqual(["ente"]);
expect(groups("missing")).toEqual([]);
- expect(groups(" ")).toEqual(["ente", "shared", "received", "links"]);
+ expect(groups(" ")).toEqual(["ente", "shared", "received"]);
});
test("search preserves empty-group availability when only one empty album matches", () => {
diff --git a/web/apps/photos/tests/sidebar-album-search.test.tsx b/web/apps/photos/tests/sidebar-album-search.test.tsx
index 0c5a6a5d46..20182685bd 100644
--- a/web/apps/photos/tests/sidebar-album-search.test.tsx
+++ b/web/apps/photos/tests/sidebar-album-search.test.tsx
@@ -93,15 +93,6 @@ const renderSearch = (
};
describe("sidebar album search across groups", () => {
- test("reveals matching quick links in the Albums Links group", () => {
- const html = renderSearch("trip");
- expect(html).toContain('aria-label="links_albums_title"');
- expect(html).not.toContain('aria-label="Ente"');
- expect(html).not.toContain('aria-label="shared_albums_title"');
- expect(html).toContain("Trip link");
- expect(html).not.toContain("no-matches.svg");
- });
-
test("reveals matching Shared albums while Ente is selected", () => {
const html = renderSearch("holiday");
expect(html).toContain('aria-label="shared_albums_title"');
@@ -130,7 +121,6 @@ describe("sidebar album search across groups", () => {
const html = renderSearch(query);
expect(html).toContain('aria-label="Ente"');
expect(html).toContain('aria-label="shared_albums_title"');
- expect(html).toContain('aria-label="links_albums_title"');
expect(html).toContain("Family");
expect(html).toContain("Holiday album");
expect(html).not.toContain("no-matches.svg");