@@ -4,7 +4,7 @@ import type { HeaderBarButtonMailSearchToolbarItem } from "react-native-screens"
44import { NavigationContext } from "@react-navigation/native" ;
55import { use , useId , useLayoutEffect } from "react" ;
66import { Pressable , View } from "react-native" ;
7- import { createNativeHeaderMenu } from "./nativeHeaderMenu.ios" ;
7+ import { createNativeHeaderMenu , renderNativeHeaderMenuItems } from "./nativeHeaderMenu.ios" ;
88import { ScreenHeaderButton } from "./ScreenHeaderButton" ;
99import { NativeStackScreenOptions , useScreenOptionsWriter } from "../../native/StackHeader" ;
1010import { useNativeWorkspaceColumnsSupported } from "../../native/NativeWorkspaceColumns" ;
@@ -81,12 +81,16 @@ export function AppBar(props: AppBarProps) {
8181 const { colors } = useControlTheme ( ) ;
8282 const usesNativeMailSearchToolbar = useNativeMailSearchToolbar ( ) ;
8383 const { search, menus } = props ;
84- const menu = menus ?. [ 0 ] ;
84+ const confirmMenuTitle = props . confirm ?. menu ?. title ;
85+ const menusWithoutConfirm = confirmMenuTitle
86+ ? ( menus ?. filter ( ( entry ) => entry . title !== confirmMenuTitle ) ?? [ ] )
87+ : ( menus ?? [ ] ) ;
88+ const menu = menusWithoutConfirm [ 0 ] ;
8589 const compactSearch =
8690 search !== undefined &&
8791 ( search . compactToolbar ?? ! layout . usesSplitView ) &&
8892 usesNativeMailSearchToolbar ;
89- const visibleMenus = compactSearch ? ( menus ? .slice ( 1 ) ?? [ ] ) : ( menus ?? [ ] ) ;
93+ const visibleMenus = compactSearch ? menusWithoutConfirm . slice ( 1 ) : menusWithoutConfirm ;
9094 // Where the mail toolbar isn't used, the Duo keeps search at the bottom of the pane like its
9195 // workspace lists; elsewhere inline search is a button in the bar.
9296 const duoBottomSearch =
@@ -210,6 +214,27 @@ export function AppBar(props: AppBarProps) {
210214 < AppActivityIndicator colorClassName = "accent-prominent-action" />
211215 </ View >
212216 </ Toolbar . Custom >
217+ ) : props . confirm ?. menu ? (
218+ // Edit-style glass text (or icon) + Safari-Back long-press: native primaryAction
219+ // + menu, no chevron — the glass morphs into the menu on hold.
220+ < Toolbar . Button
221+ icon = {
222+ props . confirm . showLabel
223+ ? undefined
224+ : props . confirm . icon
225+ ? iosIcon ( props . confirm . icon )
226+ : iosIcon ( props . confirm . menu . icon )
227+ }
228+ label = { props . confirm . showLabel ? props . confirm . label : undefined }
229+ accessibilityLabel = { props . confirm . accessibilityLabel ?? props . confirm . label }
230+ accessibilityHint = "Shows more actions on long press"
231+ disabled = { props . confirm . disabled }
232+ onPress = { props . confirm . onPress }
233+ menuTitle = { props . confirm . menu . status ?? props . confirm . menu . title }
234+ separateBackground
235+ >
236+ { renderNativeHeaderMenuItems ( props . confirm . menu . items ) }
237+ </ Toolbar . Button >
213238 ) : props . confirm ?. icon && ! props . confirm . showLabel ? (
214239 // Custom AppSymbols (e.g. PR glyph) are not SF Symbols — render via SymbolView,
215240 // same footprint as other trailing icons (no prominent pill).
0 commit comments