Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(mobile): Bring Thread Menus to Desktop Parity #5962

Closedanirudhsama(GitHub profile, opens in a new tab)wants to merge 16 commits intomain fromrefs/pull/5962/headopened View on GitHub

Showing 27 changed files with 59 additions and 53 deletions (loading 25).

x
0 of 27 viewed, 27 left
55 additions and 53 deletionsapps/mobile/src/components/AndroidAnchoredMenu.tsxModified
View file
@@ -1,6 +1,6 @@
import type { MenuAction, MenuComponentProps } from "@react-native-menu/menu";
import { BlurView } from "expo-blur";
-import type { ReactNode } from "react";
+import { Fragment, type ReactNode } from "react";
import { useCallback, useEffect, useRef, useState } from "react";
import type { StyleProp, ViewStyle } from "react-native";
import { BackHandler, Pressable, ScrollView, View } from "react-native";
@@ -13,6 +13,7 @@
import { type AppSymbolName, SymbolView } from "./AppSymbol";
import { AppText as Text } from "./AppText";
import { OverlayPortal } from "./OverlayPortal";
+import { flattenInlineMenuSections } from "./android-menu-sections";
​
const MENU_WIDTH = 250;
const SCREEN_MARGIN = 12;
@@ -129,9 +130,7 @@
}, [anchor, close, submenuDepth]);
​
const parent = path.length > 0 ? path[path.length - 1] : null;
- const levelActions = (parent?.subactions ?? props.actions).filter(
- (action) => !(action.attributes?.hidden ?? false),
- );
+ const levelEntries = flattenInlineMenuSections(parent?.subactions ?? props.actions);
​
// Anchor in overlay-local coordinates (both measured in window space).
const local =
@@ -266,61 +265,64 @@