App icon indicating copy to clipboard operation
App copied to clipboard

[$175] Navigation is broken in Spanish + iPhone Duo

Open m-natarajan opened this issue 1 week ago • 27 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: Reproducible in staging?: Reproduction blocked (Device specific) Reproducible in production?: Reproduction blocked If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @NicolasBonet Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Open the iPhone Duo
  2. Change the language to Spanish
  3. Check navigation

Expected Result:

All nav items should fill the buttons of the container without overlapping

Actual Result:

Buttons overlap each other

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • [ ] Android: App
  • [ ] Android: mWeb Chrome
  • [x] iOS: App (Device specific)
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [ ] Windows: Chrome
  • [ ] MacOS: Chrome / Safari

Screenshots/Videos

Image from iOS

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @truph01

m-natarajan avatar Nov 20 '26 16:11 m-natarajan

Triggered auto assignment to Contributor-plus team member for initial proposal review - @gijoe0295 (External)

Job added to Upwork: https://www.upwork.com/jobs/~022123821787933188309

Proposal

What is the root cause of that problem?

Likely cause — medium confidence: App’s estimated label widths do not match the space available inside the native iOS tab bar. This can let the selected Espacios pill cover the adjacent Información label, as shown in the screenshot.

On the current iOS 26+ implementation, App draws translated labels into icon images rather than providing native text labels. App estimates their available width, but UIKit controls the actual tab positions and selection pill.

Code evidence and alternatives checked

What changes do you think we should make in order to solve the problem?

Confirm the native geometry before selecting a code change. Obtain the affected app build, exact device/profile, iOS version, orientation, and text-size setting. Reproduce in Spanish and compare generated image widths with the native item and selected-pill bounds.

If those measurements confirm the mismatch, adjust App’s label-width budgeting and truncation to keep labels outside neighboring selection pills. Increasing the existing allowance is not yet a verified solution.

Verification limitation: The reported build is unknown, and no native reproduction was performed. Web testing cannot validate this UIKit rendering path.

What alternative solutions did you explore? (Optional)

Web styling changes target a different renderer. Text scaling could amplify the problem; a UIKit or dependency regression remains possible but unproven.


Next Steps for Contributor+ team: To accept: After native confirmation, @MelvinBot implement [this](https://github.com/Expensify/App/issues/107607) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run

MelvinBot avatar Nov 20 '26 16:11 MelvinBot

Contributor details: Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0179cdc82689f205c7

Proposal

Please re-state the problem that we are trying to solve in this issue.

In Spanish locale on iOS devices (specifically horizontal / wide viewports such as landscape or dual-screen displays), navigation tab items in the native bottom tab bar overlap each other—the selected tab pill (e.g., "Espacios") bleeds into and overlaps the adjacent tab label (e.g., "Información").

What is the root cause of that problem?

On iOS (specifically iOS 26+ liquid glass bottom tab bar), tab labels are rasterized directly into icon images via Skia (tabIconRasterizer.ts) and configured in src/libs/Navigation/AppNavigator/Navigators/NativeTabNavigator/useNativeTabBarOptions/index.ios.ts:

  1. In useNativeTabBarOptions/index.ios.ts:
const barItemCount = Object.keys(tabLabels).length;
const itemWidth = (windowWidth - 2 * variables.iosNativeTabBarHorizontalInset) / barItemCount - variables.iosNativeTabBarLabelInset;
const labelMaxWidth = isInline ? itemWidth - tabIconLayout.iconBoxSize - variables.nativeTabIconLabelGap - (tabIconLayout.trailingInset ?? 0) : itemWidth;
  1. In src/styles/variables.ts:
// UITabBar sizes its items to their icons and gives the selected pill a minimum width, so a label as wide as an even
// share of the bar lets that pill reach over the label next to it.
iosNativeTabBarLabelInset: 8,
  1. UIKit on iOS renders a native translucent liquid glass "selection pill" around the active tab's rasterized icon image. UIKit's native pill geometry adds its own horizontal padding (minimum 14–16 pt) around the tab content.
  2. With localized languages like Spanish, strings are significantly longer (e.g., "Espacios de trabajo" / "Espacios", "Información", "Bandeja de entrada"). The current budget iosNativeTabBarLabelInset: 8 reserves only 8 pt of total spacing between tabs.
  3. Because 8 pt is significantly smaller than UIKit's native selection pill padding, rasterizing labels up to itemWidth produces an icon canvas where UIKit's selected pill reaches beyond the slot boundary into adjacent tab item canvases, creating a visual overlap.

What changes do you think we should make in order to solve the problem?

  1. In src/styles/variables.ts: Increase iosNativeTabBarLabelInset to provide adequate clearance for UIKit's selection pill padding (increase from 8 to 16 or 20), matching UIKit's minimum selection pill horizontal padding:
iosNativeTabBarLabelInset: 16,
  1. In src/libs/Navigation/AppNavigator/Navigators/NativeTabNavigator/useNativeTabBarOptions/index.ios.ts: Ensure that labelMaxWidth accounts for both the label inset and individual tab item padding:
const itemWidth = (windowWidth - 2 * variables.iosNativeTabBarHorizontalInset) / barItemCount;
const labelMaxWidth = Math.max(
    (isInline ? itemWidth - tabIconLayout.iconBoxSize - variables.nativeTabIconLabelGap - (tabIconLayout.trailingInset ?? 0) : itemWidth) - variables.iosNativeTabBarLabelInset,
    0
);

This guarantees that each rasterized label canvas is constrained strictly within the bounds that UIKit's selected pill can wrap without encroaching onto adjacent tab items.

What alternative solutions did you explore? (Optional)

  • Truncating labels arbitrarily with fixed character lengths: Suboptimal because character counts vary widely across font scales and bold weights; font-metrics-based maxWidth in Skia paragraph layout is cleaner and supports proper ellipsis (…).
  • Forcing classic native text titles via tabBarLabel: Unsupported on iOS 26+ liquid glass bar because UIKit ignores title appearance colors and tints all badges with the active tab color. Rasterization via Skia is the intended design and only requires correct slot budgeting.

TassioSales avatar Nov 22 '26 02:11 TassioSales

Proposal

Please re-state the problem that we are trying to solve in this issue.

On iOS 26+ devices using Spanish locale (especially on narrower/split viewports or landscape with safe-area insets), the bottom native tab bar items overlap visually—the active Liquid Glass selection pill around a tab (e.g., Espacios) extends over the adjacent tab's rasterized label (e.g., Información).

What is the root cause of that problem?

On iOS 26+ (shouldDrawLabels === true), useNativeTabBarOptions rasterizes translated labels directly into tab icon PNGs via Skia (tabIconRasterizer.ts), and UIKit sizes each tab item and its translucent Liquid Glass selection pill around that image:

  1. Horizontal safe-area insets are not subtracted (src/libs/Navigation/AppNavigator/Navigators/NativeTabNavigator/useNativeTabBarOptions/index.ios.ts:50-61):

    const {windowWidth} = useWindowDimensions();
    const barItemCount = Object.keys(tabLabels).length;
    const itemWidth =
        (windowWidth - 2 * variables.iosNativeTabBarHorizontalInset) / barItemCount -
        variables.iosNativeTabBarLabelInset;
    const labelMaxWidth = isInline
        ? itemWidth - tabIconLayout.iconBoxSize - variables.nativeTabIconLabelGap - (tabIconLayout.trailingInset ?? 0)
        : itemWidth;
    

    itemWidth budgets against raw windowWidth without accounting for horizontal safe-area insets (left / right from useSafeAreaInsets()), which reduces the real horizontal span available to UITabBar in landscape / Dynamic Island / inset layouts.

  2. Insufficient inter-tab pill clearance for longer localized labels (src/styles/variables.ts:150-153 & tabIconRasterizer.ts:142-162):

    • In es.ts, the 5 tabs resolve to Inicio, Recibidos, Gastos, Información (11 chars), and Espacios (8 chars).
    • tabIconRasterizer.ts frames every tab canvas to Math.max(contentSize, labelWidth) using the wider of normal/bold text (lines 158-162) and exports the PNG at width: canvasWidth / scale.
    • iosNativeTabBarLabelInset is currently only 8 pt (variables.ts:153), giving ~4 pt per side between adjacent icon canvases. On iOS 26's Liquid Glass UITabBar, UIKit adds horizontal pill padding and a minimum selected-pill width around the active icon. When two adjacent tabs approach their labelMaxWidth budget (Información next to Espacios), UIKit's active pill reaches over the 8 pt gap and overlaps the neighboring rasterized label.
  3. Unclamped labelMaxWidth (useNativeTabBarOptions/index.ios.ts:61): Under narrow widths with safe-area insets and inline landscape layout, labelMaxWidth is passed to paragraph.layout(maxWidth * scale) (tabIconRasterizer.ts:79) without a Math.max(0, ...) guard.

(Note: #107269 addressed iOS 18 and below by delegating labels back to UIKit, while iOS 26+ remains on Skia-rasterized labels constrained by iosNativeTabBarHorizontalInset and iosNativeTabBarLabelInset.)

What changes do you think we should make in order to solve the problem?

  1. Account for horizontal safe-area insets and clamp labelMaxWidth in src/libs/Navigation/AppNavigator/Navigators/NativeTabNavigator/useNativeTabBarOptions/index.ios.ts:

    • Read {left: leftInset, right: rightInset} = useSafeAreaInsets().
    • Compute horizontal margin using Math.max(variables.iosNativeTabBarHorizontalInset, leftInset) + Math.max(variables.iosNativeTabBarHorizontalInset, rightInset) so portrait preserves the 25 pt bar margin while landscape/inset layouts do not overestimate available tab width.
    • Clamp labelMaxWidth with Math.max(0, ...):
      const {left: leftInset, right: rightInset} = useSafeAreaInsets();
      const horizontalInset =
          Math.max(variables.iosNativeTabBarHorizontalInset, leftInset) +
          Math.max(variables.iosNativeTabBarHorizontalInset, rightInset);
      const itemWidth = (windowWidth - horizontalInset) / barItemCount - variables.iosNativeTabBarLabelInset;
      const labelMaxWidth = Math.max(
          0,
          isInline
              ? itemWidth - tabIconLayout.iconBoxSize - variables.nativeTabIconLabelGap - (tabIconLayout.trailingInset ?? 0)
              : itemWidth,
      );
      
  2. Increase iosNativeTabBarLabelInset in src/styles/variables.ts (from 8 to 16 pt, tuning against iOS 26 simulator measurements in Spanish locale across portrait and landscape so the Liquid Glass selection pill clears adjacent labels cleanly without truncating short English labels).

  3. Add unit tests for useNativeTabBarOptions (iOS 26+):

    • Narrow viewport (375 pt) with Spanish 5-tab labels verifies label.maxWidth leaves clearance for the selected pill and stays non-negative.
    • Landscape viewport with non-zero horizontal safe-area insets reduces label.maxWidth accordingly.
    • iOS 18 and below remains unchanged (shouldDrawLabels === false).

What alternative solutions did you explore? (Optional)

  • Only bumping iosNativeTabBarLabelInset without safe-area awareness: Helps portrait, but still overestimates bar width whenever leftInset + rightInset > 2 * 25 pt in landscape/inset layouts, and leaves labelMaxWidth unclamped.
  • Shortening Spanish strings in es.ts: Does not fix other verbose locales (German, French, Portuguese); font-metrics truncation via Skia maxWidth + ellipsis (…) solves it structurally for all locales.
  • Disabling Skia label rasterization on iOS 26+: Not viable because iOS 26's Liquid Glass UITabBar ignores UITabBarItemAppearance inactive/title colors and tints all badges with the active tab color.

Contributor details

Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01aee0111e1a0ae483

admin0330 avatar Nov 23 '26 19:11 admin0330

📣 @admin0330! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 23 '26 19:11 melvin-bot[bot]

@gijoe0295 Whoops! This issue is 2 days overdue. Let's get this updated quick!

Proposal

Please re-state the problem that we are trying to solve in this issue.

On iOS devices (specifically horizontal viewports / dual-screen orientations on iOS 26+), when the app language is set to Spanish, the native bottom tab bar buttons overlap visually: the active translucent Liquid Glass selection pill around the Espacios tab extends over and obscures the adjacent Información tab label.

What is the root cause of that problem?

On iOS 26+ (shouldDrawLabels === true), translated tab labels are rasterized directly into icon PNG images via Skia (tabIconRasterizer.ts), and UIKit's native Liquid Glass UITabBar sizes each tab item and its active selection pill around that image canvas:

  1. Insufficient inter-tab clearance budget for longer localized strings (src/styles/variables.ts:150-153):

    • The current inset is configured as:
      // UITabBar sizes its items to their icons and gives the selected pill a minimum width, so a label as wide as an even
      // share of the bar lets that pill reach over the label next to it.
      iosNativeTabBarLabelInset: 8,
      
    • An 8 pt inset reserves only ~4 pt of buffer per side between adjacent tab item canvases.
    • On iOS 26, UIKit's native Liquid Glass UITabBar renders an active selection pill with built-in minimum expansion padding around the selected tab's icon image.
    • In Spanish, localized tab names are substantially longer than English (e.g. Información at 11 characters directly adjacent to Espacios). When two adjacent labels expand to their maximum width, UIKit's native selection pill around Espacios extends beyond the 8 pt boundary, directly overlapping the "n" of Información.
  2. Horizontal safe-area insets are omitted in item budgeting (src/libs/Navigation/AppNavigator/Navigators/NativeTabNavigator/useNativeTabBarOptions/index.ios.ts:58-62):

    • Currently, itemWidth is computed from raw windowWidth:
      const itemWidth = (windowWidth - 2 * variables.iosNativeTabBarHorizontalInset) / barItemCount - variables.iosNativeTabBarLabelInset;
      const labelMaxWidth = isInline ? itemWidth - tabIconLayout.iconBoxSize - variables.nativeTabIconLabelGap - (tabIconLayout.trailingInset ?? 0) : itemWidth;
      
    • On devices with horizontal safe-area insets (such as landscape mode, Dynamic Island / notch insets, or dual-screen / foldable viewports), windowWidth overestimates the real width available to UITabBar, further squeezing the inter-tab gap.
    • Furthermore, labelMaxWidth is passed directly to tabIconRasterizer without a Math.max(0, ...) clamp.

What changes do you think we should make in order to solve the problem?

  1. Adjust iosNativeTabBarLabelInset in src/styles/variables.ts:

    • Increase iosNativeTabBarLabelInset from 8 to 16 (or 20) pt to provide adequate clearance matching UIKit's native Liquid Glass selection pill expansion width, preventing the active pill from intruding into adjacent tab boundaries.
  2. Account for horizontal safe-area insets and clamp labelMaxWidth in src/libs/Navigation/AppNavigator/Navigators/NativeTabNavigator/useNativeTabBarOptions/index.ios.ts:

    • Use useSafeAreaInsets() to read left and right safe-area insets.
    • Calculate total horizontal margin with Math.max(variables.iosNativeTabBarHorizontalInset, leftInset) + Math.max(variables.iosNativeTabBarHorizontalInset, rightInset) so portrait retains the 25 pt bar margin while inset/landscape viewports accurately reflect available UITabBar space.
    • Clamp labelMaxWidth using Math.max(0, ...):
      const {left: leftInset, right: rightInset} = useSafeAreaInsets();
      const horizontalInsets = Math.max(variables.iosNativeTabBarHorizontalInset, leftInset) + Math.max(variables.iosNativeTabBarHorizontalInset, rightInset);
      const itemWidth = (windowWidth - horizontalInsets) / barItemCount - variables.iosNativeTabBarLabelInset;
      const labelMaxWidth = Math.max(
          0,
          isInline
              ? itemWidth - tabIconLayout.iconBoxSize - variables.nativeTabIconLabelGap - (tabIconLayout.trailingInset ?? 0)
              : itemWidth,
      );
      
  3. Add unit test in tests/unit/useNativeTabBarOptionsTest.ts:

    • Verify that on iOS 26+ with Spanish locale tab labels (Inicio, Recibidos, Gastos, Información, Espacios), labelMaxWidth maintains sufficient clearance for UIKit's selected pill across standard portrait and landscape viewports, and stays non-negative.
    • Verify that iOS 18 and below remains on native text labels (shouldDrawLabels === false).

What specific scenarios should we test?

  1. Open the app on iOS (or iOS simulator) with language set to Spanish (Configuración > Preferencias > Idioma > Español).
  2. Verify the bottom navigation tab bar in portrait mode: tap Espacios and confirm the active green selection pill does NOT overlap the adjacent Información label.
  3. Rotate the device to landscape / wide orientation: verify all 5 tab buttons lay out cleanly without overlapping pills or truncated icons.
  4. Switch language back to English: verify standard labels (Home, Inbox, Spend, Insights, Workspaces) continue to render with proper spacing and pill bounds.
  5. Verify on an iOS 18 simulator that native text labels continue to display and behave properly.

Contributor details

Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0105126232377c4c5c

ayolyn avatar Nov 24 '26 16:11 ayolyn

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 24 '26 16:11 melvin-bot[bot]

Adding contributor details for my proposal above:

Contributor details

Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01aee0111e1a0ae483

admin0330 avatar Nov 25 '26 02:11 admin0330

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Nov 25 '26 02:11 melvin-bot[bot]

On this

gijoe0295 avatar Nov 25 '26 09:11 gijoe0295

@m-natarajan I checked this on main with the iPhone Duo simulator (iOS 27.2) in Spanish and can't reproduce it anymore. The screenshot in the OP is the old landscape bar from before #104730 (merged Nov 17, shipped in 9.5.41). Since then the Duo shows the vertical bar in landscape with no labels, and in portrait the Spanish labels fit fine. The Slack report came in a few hours before 9.5.41-2 hit production, so I think this one is already fixed and can be closed.

That said, while testing I hit the same overlap in other languages on the Duo: Portuguese, French, Greek, Japanese and Polish (see below). Could you create a follow-up issue for that? Happy to add details there.

Screenshots

Portuguese

Portuguese

French

French

Greek

Greek

Japanese

Japanese

Polish

Polish

gijoe0295 avatar Nov 25 '26 16:11 gijoe0295

@GCyganek can you have a look at this one?

shawnborton avatar Nov 25 '26 21:11 shawnborton

Yeah I just tested staging in the iPhone duo and I can't replicate either. Cc @GCyganek

dubielzyk-expensify avatar Nov 25 '26 21:11 dubielzyk-expensify

looks good on prod:

IMG_0011

GCyganek avatar Nov 26 '26 07:11 GCyganek

Got it, so maybe we just close then?

shawnborton avatar Nov 26 '26 08:11 shawnborton

I don't have permission to close this issue, but I think we can

GCyganek avatar Nov 26 '26 09:11 GCyganek

@shawnborton @dubielzyk-expensify have you guys check other languages in https://github.com/Expensify/App/issues/107607#issuecomment-7168640240

gijoe0295 avatar Nov 26 '26 09:11 gijoe0295

I haven't as I don't have a Duo. Thoughts @GCyganek ?

shawnborton avatar Nov 26 '26 09:11 shawnborton