Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d3d9982
fix: move bottom nav bar out of the safe area view wrapper
war-in Oct 22, 2026
eacc244
fix: test insets with the probe
war-in Oct 22, 2026
3e0ddae
fix: landscape keyboard dismiss
war-in Oct 22, 2026
f7d7aef
fix: scrollbar moved to left on RHP
war-in Oct 22, 2026
f90427e
fix: move horizontal safe area to dedicated wrappers
war-in Oct 22, 2026
8039cd0
Merge branch 'main' into war-in/fix-iphone-duo-nav-layout
war-in Oct 23, 2026
4252d53
fix: wrap GenericErrorPage with horizontal safe area
war-in Oct 23, 2026
06798f2
fix: labels on first render
war-in Oct 23, 2026
99291d7
fix: compare insets only when tabbar is shown
war-in Oct 23, 2026
1bcf5e8
fix: centered modal layout
war-in Oct 23, 2026
b25923b
Merge branch 'main' into war-in/fix-iphone-duo-nav-layout
war-in Oct 26, 2026
4f7f81f
fix: make TabBarShapeProbe ios-only
war-in Oct 26, 2026
b525c4c
fix: add `hasOwnHorizontalSafeArea` navigator option
war-in Oct 26, 2026
c3e6418
fix: limit growl width and center it on mobile
war-in Oct 26, 2026
cc21dec
test: fix missing `SafeAreaListener`
war-in Oct 26, 2026
8d0cea9
test: fix outdated mock
war-in Oct 26, 2026
5727d0c
Merge branch 'main' into war-in/fix-iphone-duo-nav-layout
war-in Oct 27, 2026
fc5e71b
fix: centered modal's position
war-in Oct 27, 2026
9cb9be2
Merge branch 'main' into war-in/fix-iphone-duo-nav-layout
war-in Oct 29, 2026
1ecff46
Merge remote-tracking branch 'upstream/main' into war-in/fix-iphone-d…
war-in Oct 30, 2026
3eebf9f
fix: onboarding modal layout on iOS 18
war-in Oct 30, 2026
ba72f97
Merge branch 'main' into war-in/fix-iphone-duo-nav-layout
war-in Nov 2, 2026
713e3a0
fix: 2FA safe area
war-in Nov 2, 2026
a7ee411
fix: apply padding once in GrowlNotification
war-in Nov 4, 2026
ec0ba8c
refactor: replace tab safe area wrappers with isTabHostFullWidth cons…
war-in Nov 4, 2026
17fde60
refactor: derive tab bar shape during render instead of in an effect
war-in Nov 4, 2026
1f01990
Merge remote-tracking branch 'upstream/main' into war-in/fix-iphone-d…
war-in Nov 4, 2026
e718ca2
fix: stale labels after rotating on duo
war-in Nov 4, 2026
c14e868
fix: remove unused SafeArea
war-in Nov 4, 2026
e7e2208
Merge branch 'refs/heads/main' into war-in/fix-iphone-duo-nav-layout
war-in Nov 6, 2026
d9731a3
Merge remote-tracking branch 'upstream/main' into war-in/fix-iphone-d…
war-in Nov 9, 2026
d6cf1cf
feat(ios): detect the iPhone Duo tab bar column natively
war-in Nov 9, 2026
7dc2d9c
fix: swipe gesture & scroll bar
war-in Nov 9, 2026
73da8e5
Merge remote-tracking branch 'upstream/main' into war-in/fix-iphone-d…
war-in Nov 10, 2026
553ded5
fix: let horizontal scroll rows reach the screen edge on iPhone Duo
war-in Nov 10, 2026
c9ccfaf
Merge remote-tracking branch 'upstream/main' into war-in/fix-iphone-d…
war-in Nov 12, 2026
244ab55
Merge remote-tracking branch 'upstream/main' into war-in/fix-iphone-d…
war-in Nov 13, 2026
42e5f46
Merge remote-tracking branch 'upstream/main' into war-in/fix-iphone-d…
war-in Nov 17, 2026
29ad830
fix: restore Oxfmt 0.78 formatting, prefix jest mock variable, drop u…
war-in Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions __mocks__/react-native-nitro-modules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const NitroModules = {
createHybridObject: jest.fn(() => ({
getAll: jest.fn(() => Promise.resolve([])),
edge: 'unspecified',
addEdgeListener: jest.fn(() => () => {}),
})),
};

Expand Down
5 changes: 3 additions & 2 deletions __mocks__/react-native-safe-area-context.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type ChildrenProps from '@src/types/utils/ChildrenProps';

import type {ForwardedRef, ReactNode} from 'react';
import type {EdgeInsets, useSafeAreaFrame as LibUseSafeAreaFrame, WithSafeAreaInsetsProps} from 'react-native-safe-area-context';
import type {EdgeInsets, useSafeAreaFrame as LibUseSafeAreaFrame, SafeAreaListenerProps, WithSafeAreaInsetsProps} from 'react-native-safe-area-context';

import React from 'react';
import {View} from 'react-native';
Expand Down Expand Up @@ -47,6 +47,7 @@ function withSafeAreaInsets(WrappedComponent: React.ComponentType<WithSafeAreaIn
const SafeAreaView = View;
const SafeAreaProvider = (props: SafeAreaProviderProps) => props.children;
const SafeAreaConsumer = (props: SafeAreaConsumerProps) => props.children?.(insets);
const SafeAreaListener = (props: SafeAreaListenerProps) => props.children;
const SafeAreaInsetsContext: SafeAreaInsetsContextValue = {
Consumer: SafeAreaConsumer,
};
Expand All @@ -59,4 +60,4 @@ const useSafeAreaFrame: jest.Mock<ReturnType<typeof LibUseSafeAreaFrame>> = jest
}));
const useSafeAreaInsets: jest.Mock<EdgeInsets> = jest.fn(() => insets);

export {SafeAreaProvider, SafeAreaConsumer, SafeAreaInsetsContext, withSafeAreaInsets, SafeAreaView, useSafeAreaFrame, useSafeAreaInsets};
export {SafeAreaProvider, SafeAreaConsumer, SafeAreaListener, SafeAreaInsetsContext, withSafeAreaInsets, SafeAreaView, useSafeAreaFrame, useSafeAreaInsets};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.margelo.nitro.utils

/** Android lays no bar out along a side edge, so the edge is never specified and never changes. */
class HybridVerticalBarModule : HybridVerticalBarModuleSpec() {
override val memorySize: Long = 0L

override val edge: VerticalBarEdge = VerticalBarEdge.UNSPECIFIED

override fun addEdgeListener(onChange: (edge: VerticalBarEdge) -> Unit): () -> Unit = {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import Foundation
import NitroModules
import UIKit

/// Reports which edge UIKit lays the vertical bar out on, read from the app window's trait collection, and follows the
/// trait through folds and rotations. Before iOS 27.1 there is no vertical bar, so the edge stays unspecified.
final class HybridVerticalBarModule: HybridVerticalBarModuleSpec {
public var memorySize: Int { MemoryLayout<HybridVerticalBarModule>.size }

private var currentEdge: VerticalBarEdge = .unspecified
private var listeners: [UUID: (VerticalBarEdge) -> Void] = [:]
private var isObserving = false

var edge: VerticalBarEdge {
// Never hop to the main thread synchronously from here: the main thread may be waiting on JS. The listeners get the first real value.
if !isObserving {
DispatchQueue.main.async { MainActor.assumeIsolated { self.startObservingIfNeeded() } }
}
return currentEdge
}

func addEdgeListener(onChange: @escaping (VerticalBarEdge) -> Void) -> () -> Void {
let id = UUID()
DispatchQueue.main.async {
// Registered before observing starts, so it hears the first value read from the window.
self.listeners[id] = onChange
MainActor.assumeIsolated { self.startObservingIfNeeded() }
}
return { [weak self] in
DispatchQueue.main.async { self?.listeners.removeValue(forKey: id) }
}
}

@MainActor
private func startObservingIfNeeded() {
guard !isObserving else {
return
}
guard #available(iOS 27.1, *) else {
isObserving = true
return
}
// The window appears after the app's hybrid objects are created, so a read before then tries again on the next one.
guard let window = Self.keyWindow else {
return
}
isObserving = true
// The edge reads unspecified until the window exists, so a JS read from before then is corrected through the listeners.
updateEdge(Self.edge(of: window))
// The window keeps the registration alive for as long as it exists, which is as long as the app does.
_ = window.registerForTraitChanges(UITraitCollection.systemTraitsAffectingVerticalBarEdge) { [weak self] (window: UIWindow, _: UITraitCollection) in
self?.updateEdge(Self.edge(of: window))
}
}

@MainActor
private func updateEdge(_ edge: VerticalBarEdge) {
guard edge != currentEdge else {
return
}
currentEdge = edge
for listener in listeners.values {
listener(edge)
}
}

@MainActor
private static var keyWindow: UIWindow? {
UIApplication.shared.connectedScenes
.compactMap { $0 as? UIWindowScene }
.flatMap(\.windows)
.first(where: \.isKeyWindow)
}

@MainActor
@available(iOS 27.1, *)
private static func edge(of window: UIWindow) -> VerticalBarEdge {
switch window.traitCollection.verticalBarEdge {
case .leading:
return .leading
case .trailing:
return .trailing
case .unspecified:
return .unspecified
@unknown default:
return .unspecified
}
}
}
4 changes: 4 additions & 0 deletions modules/ExpensifyNitroUtils/nitro.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"AppStartTimeModule": {
"swift": "HybridAppStartTimeModule",
"kotlin": "HybridAppStartTimeModule"
},
"VerticalBarModule": {
"swift": "HybridVerticalBarModule",
"kotlin": "HybridVerticalBarModule"
}
},
"ignorePaths": ["node_modules"]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading