Skip to content
TypeScript

refactor(mobile): expose native menus through a shared Menu API (#19265)

Julius Marminged5ae09aef0b4
diff --git a/apps/mobile/src/components/AndroidAnchoredMenu.tsx b/apps/mobile/src/components/AndroidAnchoredMenu.tsx
index 5dccade1c9a..cf17368f69c 100644
--- a/apps/mobile/src/components/AndroidAnchoredMenu.tsx
+++ b/apps/mobile/src/components/AndroidAnchoredMenu.tsx
@@ -8,7 +8,7 @@ import Animated, { FadeIn } from "react-native-reanimated";
import { OverlayPortal } from "./OverlayPortal";
import { useAndroidControlSizing } from "./useAndroidControlSizing";
-import { MaterialMenuPopup } from "./MaterialMenuPopup";
+import { MenuPopup } from "./MenuPopup";
const SCREEN_MARGIN = 12;
const ANCHOR_GAP = 6;
@@ -201,7 +201,7 @@ export function AndroidAnchoredMenu(props: AndroidAnchoredMenuProps) {
>
<Pressable accessible={false} className="absolute inset-0" onPress={close} />
{!placeable || local === null ? null : !anchor.keyboardWasVisible ? (
- <MaterialMenuPopup
+ <MenuPopup
anchor={local}
menuWidth={menuWidth}
actions={levelActions}
@@ -237,7 +237,7 @@ export function AndroidAnchoredMenu(props: AndroidAnchoredMenuProps) {
keyboardShouldPersistTaps="always"
showsVerticalScrollIndicator={false}
>
- <MaterialMenuPopup
+ <MenuPopup
inline
anchor={local}
menuWidth={menuWidth}
diff --git a/apps/mobile/src/components/ComposerAttachmentButton.tsx b/apps/mobile/src/components/ComposerAttachmentButton.tsx
index b6b3d6e78a4..540232d15d8 100644
--- a/apps/mobile/src/components/ComposerAttachmentButton.tsx
+++ b/apps/mobile/src/components/ComposerAttachmentButton.tsx
@@ -3,7 +3,7 @@ import { Pressable } from "react-native";
import { useAndroidControlSizing } from "./useAndroidControlSizing";
import { SymbolView } from "./AppSymbol";
-import { ControlPillMenu } from "./ControlPill";
+import { Menu } from "./Menu";
const ATTACHMENT_MENU_ACTIONS: MenuAction[] = [
{ id: "photos", title: "Photo Library", image: "photo" },
@@ -41,7 +41,7 @@ export function ComposerAttachmentButton(props: {
}
return (
- <ControlPillMenu
+ <Menu
accessible
accessibilityLabel="Add attachment"
accessibilityRole="button"
@@ -55,6 +55,6 @@ export function ComposerAttachmentButton(props: {
}}
>
{button}
- </ControlPillMenu>
+ </Menu>
);
}
diff --git a/apps/mobile/src/components/ComposerToolbar.tsx b/apps/mobile/src/components/ComposerToolbar.tsx
index c21f51421d0..d73d3bae991 100644
--- a/apps/mobile/src/components/ComposerToolbar.tsx
+++ b/apps/mobile/src/components/ComposerToolbar.tsx
@@ -232,7 +232,7 @@ export function ComposerActionButton(props: {
readonly icon: ComponentProps<typeof SymbolView>["name"];
readonly onPress: () => void;
readonly variant?: "primary" | "danger";
- // Forwarded so a ControlPillMenu can drive this button as its long-press
+ // Forwarded so a Menu can drive this button as its long-press
// anchor: Android injects onLongPress, iOS injects onTouchStart and onPress.
readonly onLongPress?: PressableProps["onLongPress"];
readonly onTouchStart?: PressableProps["onTouchStart"];
diff --git a/apps/mobile/src/components/ControlPill.tsx b/apps/mobile/src/components/ControlPill.tsx
index c0e7a0b30e4..a4186fbdbd8 100644
--- a/apps/mobile/src/components/ControlPill.tsx
+++ b/apps/mobile/src/components/ControlPill.tsx
@@ -7,8 +7,6 @@ import { IconButton } from "./IconButton";
import { Button } from "./Button";
import { useAndroidControlSizing } from "./useAndroidControlSizing";
-export { ControlPillMenu } from "./ControlPillMenu";
-
export function ControlPill(props: {
readonly icon?: ComponentProps<typeof SymbolView>["name"];
readonly iconNode?: ReactNode;
diff --git a/apps/mobile/src/components/CopyTextButton.tsx b/apps/mobile/src/components/CopyTextButton.tsx
index f208a6a6c9b..d946d07bd93 100644
--- a/apps/mobile/src/components/CopyTextButton.tsx
+++ b/apps/mobile/src/components/CopyTextButton.tsx
@@ -10,7 +10,7 @@ export const CopyTextButton = memo(function CopyTextButton(props: {
readonly accessibilityLabel: string;
readonly text: string;
readonly onCopy?: () => Promise<void>;
- /** Lets a long-press menu wrap the button (`ControlPillMenu` injects it on Android). */
+ /** Lets a long-press menu wrap the button (`Menu` injects it on Android). */
readonly onLongPress?: () => void;
readonly tintColor?: ColorValue;
readonly copiedTintColor?: ColorValue;
diff --git a/apps/mobile/src/components/MediaActionsMenu.tsx b/apps/mobile/src/components/MediaActionsMenu.tsx
index 3fc9ea840e1..71c3d1e03ac 100644
--- a/apps/mobile/src/components/MediaActionsMenu.tsx
+++ b/apps/mobile/src/components/MediaActionsMenu.tsx
@@ -4,7 +4,7 @@ import { Platform, View, type PressableProps, type StyleProp, type ViewStyle } f
import type { useMediaActions } from "../state/mediaActions";
import { SymbolView } from "./AppSymbol";
-import { ControlPillMenu } from "./ControlPill";
+import { Menu } from "./Menu";
export function MediaActionsMenu(props: {
readonly media: ReturnType<typeof useMediaActions>;
@@ -15,9 +15,9 @@ export function MediaActionsMenu(props: {
if (props.media.actions.length === 0) return props.children ?? null;
// Android's normal anchored menu lives in the app-root portal, behind native modals.
const nativeAndroidMenu = props.inModal && Platform.OS === "android";
- const Menu = nativeAndroidMenu ? MenuView : ControlPillMenu;
+ const MediaMenu = nativeAndroidMenu ? MenuView : Menu;
return (
- <Menu
+ <MediaMenu
title={props.media.title}
style={props.style}
shouldOpenOnLongPress={props.children !== undefined}
@@ -40,6 +40,6 @@ export function MediaActionsMenu(props: {
<SymbolView name="ellipsis" size={20} tintColor="#ffffff" type="monochrome" />
</View>
)}
- </Menu>
+ </MediaMenu>
);
}
diff --git a/apps/mobile/src/components/ControlPillMenu.android.tsx b/apps/mobile/src/components/Menu.android.tsx
similarity index 91%
rename from apps/mobile/src/components/ControlPillMenu.android.tsx
rename to apps/mobile/src/components/Menu.android.tsx
index 984086eb8b1..9c61de93124 100644
--- a/apps/mobile/src/components/ControlPillMenu.android.tsx
+++ b/apps/mobile/src/components/Menu.android.tsx
@@ -1,10 +1,10 @@
import * as Haptics from "expo-haptics";
import { cloneElement, isValidElement, type ReactElement } from "react";
import { AndroidAnchoredMenu } from "./AndroidAnchoredMenu";
-import type { ControlPillMenuProps } from "./ControlPillMenu.types";
+import type { MenuProps } from "./Menu.types";
/** Uses the same actions as iOS menus, with Android appearance and editor anchoring. */
-export function ControlPillMenu(props: ControlPillMenuProps) {
+export function Menu(props: MenuProps) {
// Long-press menus keep their child interactive: the child element gets
// an injected onLongPress (mirroring the iOS context-menu interaction)
// so its own tap handling still works.
diff --git a/apps/mobile/src/components/ControlPillMenu.tsx b/apps/mobile/src/components/Menu.tsx
similarity index 96%
rename from apps/mobile/src/components/ControlPillMenu.tsx
rename to apps/mobile/src/components/Menu.tsx
index b2ddb54e454..89996083966 100644
--- a/apps/mobile/src/components/ControlPillMenu.tsx
+++ b/apps/mobile/src/components/Menu.tsx
@@ -11,7 +11,7 @@ import type { ColorValue, PressableProps } from "react-native";
import { withUniwind } from "uniwind";
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
import { withMenuActionIconColors } from "../lib/menu-action-colors";
-import type { ControlPillMenuProps } from "./ControlPillMenu.types";
+import type { MenuProps } from "./Menu.types";
const ThemedMenuView = withUniwind(
function NativeMenuView({
@@ -41,7 +41,7 @@ const ThemedMenuView = withUniwind(
},
);
-export function ControlPillMenu(props: ControlPillMenuProps) {
+export function Menu(props: MenuProps) {
const { themeAppearance } = useAppearancePreferences();
const isDarkMode = themeAppearance === "dark";
const menuPress = useRef({ isPreparing: false, isOpen: false, suppressPress: false });
diff --git a/apps/mobile/src/components/ControlPillMenu.types.ts b/apps/mobile/src/components/Menu.types.ts
similarity index 75%
rename from apps/mobile/src/components/ControlPillMenu.types.ts
rename to apps/mobile/src/components/Menu.types.ts
index eb8d58b6669..ea1f1c4eec0 100644
--- a/apps/mobile/src/components/ControlPillMenu.types.ts
+++ b/apps/mobile/src/components/Menu.types.ts
@@ -2,10 +2,7 @@ import type { MenuView } from "@react-native-menu/menu";
import type { ComponentProps, ReactNode } from "react";
import type { AccessibilityProps } from "react-native";
-export type ControlPillMenuProps = Omit<
- ComponentProps<typeof MenuView>,
- "children" | "themeVariant"
-> &
+export type MenuProps = Omit<ComponentProps<typeof MenuView>, "children" | "themeVariant"> &
Pick<AccessibilityProps, "accessible" | "accessibilityLabel" | "accessibilityRole"> & {
readonly children: ReactNode;
readonly className?: string;
diff --git a/apps/mobile/src/components/MaterialMenuPopup.android.tsx b/apps/mobile/src/components/MenuPopup.android.tsx
similarity index 97%
rename from apps/mobile/src/components/MaterialMenuPopup.android.tsx
rename to apps/mobile/src/components/MenuPopup.android.tsx
index b0ccbdbe066..13d66cbc74d 100644
--- a/apps/mobile/src/components/MaterialMenuPopup.android.tsx
+++ b/apps/mobile/src/components/MenuPopup.android.tsx
@@ -13,7 +13,7 @@ import { resolveScaledTextRole } from "../lib/appearancePreferences";
import { useAndroidControlSizing } from "./useAndroidControlSizing";
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
-import type { MaterialMenuPopupProps } from "./MaterialMenuPopup";
+import type { MenuPopupProps } from "./MenuPopup";
import { isAppSymbolName, SymbolView, type AppSymbolName } from "./AppSymbol";
function MenuIcon(props: {
@@ -46,7 +46,7 @@ function MenuIcon(props: {
}
/** Native popup positioned at the original trigger, outside virtualized rows. */
-export function MaterialMenuPopup(props: MaterialMenuPopupProps) {
+export function MenuPopup(props: MenuPopupProps) {
const { appearance, themeVariables: colors } = useAppearancePreferences();
const { scale, menuItemHeight } = useAndroidControlSizing();
const body = resolveScaledTextRole("body", appearance.baseFontSize);
diff --git a/apps/mobile/src/components/MaterialMenuPopup.tsx b/apps/mobile/src/components/MenuPopup.tsx
similarity index 83%
rename from apps/mobile/src/components/MaterialMenuPopup.tsx
rename to apps/mobile/src/components/MenuPopup.tsx
index 06019a0e151..b3ede1ad939 100644
--- a/apps/mobile/src/components/MaterialMenuPopup.tsx
+++ b/apps/mobile/src/components/MenuPopup.tsx
@@ -1,6 +1,6 @@
import type { MenuAction } from "@react-native-menu/menu";
-export interface MaterialMenuPopupProps {
+export interface MenuPopupProps {
readonly menuWidth: number;
readonly anchor: {
readonly x: number;
@@ -18,6 +18,6 @@ export interface MaterialMenuPopupProps {
readonly inline?: boolean;
}
-export function MaterialMenuPopup(_props: MaterialMenuPopupProps) {
+export function MenuPopup(_props: MenuPopupProps) {
return null;
}
diff --git a/apps/mobile/src/components/ScreenHeader.android.tsx b/apps/mobile/src/components/ScreenHeader.android.tsx
index 42620d39aa3..57068dfc034 100644
--- a/apps/mobile/src/components/ScreenHeader.android.tsx
+++ b/apps/mobile/src/components/ScreenHeader.android.tsx
@@ -14,7 +14,7 @@ import { useAppearancePreferences } from "../features/settings/appearance/Appear
import { AndroidScreenHeader } from "./AndroidScreenHeader";
import { ScreenHeaderButton } from "./ScreenHeaderButton.android";
import { SymbolView } from "./AppSymbol";
-import { ControlPillMenu } from "./ControlPill";
+import { Menu } from "./Menu";
import { SearchField } from "./SearchField";
import { androidHeaderMenuActions, findHeaderMenuAction } from "./headerMenu.android";
import type { ScreenHeaderProps } from "./ScreenHeader.types";
@@ -43,7 +43,7 @@ export function ScreenHeader(props: ScreenHeaderProps) {
return () => subscription.remove();
}, [closeSearch, searching, search?.mode]);
const menuView = props.menus?.map((menu) => (
- <ControlPillMenu
+ <Menu
key={menu.title}
actions={androidHeaderMenuActions(menu.items)}
isAnchoredToRight
@@ -70,7 +70,7 @@ export function ScreenHeader(props: ScreenHeaderProps) {
) : (
<ScreenHeaderButton accessibilityLabel={menu.title} icon={menu.icon} />
)}
- </ControlPillMenu>
+ </Menu>
));
const options = (
<NativeStackScreenOptions
diff --git a/apps/mobile/src/features/browser/BrowserTabMenu.tsx b/apps/mobile/src/features/browser/BrowserTabMenu.tsx
index cd55e2d0307..20066d4417a 100644
--- a/apps/mobile/src/features/browser/BrowserTabMenu.tsx
+++ b/apps/mobile/src/features/browser/BrowserTabMenu.tsx
@@ -11,7 +11,8 @@ import {
import { PREVIEW_VIEWPORT_PRESETS } from "@t3tools/shared/previewViewport";
import { Alert } from "react-native";
-import { ControlPill, ControlPillMenu } from "../../components/ControlPill";
+import { ControlPill } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { previewEnvironment } from "../../state/preview";
import { useAtomCommand } from "../../state/use-atom-command";
@@ -144,7 +145,7 @@ export function BrowserTabMenu({
);
if (disabled) return pill;
return (
- <ControlPillMenu
+ <Menu
accessible
accessibilityLabel="Browser tab options"
accessibilityRole="button"
@@ -152,6 +153,6 @@ export function BrowserTabMenu({
onPressAction={({ nativeEvent }) => onAction(nativeEvent.event)}
>
{pill}
- </ControlPillMenu>
+ </Menu>
);
}
diff --git a/apps/mobile/src/features/cloud/T3ConnectProfilePage.tsx b/apps/mobile/src/features/cloud/T3ConnectProfilePage.tsx
index a49a80709fb..53073889848 100644
--- a/apps/mobile/src/features/cloud/T3ConnectProfilePage.tsx
+++ b/apps/mobile/src/features/cloud/T3ConnectProfilePage.tsx
@@ -12,7 +12,7 @@ import { Alert, Pressable, RefreshControl, ScrollView, Text, View } from "react-
import { AppActivityIndicator } from "../../components/AppActivityIndicator";
import { SymbolView } from "../../components/AppSymbol";
import { showConfirmDialog } from "../../components/ConfirmDialogHost";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
import { useAtomCommand } from "../../state/use-atom-command";
import {
@@ -176,7 +176,7 @@ export function T3ConnectProfilePage() {
size="small"
/>
) : (
- <ControlPillMenu
+ <Menu
actions={ENVIRONMENT_MENU_ACTIONS}
isAnchoredToRight
onPressAction={() =>
@@ -198,7 +198,7 @@ export function T3ConnectProfilePage() {
/>
</View>
</Pressable>
- </ControlPillMenu>
+ </Menu>
)
}
/>
diff --git a/apps/mobile/src/features/development/ComponentCatalogScreen.tsx b/apps/mobile/src/features/development/ComponentCatalogScreen.tsx
index c3320e3aad1..3e7af4b2cc5 100644
--- a/apps/mobile/src/features/development/ComponentCatalogScreen.tsx
+++ b/apps/mobile/src/features/development/ComponentCatalogScreen.tsx
@@ -5,7 +5,7 @@ import { Alert, Platform, View, type TextInputInstance } from "react-native";
import { AppText, AppTextInput } from "../../components/AppText";
import { AppSheet } from "../../components/AppSheet";
import { Chip } from "../../components/Chip";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
+import { Menu } from "../../components/Menu";
import { ListActionRow } from "../../components/ListActionRow";
import { ListChoiceRow } from "../../components/ListChoiceRow";
import { ListRow } from "../../components/ListRow";
@@ -221,7 +221,7 @@ export function ComponentCatalogScreen() {
<View className="flex-row flex-wrap gap-2">
<Button label="Sheet" onPress={() => setSheet(true)} />
<Button label="Dialog" onPress={confirm} />
- <ControlPillMenu
+ <Menu
title="Example menu"
actions={[
{ id: "copy", title: "Copy", image: "doc.on.doc" },
@@ -232,7 +232,7 @@ export function ComponentCatalogScreen() {
}
>
<Chip label="Menu" trailingIcon="chevron.down" />
- </ControlPillMenu>
+ </Menu>
</View>
<View className="relative h-3 overflow-hidden rounded-full bg-subtle">
<LoadingStrip progress={0.6} />
diff --git a/apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx b/apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx
index 0685fee95b7..cc7bec550a8 100644
--- a/apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx
+++ b/apps/mobile/src/features/devices/DevicePreviewRouteScreen.tsx
@@ -16,7 +16,8 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
import { SymbolView } from "../../components/AppSymbol";
import { AppActivityIndicator } from "../../components/AppActivityIndicator";
import { AppText } from "../../components/AppText";
-import { ControlPill, ControlPillMenu } from "../../components/ControlPill";
+import { ControlPill } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { GlassSurface } from "../../components/GlassSurface";
import {
androidHeaderMenuActions,
@@ -345,7 +346,7 @@ function DevicePreviewScreen({
function DeviceOptionsMenu({ items }: { readonly items: ReadonlyArray<ScreenHeaderMenuItem> }) {
return (
- <ControlPillMenu
+ <Menu
actions={androidHeaderMenuActions(items)}
isAnchoredToRight
title="Device options"
@@ -361,7 +362,7 @@ function DeviceOptionsMenu({ items }: { readonly items: ReadonlyArray<ScreenHead
>
<SymbolView name="ellipsis" size={18} tintColorClassName="accent-icon" />
</Pressable>
- </ControlPillMenu>
+ </Menu>
);
}
diff --git a/apps/mobile/src/features/files/AttachmentFileScreen.tsx b/apps/mobile/src/features/files/AttachmentFileScreen.tsx
index e877b165eb9..f3b667a05a7 100644
--- a/apps/mobile/src/features/files/AttachmentFileScreen.tsx
+++ b/apps/mobile/src/features/files/AttachmentFileScreen.tsx
@@ -10,7 +10,7 @@ import { Alert, Platform, ScrollView, View } from "react-native";
import { AndroidHeaderIconButton, AndroidScreenHeader } from "../../components/AndroidScreenHeader";
import { AppText as Text } from "../../components/AppText";
import { AudioFilePreview } from "../../components/AudioFilePreview";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { EmptyState } from "../../components/EmptyState";
import { FilePreviewModal, type FilePreviewSource } from "../../components/FilePreviewModal";
import { useAttachmentDocument } from "../../lib/attachmentDocument";
@@ -368,14 +368,14 @@ export function AttachmentFileScreen(props: AttachmentFileScreenProps) {
subtitle={subtitle}
onBack={handleBack}
trailing={
- <ControlPillMenu
+ <Menu
actions={androidMenuActions}
isAnchoredToRight
title="File actions"
onPressAction={handleAndroidMenuAction}
>
<AndroidHeaderIconButton accessibilityLabel="File actions" icon="ellipsis" />
- </ControlPillMenu>
+ </Menu>
}
/>
) : null}
diff --git a/apps/mobile/src/features/home/MaterialThreadListToolbar.tsx b/apps/mobile/src/features/home/MaterialThreadListToolbar.tsx
index b79d939df9e..fe65d47dc39 100644
--- a/apps/mobile/src/features/home/MaterialThreadListToolbar.tsx
+++ b/apps/mobile/src/features/home/MaterialThreadListToolbar.tsx
@@ -15,7 +15,7 @@ import { AndroidHeaderIconButton } from "../../components/AndroidScreenHeader";
import { CompactBrandTitle } from "../../components/CompactBrandTitle";
import { MaterialFloatingActionButton } from "../../components/MaterialFloatingActionButton";
import { AndroidAnchoredMenu } from "../../components/AndroidAnchoredMenu";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { SearchField } from "../../components/SearchField";
import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";
import { WorkspaceConnectionTitle } from "./WorkspaceConnectionTitle";
@@ -29,7 +29,7 @@ export function MaterialThreadListToolbar(props: {
readonly onSearchQueryChange: (query: string) => void;
readonly filterActions: MenuAction[];
readonly filterCustomized: boolean;
- readonly onFilterAction: NonNullable<ComponentProps<typeof ControlPillMenu>["onPressAction"]>;
+ readonly onFilterAction: NonNullable<ComponentProps<typeof Menu>["onPressAction"]>;
readonly onOpenSettings: () => void;
readonly onOpenEnvironments: () => void;
readonly sidebar?: boolean;
diff --git a/apps/mobile/src/features/home/thread-swipe-actions.tsx b/apps/mobile/src/features/home/thread-swipe-actions.tsx
index 1d61cd3a0af..9bb6a71b26f 100644
--- a/apps/mobile/src/features/home/thread-swipe-actions.tsx
+++ b/apps/mobile/src/features/home/thread-swipe-actions.tsx
@@ -1,5 +1,5 @@
import { SymbolView } from "../../components/AppSymbol";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import type { MenuAction } from "@react-native-menu/menu";
import * as Haptics from "expo-haptics";
import {
@@ -64,7 +64,7 @@ interface ThreadSwipeAction {
readonly label: string;
readonly menu?: {
readonly actions: MenuAction[];
- readonly onPressAction: NonNullable<ComponentProps<typeof ControlPillMenu>["onPressAction"]>;
+ readonly onPressAction: NonNullable<ComponentProps<typeof Menu>["onPressAction"]>;
readonly title?: string;
};
readonly onPress: () => void;
@@ -685,14 +685,14 @@ function SwipeActionButton(props: {
{props.menu === undefined ? (
button
) : (
- <ControlPillMenu
+ <Menu
actions={props.menu.actions}
onPressAction={props.menu.onPressAction}
title={props.menu.title}
style={{ height: "100%", width: "100%" }}
>
{button}
- </ControlPillMenu>
+ </Menu>
)}
</Animated.View>
);
diff --git a/apps/mobile/src/features/pull-requests/PullRequestActivityFilters.tsx b/apps/mobile/src/features/pull-requests/PullRequestActivityFilters.tsx
index 8d2b6ea0624..3965b0c6b2a 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestActivityFilters.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestActivityFilters.tsx
@@ -1,7 +1,7 @@
import { Pressable, View } from "react-native";
import { AppText as Text } from "../../components/AppText";
import { SymbolView } from "../../components/AppSymbol";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
+import { Menu } from "../../components/Menu";
import type { ActivityFilter } from "./pullRequestActivityFilter";
export function PullRequestActivityFilters({
@@ -20,7 +20,7 @@ export function PullRequestActivityFilters({
] as const;
return (
<View className="mb-4 flex-row items-center justify-between gap-3">
- <ControlPillMenu
+ <Menu
title="Activity"
actions={kinds.map((kind) => ({ ...kind, state: value.kind === kind.id ? "on" : "off" }))}
onPressAction={({ nativeEvent }) => {
@@ -38,9 +38,9 @@ export function PullRequestActivityFilters({
</Text>
<SymbolView name="chevron.down" size={11} tintColorClassName="accent-icon-muted" />
</Pressable>
- </ControlPillMenu>
+ </Menu>
<View className="flex-row items-center gap-3">
- <ControlPillMenu
+ <Menu
title="Show in activity"
actions={[
{ id: "bots", title: "Bot comments", state: value.bots ? "on" : "off" },
@@ -69,7 +69,7 @@ export function PullRequestActivityFilters({
tintColorClassName="accent-icon-muted"
/>
</Pressable>
- </ControlPillMenu>
+ </Menu>
<Pressable
accessibilityRole="button"
accessibilityLabel={value.newestFirst ? "Newest first" : "Oldest first"}
diff --git a/apps/mobile/src/features/pull-requests/PullRequestAgentRow.tsx b/apps/mobile/src/features/pull-requests/PullRequestAgentRow.tsx
index e93714539fe..fde7f3820e3 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestAgentRow.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestAgentRow.tsx
@@ -1,5 +1,5 @@
import type { PullRequestDetail } from "@t3tools/contracts";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
+import { Menu } from "../../components/Menu";
import { PullRequestCardRow } from "./PullRequestControls";
import type { PullRequestAgentTask } from "./pullRequestAgentTasks";
import { usePullRequestAgentActions } from "./usePullRequestAgentActions";
@@ -29,12 +29,12 @@ export function PullRequestAgentRow(props: {
);
if (agent.threads.length <= 1 || action.attributes.disabled) return row;
return (
- <ControlPillMenu
+ <Menu
title={props.title ?? action.title}
actions={agent.threadActions(props.task)}
onPressAction={({ nativeEvent }) => agent.select(nativeEvent.event)}
>
{row}
- </ControlPillMenu>
+ </Menu>
);
}
diff --git a/apps/mobile/src/features/pull-requests/PullRequestControls.tsx b/apps/mobile/src/features/pull-requests/PullRequestControls.tsx
index d340b6f9ba6..941ba19f9ee 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestControls.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestControls.tsx
@@ -10,7 +10,7 @@ import { SymbolView, type AppSymbolName } from "../../components/AppSymbol";
import { Button } from "../../components/Button";
import { IconButton } from "../../components/IconButton";
import { MaterialFloatingToolbar } from "./MaterialFloatingToolbar";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
+import { Menu } from "../../components/Menu";
import { NativeHeaderToolbar } from "../../native/StackHeader";
import { useNativeLayoutMetrics } from "../../native/native-layout-metrics";
import { type PullRequestParams } from "./usePullRequestDiff";
@@ -154,7 +154,7 @@ export function PullRequestActionToolbar(props: {
<MaterialFloatingToolbar>
<View className="flex-row items-center gap-2">
{showAgentControls ? (
- <ControlPillMenu
+ <Menu
title="AI helpers"
actions={agentActions.map((action) => agent.menuAction(action.task))}
onPressAction={({ nativeEvent }) => agent.select(nativeEvent.event)}
@@ -166,18 +166,18 @@ export function PullRequestActionToolbar(props: {
disabled={agent.disabled}
/>
</View>
- </ControlPillMenu>
+ </Menu>
) : null}
{showPrimary ? (
<View className="min-w-0 shrink">
{!pendingReview && chooseThread ? (
- <ControlPillMenu
+ <Menu
title="Open thread"
actions={threadMenuItems}
onPressAction={({ nativeEvent }) => agent.select(nativeEvent.event)}
>
<View pointerEvents="none">{primary}</View>
- </ControlPillMenu>
+ </Menu>
) : (
primary
)}
diff --git a/apps/mobile/src/features/pull-requests/PullRequestFiles.tsx b/apps/mobile/src/features/pull-requests/PullRequestFiles.tsx
index 432bc83a3c9..cd4ab7dfb94 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestFiles.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestFiles.tsx
@@ -7,7 +7,7 @@ import { useState } from "react";
import { ActivityIndicator, Pressable, View } from "react-native";
import { AppText as Text } from "../../components/AppText";
import { EmptyState } from "../../components/EmptyState";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
+import { Menu } from "../../components/Menu";
import { Button } from "../../components/Button";
import { IconButton } from "../../components/IconButton";
import { SymbolView } from "../../components/AppSymbol";
@@ -215,7 +215,7 @@ export function usePullRequestFilesContent(props: {
deletions={parsed.deletions}
compact
/>
- <ControlPillMenu
+ <Menu
title="Review files"
actions={[
{
@@ -234,7 +234,7 @@ export function usePullRequestFilesContent(props: {
selected={filter.hideTestFiles}
/>
</View>
- </ControlPillMenu>
+ </Menu>
</View>
{parsed.files.length === 0 && filter.hiddenCount > 0 ? (
<EmptyState
diff --git a/apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx b/apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx
index 24296142593..12ef2638534 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestListFilters.tsx
@@ -1,7 +1,7 @@
import { sortProjectsByGroupOrder } from "@t3tools/client-runtime/state/project-grouping";
import { useMemo } from "react";
import { ScrollView } from "react-native";
-import type { ControlPillMenuProps } from "../../components/ControlPillMenu.types";
+import type { MenuProps } from "../../components/Menu.types";
import { ListFilterMenu } from "../workspace/ListFilterMenu";
import { useProjects, useThreadShells } from "../../state/entities";
import { useMobileProjectGroupingSettings } from "../../state/project-grouping";
@@ -176,7 +176,7 @@ export function PullRequestListFilters(props: {
Number(Boolean(value.filters.review)) +
Number(Boolean(value.filters.checks)) +
Number(Boolean(value.projectId));
- const more: ControlPillMenuProps["actions"] = [
+ const more: MenuProps["actions"] = [
{
id: "drafts",
title: value.filters.draft ? DRAFTS[value.filters.draft] : "Drafts",
diff --git a/apps/mobile/src/features/pull-requests/PullRequestListRow.tsx b/apps/mobile/src/features/pull-requests/PullRequestListRow.tsx
index 7f59f2406d1..200dbdaad0d 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestListRow.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestListRow.tsx
@@ -2,8 +2,8 @@ import { memo } from "react";
import { Pressable, View } from "react-native";
import { AppText as Text } from "../../components/AppText";
import { SymbolView } from "../../components/AppSymbol";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
-import type { ControlPillMenuProps } from "../../components/ControlPillMenu.types";
+import { Menu } from "../../components/Menu";
+import type { MenuProps } from "../../components/Menu.types";
import { cn } from "../../lib/cn";
import { relativeTime } from "../../lib/time";
import {
@@ -27,7 +27,7 @@ export const PullRequestListRow = memo(
readonly selected: boolean;
readonly sidebar: boolean;
readonly busy: boolean;
- readonly getActions: (item: EnvironmentPullRequestListEntry) => ControlPillMenuProps["actions"];
+ readonly getActions: (item: EnvironmentPullRequestListEntry) => MenuProps["actions"];
readonly onAction: (item: EnvironmentPullRequestListEntry, action: string) => void;
}) {
const { item } = props;
@@ -56,7 +56,7 @@ export const PullRequestListRow = memo(
: "accent-warning-foreground";
return (
<View style={props.sidebar ? THREAD_LIST_V2_SIDEBAR_ROW_CONTAINER_STYLE : undefined}>
- <ControlPillMenu
+ <Menu
shouldOpenOnLongPress
title={`#${item.number} · ${item.repository}`}
actions={props.getActions(item)}
@@ -185,7 +185,7 @@ export const PullRequestListRow = memo(
</View>
</View>
</Pressable>
- </ControlPillMenu>
+ </Menu>
</View>
);
},
diff --git a/apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx b/apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx
index f228467d2e9..48d04d3b8a3 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestMergeControls.tsx
@@ -6,7 +6,7 @@ import { useRef, useState } from "react";
import { ActivityIndicator, Alert, Platform, Pressable, View } from "react-native";
import { AppText as Text } from "../../components/AppText";
import { SymbolView } from "../../components/AppSymbol";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
+import { Menu } from "../../components/Menu";
import { Button } from "../../components/Button";
import { IconButton } from "../../components/IconButton";
import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
@@ -213,7 +213,7 @@ export function PullRequestMergeControls(props: {
</Pressable>
)}
{methods.length > 0 || canAutoMerge ? (
- <ControlPillMenu
+ <Menu
title="Merge options"
actions={[
...methods.map((id) => ({
@@ -263,7 +263,7 @@ export function PullRequestMergeControls(props: {
/>
</Pressable>
)}
- </ControlPillMenu>
+ </Menu>
) : null}
</View>
{permissions.connected &&
diff --git a/apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx b/apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
index 7bea9752a37..88b7e52ce82 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx
@@ -25,7 +25,7 @@ import {
PR_ACTION_LABELS,
} from "./pullRequestActions";
import * as Clipboard from "expo-clipboard";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
+import { Menu } from "../../components/Menu";
import { IconButton } from "../../components/IconButton";
import { Button } from "../../components/Button";
import { usePullRequestReviewDraft } from "./usePullRequestReviewDraft";
@@ -965,7 +965,7 @@ export function PullRequestFileRouteScreen({
title={title}
onBack={() => navigation.goBack()}
trailing={
- <ControlPillMenu
+ <Menu
actions={[
{
id: "word-wrap",
@@ -1010,7 +1010,7 @@ export function PullRequestFileRouteScreen({
<View pointerEvents="none">
<IconButton icon="ellipsis" accessibilityLabel="Diff options" />
</View>
- </ControlPillMenu>
+ </Menu>
}
/>
) : null}
diff --git a/apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx b/apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx
index c39cea3187a..de954b0c407 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestStatusRows.tsx
@@ -8,7 +8,7 @@ import { useState } from "react";
import { Linking, Pressable, View } from "react-native";
import { AppText as Text } from "../../components/AppText";
import { SymbolView } from "../../components/AppSymbol";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
+import { Menu } from "../../components/Menu";
import { PullRequestAvatar } from "./PullRequestPresentation";
import { PullRequestCardRow } from "./PullRequestControls";
import { PullRequestAgentRow } from "./PullRequestAgentRow";
@@ -64,7 +64,7 @@ export function PullRequestStatusMenu(props: RowProps) {
);
if (!actions.length) return trigger;
return (
- <ControlPillMenu
+ <Menu
title="Pull request status"
actions={actions.map((id) => ({
id,
@@ -91,7 +91,7 @@ export function PullRequestStatusMenu(props: RowProps) {
}}
>
{trigger}
- </ControlPillMenu>
+ </Menu>
);
}
@@ -209,7 +209,7 @@ export function PullRequestBranchRow(props: RowProps) {
);
if (!methods.length && !canResolve) return row;
return (
- <ControlPillMenu
+ <Menu
title="Branch"
actions={[
...(canResolve ? [agent.menuAction("conflicts")] : []),
@@ -222,7 +222,7 @@ export function PullRequestBranchRow(props: RowProps) {
}}
>
{row}
- </ControlPillMenu>
+ </Menu>
);
}
diff --git a/apps/mobile/src/features/pull-requests/guide/GuideOutline.tsx b/apps/mobile/src/features/pull-requests/guide/GuideOutline.tsx
index 08bf79db5cb..bd1c25babd5 100644
--- a/apps/mobile/src/features/pull-requests/guide/GuideOutline.tsx
+++ b/apps/mobile/src/features/pull-requests/guide/GuideOutline.tsx
@@ -4,7 +4,7 @@ import { Pressable, View } from "react-native";
import { AppText as Text } from "../../../components/AppText";
import { SymbolView } from "../../../components/AppSymbol";
import { PullRequestMarkdown } from "../PullRequestMarkdown";
-import { ControlPillMenu } from "../../../components/ControlPillMenu";
+import { Menu } from "../../../components/Menu";
import { useAppearancePreferences } from "../../settings/appearance/AppearancePreferencesProvider";
@@ -29,7 +29,7 @@ export function GuideOutline({
through {files.size} {files.size === 1 ? "file" : "files"}
</Text>
</View>
- <ControlPillMenu
+ <Menu
title="Guide options"
actions={[
{
@@ -55,7 +55,7 @@ export function GuideOutline({
>
<SymbolView name="ellipsis" size={20} tintColorClassName="accent-icon-muted" />
</Pressable>
- </ControlPillMenu>
+ </Menu>
</View>
{guide.stops[0]?.summary ? (
<View className="mb-6">
diff --git a/apps/mobile/src/features/pull-requests/guide/PullRequestGuideScreen.tsx b/apps/mobile/src/features/pull-requests/guide/PullRequestGuideScreen.tsx
index 5545ff85029..4a59aa843eb 100644
--- a/apps/mobile/src/features/pull-requests/guide/PullRequestGuideScreen.tsx
+++ b/apps/mobile/src/features/pull-requests/guide/PullRequestGuideScreen.tsx
@@ -14,7 +14,7 @@ import { SymbolView } from "../../../components/AppSymbol";
import { GuideOutline } from "./GuideOutline";
import { AppText as Text } from "../../../components/AppText";
import { ScreenScrollView } from "../../../components/ScreenScrollView";
-import { ControlPillMenu } from "../../../components/ControlPillMenu";
+import { Menu } from "../../../components/Menu";
import { IconButton } from "../../../components/IconButton";
import { useAppearancePreferences } from "../../settings/appearance/AppearancePreferencesProvider";
import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../../native/StackHeader";
@@ -144,7 +144,7 @@ export function PullRequestGuideStopScreen({ route }: StaticScreenProps<GuideSto
title={`Stop ${route.params.position + 1}`}
onBack={() => navigation.goBack()}
trailing={
- <ControlPillMenu
+ <Menu
actions={[
{
id: "word-wrap",
@@ -158,7 +158,7 @@ export function PullRequestGuideStopScreen({ route }: StaticScreenProps<GuideSto
<View pointerEvents="none">
<IconButton icon="ellipsis" accessibilityLabel="Guide options" />
</View>
- </ControlPillMenu>
+ </Menu>
}
/>
) : null}
diff --git a/apps/mobile/src/features/pull-requests/usePullRequestListActions.ts b/apps/mobile/src/features/pull-requests/usePullRequestListActions.ts
index cb63c186248..28732e4440c 100644
--- a/apps/mobile/src/features/pull-requests/usePullRequestListActions.ts
+++ b/apps/mobile/src/features/pull-requests/usePullRequestListActions.ts
@@ -6,7 +6,7 @@ import * as Clipboard from "expo-clipboard";
import { Atom } from "effect/reactivity";
import { use, useCallback, useMemo, useRef, useState } from "react";
import { Alert, Linking, Platform, Share } from "react-native";
-import type { ControlPillMenuProps } from "../../components/ControlPillMenu.types";
+import type { MenuProps } from "../../components/Menu.types";
import { composerPullRequests } from "../../state/pull-requests";
import { useAtomCommand } from "../../state/use-atom-command";
import {
@@ -152,7 +152,7 @@ export function usePullRequestListActions(
[navigation, params, perform, selectAndroidWorkspace],
);
const actions = useCallback(
- (entry: EnvironmentPullRequestListEntry): ControlPillMenuProps["actions"] => [
+ (entry: EnvironmentPullRequestListEntry): MenuProps["actions"] => [
{
id: "open",
title: "Open pull request",
diff --git a/apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
index 674529ba024..3de5a18e18c 100644
--- a/apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
+++ b/apps/mobile/src/features/settings/SettingsScheduledTasksRouteScreen.tsx
@@ -46,7 +46,7 @@ import {
EnvironmentMachineSymbol,
ENVIRONMENT_MACHINE_SYMBOLS,
} from "../../components/EnvironmentMachineSymbol";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import type { ComposerEditorSelection } from "../../components/ComposerEditor";
import { ScreenScrollView as ScrollView } from "../../components/ScreenScrollView";
import { SegmentedControl } from "../../components/SegmentedControl";
@@ -203,7 +203,7 @@ function SelectRow(props: {
);
}
return (
- <ControlPillMenu
+ <Menu
actions={props.actions}
onPressAction={({ nativeEvent }) => props.onSelect(nativeEvent.event)}
>
@@ -225,7 +225,7 @@ function SelectRow(props: {
type="monochrome"
/>
</Pressable>
- </ControlPillMenu>
+ </Menu>
);
}
@@ -1232,7 +1232,7 @@ function EnvironmentTasks({
</Text>
) : null}
</Pressable>
- <ControlPillMenu
+ <Menu
actions={[
{ id: "edit", title: "Edit" },
{
@@ -1279,7 +1279,7 @@ function EnvironmentTasks({
type="monochrome"
/>
</Pressable>
- </ControlPillMenu>
+ </Menu>
</View>
))
)}
diff --git a/apps/mobile/src/features/settings/components/SettingsEnvironmentFilterHeader.tsx b/apps/mobile/src/features/settings/components/SettingsEnvironmentFilterHeader.tsx
index 1613e4a8a2d..f7e84da93b6 100644
--- a/apps/mobile/src/features/settings/components/SettingsEnvironmentFilterHeader.tsx
+++ b/apps/mobile/src/features/settings/components/SettingsEnvironmentFilterHeader.tsx
@@ -3,7 +3,7 @@ import type { NativeStackHeaderItem } from "@react-navigation/native-stack";
import { resolveEnvironmentMachineKind } from "@t3tools/contracts";
import { Platform, Pressable } from "react-native";
-import { ControlPillMenu } from "../../../components/ControlPill";
+import { Menu } from "../../../components/Menu";
import { SymbolView } from "../../../components/AppSymbol";
import { ENVIRONMENT_MACHINE_SYMBOLS } from "../../../components/EnvironmentMachineSymbol";
import { NativeStackScreenOptions } from "../../../native/StackHeader";
@@ -153,7 +153,7 @@ export function AndroidSettingsEnvironmentFilter() {
: "line.3.horizontal.decrease.circle.fill";
return (
- <ControlPillMenu
+ <Menu
accessible
accessibilityRole="button"
accessibilityLabel="Filter settings environments and projects"
@@ -208,6 +208,6 @@ export function AndroidSettingsEnvironmentFilter() {
>
<SymbolView name={filterIcon} size={22} tintColorClassName="accent-icon" />
</Pressable>
- </ControlPillMenu>
+ </Menu>
);
}
diff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsx
index a45f319423f..586c37fd632 100644
--- a/apps/mobile/src/features/threads/ThreadComposer.tsx
+++ b/apps/mobile/src/features/threads/ThreadComposer.tsx
@@ -96,7 +96,7 @@ import {
import { useScaledTextRole } from "../settings/appearance/useScaledTextRole";
import type { RemoteClientConnectionState } from "../../lib/connection";
import { resolveProviderOptionDescriptors } from "../../lib/providerOptions";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import type { ActiveTurnComposerAction } from "@t3tools/client-runtime/state/composer-dispatch";
import type { FollowUpBehavior } from "../../lib/followUpBehavior";
import {
@@ -294,7 +294,7 @@ function SendActionButton(props: {
(action): action is ActiveTurnComposerAction => action !== null,
);
return (
- <ControlPillMenu
+ <Menu
accessibilityLabel="Choose how to send this message"
shouldOpenOnLongPress
actions={actions.map((action) => ({
@@ -308,7 +308,7 @@ function SendActionButton(props: {
}
>
{button}
- </ControlPillMenu>
+ </Menu>
);
}
diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx
index d47466ecc38..898017f3b77 100644
--- a/apps/mobile/src/features/threads/ThreadFeed.tsx
+++ b/apps/mobile/src/features/threads/ThreadFeed.tsx
@@ -138,7 +138,7 @@ import {
type MediaVideoPreviewSource,
} from "../../lib/videoPreviewSource";
import { CopyTextButton } from "../../components/CopyTextButton";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { copyPromptLink } from "../prompt-links/prompt-link-actions";
import { parseReviewCommentMessageSegments } from "../review/reviewCommentSelection";
import type { ReviewDiffTheme } from "../review/shikiReviewHighlighter";
@@ -354,7 +354,7 @@ function UserMessageCopyButton(props: {
const linkText = replaceComposerContextReferences(props.text, (reference) => reference.label);
if (linkText.length > PROMPT_LINK_MAX_PROMPT_LENGTH) return button;
return (
- <ControlPillMenu
+ <Menu
actions={USER_MESSAGE_COPY_MENU_ACTIONS}
onPressAction={({ nativeEvent }) => {
if (nativeEvent.event === "copy-prompt-link") void copyPromptLink(linkText);
@@ -362,7 +362,7 @@ function UserMessageCopyButton(props: {
shouldOpenOnLongPress
>
{button}
- </ControlPillMenu>
+ </Menu>
);
}
diff --git a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
index 92cc958a8c9..18dc7e1f15f 100644
--- a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
+++ b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
@@ -23,7 +23,7 @@ import type { SearchBarCommands } from "react-native-screens";
import { AppText as Text } from "../../components/AppText";
import { CompactBrandTitle } from "../../components/CompactBrandTitle";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { SymbolView } from "../../components/AppSymbol";
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass";
import { NativeStackScreenOptions } from "../../native/StackHeader";
@@ -1071,9 +1071,9 @@ function ThreadNavigationSidebarPane(
}
/>
<View className="flex-row items-center gap-2.5">
- <ControlPillMenu actions={listMenuActions} onPressAction={handleListMenuAction}>
+ <Menu actions={listMenuActions} onPressAction={handleListMenuAction}>
<SidebarFilterButton accessibilityLabel="Filter threads" icon={filterIcon} />
- </ControlPillMenu>
+ </Menu>
<SidebarHeaderActions onOpenSettings={props.onOpenSettings} />
</View>
</View>
diff --git a/apps/mobile/src/features/threads/ThreadQueueControl.tsx b/apps/mobile/src/features/threads/ThreadQueueControl.tsx
index 40af3d35efe..69e20bdf62b 100644
--- a/apps/mobile/src/features/threads/ThreadQueueControl.tsx
+++ b/apps/mobile/src/features/threads/ThreadQueueControl.tsx
@@ -18,7 +18,7 @@ import { Button } from "../../components/Button";
import { AndroidSheetHeader } from "../../components/AndroidScreenHeader";
import { AppText as Text } from "../../components/AppText";
import { SymbolView } from "../../components/AppSymbol";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { MaterialScreenContent } from "../../components/MaterialScreenContent";
import { scopedThreadKey } from "../../lib/scopedEntities";
import { useUniwindTheme } from "../../lib/useUniwindTheme";
@@ -334,7 +334,7 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
background={theme["--color-sheet"]}
onRemove={() => void act(run.id, "remove")}
>
- <ControlPillMenu
+ <Menu
accessibilityLabel={`Actions for queued message ${index + 1}`}
shouldOpenOnLongPress
actions={[
@@ -411,7 +411,7 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) {
</Pressable>
) : null}
</Pressable>
- </ControlPillMenu>
+ </Menu>
</QueueRowSwipeable>
</Animated.View>
</QueueShiftedRow>
diff --git a/apps/mobile/src/features/threads/thread-list-v2-items.tsx b/apps/mobile/src/features/threads/thread-list-v2-items.tsx
index 9c1cbe34bb2..0529814214f 100644
--- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx
+++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx
@@ -27,7 +27,7 @@ import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSw
import type { ThreadListProvider } from "../../state/thread-list-environments";
import { SymbolView, type AppSymbolName } from "../../components/AppSymbol";
import { AppText as Text } from "../../components/AppText";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { EnvironmentMachineSymbol } from "../../components/EnvironmentMachineSymbol";
import { ProjectFavicon } from "../../components/ProjectFavicon";
import { ProviderIcon, ProviderInstanceIcon } from "../../components/ProviderIcon";
@@ -450,7 +450,7 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
{props.showPendingDivider ? (
<ThreadListV2SectionDivider label="Unsent" pane={props.pane} />
) : null}
- <ControlPillMenu
+ <Menu
actions={isDraft ? DRAFT_TASK_MENU_ACTIONS : PENDING_TASK_MENU_ACTIONS}
onPressAction={handleMenuAction}
shouldOpenOnLongPress
@@ -488,7 +488,7 @@ export const ThreadListV2PendingRow = memo(function ThreadListV2PendingRow(props
</View>
)}
</RowPressable>
- </ControlPillMenu>
+ </Menu>
</>
);
});
@@ -1329,7 +1329,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
threadTitle={thread.title}
>
{(close) => (
- <ControlPillMenu
+ <Menu
actions={[
...(thread.branch
? [
@@ -1355,7 +1355,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
shouldOpenOnLongPress
>
{rowContent(close)}
- </ControlPillMenu>
+ </Menu>
)}
</ThreadSwipeable>
</View>
diff --git a/apps/mobile/src/features/usage/UsageRouteScreen.tsx b/apps/mobile/src/features/usage/UsageRouteScreen.tsx
index 99ac66db0fd..2ee0eb8e61d 100644
--- a/apps/mobile/src/features/usage/UsageRouteScreen.tsx
+++ b/apps/mobile/src/features/usage/UsageRouteScreen.tsx
@@ -51,7 +51,7 @@ import { UsageDailyChart } from "./UsageDailyChart";
import { toggleUsageEnvironment } from "./usageEnvironmentSelection";
import { useRefreshLimits } from "./UsageLimitsSection";
import { UsageLimitsSection } from "./UsageLimitsPooled";
-import { ControlPillMenu } from "../../components/ControlPill";
+import { Menu } from "../../components/Menu";
import { SymbolView } from "../../components/AppSymbol";
import type { UsageChartMetric } from "./usageChartData";
import { PROVIDER_LABEL, useProviderColors, useUsageMixColors } from "./usageProviders";
@@ -237,7 +237,7 @@ export function UsageRouteScreen() {
const environmentFilter = useMemo(
() =>
showEnvironmentFilter ? (
- <ControlPillMenu
+ <Menu
accessible
accessibilityRole="button"
accessibilityLabel="Filter usage environments"
@@ -255,7 +255,7 @@ export function UsageRouteScreen() {
>
<SymbolView name={filterIcon} size={22} tintColorClassName="accent-icon" />
</Pressable>
- </ControlPillMenu>
+ </Menu>
) : null,
[showEnvironmentFilter, environmentActions, selectEnvironment, filterIcon],
);
diff --git a/apps/mobile/src/features/workspace/ListFilterMenu.tsx b/apps/mobile/src/features/workspace/ListFilterMenu.tsx
index ad08ee45a76..9560345a71d 100644
--- a/apps/mobile/src/features/workspace/ListFilterMenu.tsx
+++ b/apps/mobile/src/features/workspace/ListFilterMenu.tsx
@@ -1,7 +1,7 @@
import { Pressable } from "react-native";
import { Chip } from "../../components/Chip";
-import { ControlPillMenu } from "../../components/ControlPillMenu";
-import type { ControlPillMenuProps } from "../../components/ControlPillMenu.types";
+import { Menu } from "../../components/Menu";
+import type { MenuProps } from "../../components/Menu.types";
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
/** A visible filter with a native menu containing only that filter's choices. */
@@ -10,12 +10,12 @@ export function ListFilterMenu(props: {
readonly accessibilityLabel: string;
readonly active?: boolean;
readonly icon?: boolean;
- readonly actions: ControlPillMenuProps["actions"];
+ readonly actions: MenuProps["actions"];
readonly onSelect: (id: string) => void;
}) {
const { themeAppearance } = useAppearancePreferences();
return (
- <ControlPillMenu
+ <Menu
title={props.accessibilityLabel}
actions={props.actions}
onPressAction={({ nativeEvent }) => props.onSelect(nativeEvent.event)}
@@ -35,6 +35,6 @@ export function ListFilterMenu(props: {
colorScheme={themeAppearance}
/>
</Pressable>
- </ControlPillMenu>
+ </Menu>
);
}