Skip to content

armgit / ente

Public Imported from GitHub
0

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

Another

Manav Rathib9d9c6f65a0e
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsx
index ce9ae1c2ba..082f48e9dd 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@ -109,6 +109,7 @@ import {
} from "ente-new/photos/services/user-details";
import { usePhotosAppContext } from "ente-new/photos/types/context";
import { initiateEmail, openURL } from "ente-new/photos/utils/web";
+import { wait } from "ente-utils/promise";
import { t } from "i18next";
import { useRouter } from "next/router";
import React, {
@@ -488,9 +489,10 @@ const ShortcutSection: React.FC<ShortcutSectionProps> = ({
);
const handleOpenHiddenSection = () =>
- void onShowCollectionSummary(PseudoCollectionID.hiddenItems, true).then(
- onCloseSidebar,
- );
+ void onShowCollectionSummary(PseudoCollectionID.hiddenItems, true)
+ // See: [Note: Workarounds for unactionable ARIA warnings]
+ .then(() => wait(10))
+ .then(onCloseSidebar);
const summaryCaption = (summaryID: number) =>
normalCollectionSummaries.get(summaryID)?.fileCount.toString();
diff --git a/web/packages/base/components/utils/theme.ts b/web/packages/base/components/utils/theme.ts
index 6962c90617..2c1ea3aa14 100644
--- a/web/packages/base/components/utils/theme.ts
+++ b/web/packages/base/components/utils/theme.ts
@@ -499,13 +499,26 @@ const components: Components = {
MuiDialog: {
defaultProps: {
- // [Note: Overzealous Chrome? Complicated ARIA?]
+ // [Note: Workarounds for unactionable ARIA warnings]
//
- // This is required to prevent console errors about aria-hiding a
- // focused button when the dialog is closed.
+ // This is required to prevent console warnings about aria-hiding a
+ // focused button when the dialog is closed. e.g. Select a file,
+ // delete it. On closing the confirmation dialog, the error appears.
+ //
+ // The default is supposed to already be false, but setting this
+ // again seems to help. But sometimes we need to set this to `true`
+ // to prevent the warning. And sometimes neither helps, and we need
+ // to add random setTimeouts.
+ //
+ // Angular, Bootstrap, MUI, shadcn: all seem to be emitting these
+ // warning (just search the web). I'm don't know if this is just
+ // someone at Chrome deciding to emit spurious warnings without
+ // understanding the flow, or if none of these libraries have
+ // managed to implement the ARIA spec properly yet (which says more
+ // about the spec than about the libraries).
//
- // - https://github.com/mui/material-ui/issues/43106#issuecomment-2314809028
// - https://issues.chromium.org/issues/392121909
+ // - https://github.com/mui/material-ui/issues/43106#issuecomment-2314809028
closeAfterTransition: false,
},
styleOverrides: {
diff --git a/web/packages/gallery/components/FileInfo.tsx b/web/packages/gallery/components/FileInfo.tsx
index 92f06a085e..177c2876e6 100644
--- a/web/packages/gallery/components/FileInfo.tsx
+++ b/web/packages/gallery/components/FileInfo.tsx
@@ -451,8 +451,8 @@ const FileInfoSidebar = styled(
<SidebarDrawer
{...props}
anchor="right"
- // See: [Note: Overzealous Chrome? Complicated ARIA?], but this time
- // with a different workaround.
+ // See: [Note: Workarounds for unactionable ARIA warnings], but this
+ // time with a different workaround.
//
// https://github.com/mui/material-ui/issues/43106#issuecomment-2514637251
disableRestoreFocus={true}
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts
index 0dbc902122..bd4151d68a 100644
--- a/web/packages/gallery/components/viewer/photoswipe.ts
+++ b/web/packages/gallery/components/viewer/photoswipe.ts
@@ -233,8 +233,8 @@ export class FileViewerPhotoSwipe {
// leave this at the default (true) and then swipe between slides
// fast, or show MUI drawers etc.
//
- // See: [Note: Overzealous Chrome? Complicated ARIA?], but time with
- // a different library.
+ // See: [Note: Workarounds for unactionable ARIA warnings], but time
+ // with a different library.
trapFocus: false,
// Set the index within files that we should open to. Subsequent
// updates to the index will be tracked by PhotoSwipe internally.