Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

4.9 KB
Raw Blame
diff --git a/lib/module/views/useHeaderConfigProps.js b/lib/module/views/useHeaderConfigProps.js
index 0b75c70b4e0d233ee3b5faaf9cfbc40d4f8ed494..eb174e3fde91a7783f132b3fb16b01175ec19220 100644
--- a/lib/module/views/useHeaderConfigProps.js
+++ b/lib/module/views/useHeaderConfigProps.js
@@ -19,6 +19,12 @@
       }
       return item;
     }
+    if (item.type === 'mailSearchToolbar') {
+      return {
+        ...item,
+        index
+      };
+    }
     if (item.type === 'button' || item.type === 'menu') {
       if (item.type === 'menu' && item.menu == null) {
         throw new Error(`Menu item must have a 'menu' property defined: ${JSON.stringify(item)}`);
@@ -79,7 +85,7 @@
       }
       return processedItem;
     }
-    throw new Error(`Invalid item type: ${JSON.stringify(item)}. Valid types are 'button', 'menu', 'custom' and 'spacing'.`);
+    throw new Error(`Invalid item type: ${JSON.stringify(item)}. Valid types are 'button', 'menu', 'custom', 'spacing' and 'mailSearchToolbar'.`);
   }).filter(item => item != null);
 };
 const transformIcon = icon => {
@@ -158,8 +164,12 @@
   headerBack,
   route,
   title,
+  unstable_headerCenterItems: headerCenterItems,
   unstable_headerLeftItems: headerLeftItems,
-  unstable_headerRightItems: headerRightItems
+  unstable_headerRightItems: headerRightItems,
+  unstable_headerSubtitle: headerSubtitle,
+  unstable_headerToolbarItems: headerToolbarItems,
+  unstable_navigationItemStyle: navigationItemStyle
 }) {
   const {
     direction
@@ -255,6 +265,10 @@
     tintColor,
     canGoBack
   });
+  const centerItems = headerCenterItems?.({
+    tintColor,
+    canGoBack
+  });
   let rightItems = headerRightItems?.({
     tintColor,
     canGoBack
@@ -264,6 +278,10 @@
     // So we need to reverse them here to match the order
     rightItems = [...rightItems].reverse();
   }
+  const toolbarItems = headerToolbarItems?.({
+    tintColor,
+    canGoBack
+  });
   const children = /*#__PURE__*/_jsxs(_Fragment, {
     children: [Platform.OS === 'ios' ? /*#__PURE__*/_jsxs(_Fragment, {
       children: [leftItems ? leftItems.map((item, index) => {
@@ -278,7 +296,15 @@
         return null;
       }) : headerLeftElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderLeftView, {
         children: headerLeftElement
-      }) : null, headerTitleElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderCenterView, {
+      }) : null, centerItems ? centerItems.map((item, index) => {
+        if (item.type === 'custom') {
+          return /*#__PURE__*/_jsx(ScreenStackHeaderCenterView, {
+            hidesSharedBackground: item.hidesSharedBackground,
+            children: item.element
+          }, index);
+        }
+        return null;
+      }) : headerTitleElement != null ? /*#__PURE__*/_jsx(ScreenStackHeaderCenterView, {
         children: headerTitleElement
       }) : null]
     }) : /*#__PURE__*/_jsxs(_Fragment, {
@@ -356,6 +382,7 @@
     largeTitleFontWeight,
     largeTitleHideShadow: headerLargeTitleShadowVisible === false,
     title: titleText,
+    subtitle: headerSubtitle,
     titleColor,
     titleFontFamily,
     titleFontSize,
@@ -364,9 +391,12 @@
     disableTopInsetApplication: !headerTopInsetEnabled,
     translucent: translucent === true,
     children,
+    navigationItemStyle,
+    headerToolbarItems: processBarButtonItems(toolbarItems, colors, fonts),
+    headerCenterBarButtonItems: processBarButtonItems(centerItems, colors, fonts),
     headerLeftBarButtonItems: processBarButtonItems(leftItems, colors, fonts),
     headerRightBarButtonItems: processBarButtonItems(rightItems, colors, fonts),
     experimental_userInterfaceStyle: dark ? 'dark' : 'light'
   };
 }
-//# sourceMappingURL=useHeaderConfigProps.js.map
\ No newline at end of file
+//# sourceMappingURL=useHeaderConfigProps.js.map
diff --git a/lib/module/views/NativeStackView.native.js b/lib/module/views/NativeStackView.native.js
index c342e90..5d3e440 100644
--- a/lib/module/views/NativeStackView.native.js
+++ b/lib/module/views/NativeStackView.native.js
@@ -370,6 +370,17 @@ export function NativeStackView({
   return /*#__PURE__*/_jsx(SafeAreaProviderCompat, {
     children: /*#__PURE__*/_jsx(ScreenStack, {
       style: styles.container,
+      onFinishTransitioning: () => {
+        // Surface UIKit's transition-completion callback to every route of
+        // this navigator. Unlike transitionEnd, this also fires when a modal
+        // finishes dismissing — where the presenting screen below receives no
+        // appearance callbacks — and for a gesture-driven dismissal it fires
+        // before the state pop, while the modal route is still the focused
+        // one, so the event must not be targeted at a single route.
+        navigation.emit({
+          type: 'finishTransitioning'
+        });
+      },
       children: state.routes.concat(state.preloadedRoutes).map((route, index) => {
         const descriptor = descriptors[route.key] ?? preloadedDescriptors[route.key];
         const isFocused = state.index === index;