[Due for payment 2026-11-16] [$175] Company cards - Card drop down is not shown for cards with longer card name
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.5.18-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/80268778/folder/13176706/41236839/1903874097?sort=%2Bidentifier Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Android 13/ Chrome App Component: Workspace Settings
Action Performed:
- sign in to staging.new.expensify.com
- Navigate to Workspace > Workspace > Company cards
- Click on Add cards
- Add cards with commercial feed (can use dummy card details. Don't need to verify card)
- After adding a commercial feed card, click on Settings
- Change Card Name to have a longer name (eg. The big black fox jumps over the lazy dog)
- Navigate to Company card feed
Expected Result:
Card drop down button is displayed in along with the card name
Actual Result:
Card drop down button is not displayed for cards with longer card name
Workaround:
Unknown
Platforms:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [x] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [ ] Windows: Chrome
- [ ] MacOS: Chrome Safari
Screenshots/Videos
https://github.com/user-attachments/assets/4a70d8f2-4917-4096-9255-7bcfd3d74a9f
Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7294485
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022113649859580372075
- Upwork Job ID: 2113649859580372075
- Last Price Increase: 2026-10-23
Issue Owner
Current Issue Owner: @mallenexpensify
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/d78619382d23b5c112d8da91fd747b3ad41ed271d4385470be093078e084bbc4
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Company cards page, a long feed name pushes the dropdown caret off screen.
What is the root cause of that problem?
In FeedSelector, the feed name and the caret sit inside CaretWrapper. That wrapper never gets a shrink style (src/components/FeedSelector.tsx:55).
The wrapper is a row View, and Views default to flexShrink: 0 (src/components/CaretWrapper.tsx:29). So it grows to the full width of the name plus the caret and overflows its parent. The text has flexShrink1 (line 58), but its parent never gets smaller, so the text never truncates. The caret, and the RBR dot if shown, end up past the visible edge.
What changes do you think we should make in order to solve the problem?
In FeedSelector, pass style={[styles.flexShrink1, styles.mw100]} to CaretWrapper. The name then truncates with an ellipsis, and the caret stays visible next to it.
DropdownButton already does this for the same reason (DropdownButton.tsx:88).
The same component also renders the Expensify Card and Card Reconciliation feed selectors, so the fix covers those too.
What alternative solutions did you explore? (Optional)
Add flexShrink1 inside CaretWrapper itself. This would change every caller, so the targeted fix above is safer.
Notes
- Confidence: medium. The code path and the matching
DropdownButtonfix support this, but I didn't reproduce it in the app. - Company cards renders the selector from
WorkspaceCompanyCardsTableHeaderButtons.tsx:128. It passeswrapperStyle={styles.flex1}, so the outer pressable is bounded. Only the innerCaretWrapperoverflows.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104864) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)
Job added to Upwork: https://www.upwork.com/jobs/~022113649859580372075
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
VERDICT: POST
ROOT_CAUSE_ONELINER: In narrow layout, styles.pre (white-space: pre on web) on the card subtitle TextWithTooltip overrides the white-space: nowrap that numberOfLines={1} relies on for truncation; on iOS Safari this causes the long custom card name to expand the text element beyond the flex cell's bounds, pushing the ArrowRight action button off screen.
PROPOSAL_TYPE: FIRST
AUTOPOST_SAFE: YES
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0139ed4098bdc50182
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Company cards page, when a company card feed has a long name, the dropdown caret button is not displayed alongside the card name because the feed name overflows its container and pushes the caret off-screen.
What is the root cause of that problem?
In src/components/FeedSelector.tsx:55:
<View style={styles.flex1}>
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
</Text>
</CaretWrapper>
{shouldShowRBR && (
<Icon
src={expensifyIcons.DotIndicator}
fill={theme.danger}
/>
)}
</View>
- In
FeedSelector.tsx,CaretWrapperis rendered inside<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>without astyleprop. - In
CaretWrapper.tsx, the root container is:<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter, style]}> - In React Native / CSS flexbox, a flex child
Viewinside a flex row defaults toflexShrink: 0. - Because
CaretWrapperhasflexShrink: 0by default and has no width constraints, its layout width expands to the full unconstrained intrinsic width of{feedName}plus the caret icon width. - Even though the inner
<Text>component specifiesstyles.flexShrink1andnumberOfLines={1}, its immediate parent (CaretWrapper'sView) never shrinks, preventing text truncation. - Consequently,
CaretWrapperoverflows the parentView style={styles.flex1}, and theDownArrowicon (as well asDotIndicatorif present) is pushed off to the right outside the visible viewport.
What changes do you think we should make in order to solve the problem?
In src/components/FeedSelector.tsx:
Pass style={[styles.flexShrink1, styles.mw100]} to CaretWrapper:
--- a/src/components/FeedSelector.tsx
+++ b/src/components/FeedSelector.tsx
@@ -52,7 +52,7 @@ function FeedSelector({onFeedSelect, CardFeedIcon, feedName, supportingText, sho
<View style={styles.flex1}>
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
- <CaretWrapper>
+ <CaretWrapper style={[styles.flexShrink1, styles.mw100]}>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
Why this solution is optimal:
- This directly follows the established design pattern in
src/components/Search/FilterDropdowns/DropdownButton.tsx:88:<CaretWrapper // Replaces flex1 with flexShrink1 so a long label truncates instead of widening the pill. style={[styles.flexShrink1, styles.mw100, caretWrapperStyle]} - Constraining
CaretWrapperwithflexShrink1andmw100allows it to shrink to the available width within the row (reserving space forshouldShowRBRif active). - The inner
<Text>component correctly truncates with an ellipsis (...), and theDownArrowcaret icon stays anchored immediately adjacent to the truncated name inside the visible container. - It is localized surgically to
FeedSelectorwithout introducing unintended side effects into other consumers ofCaretWrapper.
What alternative solutions did you explore? (Optional)
- Adding
flexShrink1insideCaretWrapper.tsxglobally: Rejected because modifying the shared primitive affects all callers across the app, which could introduce subtle layout shifts in unrelated modals or headers. Applying the style prop inFeedSelectoris targeted, safe, and robust.
What automated tests can you add to prevent this from re-occurring?
In tests/unit/FeedSelectorTest.tsx:
- Render
FeedSelectorwith a very longfeedName(e.g. 100 characters). - Assert that
CaretWrapperreceivesflexShrink: 1andmaxWidth: '100%'. - Verify that both the truncated feed name text and the caret icon are rendered within the component hierarchy.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a company card has a long name, the dropdown caret associated with the card selector is not displayed because the name overflows its container. This prevents users from interacting with the card's dropdown options.
What is the root cause of that problem?
The root cause lies within the FeedSelector component, specifically how the CaretWrapper handles its children and its own styling. The CaretWrapper is designed to contain both the feed name (Text component) and the caret (Icon component). However, by default, View components in React Native have flexShrink: 0, meaning they do not shrink to fit their content. The CaretWrapper does not have an explicit flexShrink style applied, allowing it to expand to accommodate the full length of the feedName. This expansion causes it to overflow its parent container, pushing the caret icon off-screen. The Text component for the feedName does have flexShrink1 (src/components/FeedSelector.tsx:58), but it can only shrink if its parent allows it to. The CaretWrapper itself is rendered within a View that has styles.flex1 (src/components/Tables/WorkspaceCompanyCardsTable/WorkspaceCompanyCardsTableHeaderButtons.tsx:128), meaning the parent container has a defined width. However, the CaretWrapper's lack of flexShrink causes it to disregard this bound.
What changes do you think we should make in order to solve the problem?
To resolve this, we need to ensure that the CaretWrapper can shrink when its content overflows. This can be achieved by applying flexShrink: 1 and maxWidth: '100%' to the CaretWrapper's style. This will allow the feedName to truncate with an ellipsis when it exceeds the available space, ensuring the caret icon remains visible.
--- a/src/components/FeedSelector.tsx
+++ b/src/components/FeedSelector.tsx
@@ -55,7 +55,7 @@
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper>
<Text
- numberOfLines={1}
+ numberOfLines={1} // Ensures text truncates to a single line
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
The CaretWrapper itself does not need modification as its children are styled appropriately. The Text component already has styles.flexShrink1. The issue is that the parent View within FeedSelector that wraps the CaretWrapper needs to allow shrinking, or the CaretWrapper needs to be constrained. A more direct approach is to ensure the Text component within CaretWrapper can be constrained.
Let's reassess the CaretWrapper and its usage:
CaretWrapper(src/components/CaretWrapper.tsx) renders aViewwithstyles.flexRow,styles.gap1, andstyles.alignItemsCenter. It then renders itschildren(which will be theTextfor thefeedName) and theIconfor the caret.FeedSelector(src/components/FeedSelector.tsx) callsCaretWrapperand passes aTextcomponent withnumberOfLines={1}andstyle={[styles.textStrong, styles.flexShrink1]}.
The problem is that CaretWrapper's root View does not have flexShrink: 1. When the feedName (as a Text component with flexShrink1) is rendered inside CaretWrapper, and CaretWrapper itself does not shrink, the text cannot effectively truncate.
The most surgical fix is to apply flexShrink: 1 to the CaretWrapper's View.
--- a/src/components/CaretWrapper.tsx
+++ b/src/components/CaretWrapper.tsx
@@ -18,7 +18,7 @@
const expensifyIcons = useMemoizedLazyExpensifyIcons(['DownArrow']);
return (
- <View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter, style]}>\
+ <View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter, style, styles.flexShrink1]}>
{children}
<Icon
src={expensifyIcons.DownArrow}
This change directly addresses the overflow issue by allowing the CaretWrapper to shrink, which in turn allows the Text component within it to truncate properly.
User Mutation Edge Cases (Editing/Cancelling):
- Editing Card Name: If a user edits a card name to be longer, the
flexShrink1onCaretWrapperwill ensure the name truncates, and the dropdown remains accessible. If they edit it to be shorter, the name will expand to fill the available space, and the dropdown will still be visible. - Cancelling Card Name Edit: If a user cancels an edit, the original card name will be restored. If the original name was short, it will display correctly. If it was long, the
flexShrink1onCaretWrapperwould have already handled its display, and upon cancellation, it will render as it was before the (unsuccessful) edit. The fix is non-destructive and doesn't interfere with the state management of edits.
What alternative solutions did you explore? (Optional)
The MelvinBot proposal suggested style={[styles.flexShrink1, styles.mw100]} on CaretWrapper. Applying styles.mw100 (max-width: 100%) to CaretWrapper is redundant when flexShrink1 is present, as flexShrink1 inherently encourages the element to shrink to fit its parent if needed. The core issue is the flexShrink property of the CaretWrapper's root View. Adding flexShrink1 directly to CaretWrapper is the most targeted and efficient solution.
The alternative of adding flexShrink1 inside CaretWrapper itself was correctly identified as potentially impacting other callers. However, the CaretWrapper component's purpose is to encapsulate elements that might overflow, and thus it's a reasonable place to enforce shrinking behavior. The proposed fix directly modifies CaretWrapper.tsx to include styles.flexShrink1.
What automated tests can you add to prevent this from re-occurring?
A unit test for the FeedSelector component to verify the CaretWrapper's behavior with long text.
// src/components/FeedSelector.test.js
import React from 'react';
import {render} from '@testing-library/react-native';
import FeedSelector from '@src/components/FeedSelector';
import useThemeStyles from '@hooks/useThemeStyles';
import { View } from 'react-native';
// Mock useThemeStyles to return mock styles
jest.mock('@hooks/useThemeStyles');
jest.mock('@hooks/useTheme');
jest.mock('@hooks/useLazyAsset');
describe('FeedSelector', () => {
beforeEach(() => {
// Provide mock styles that include flex properties
useThemeStyles.mockReturnValue({
flexRow: {display: 'flex', flexDirection: 'row'},
gap1: {gap: 4},
gap3: {gap: 12},
alignItemsCenter: {alignItems: 'center'},
flexShrink1: {flexShrink: 1},
textStrong: {fontWeight: 'bold'},
textLabelSupporting: {fontSize: 12},
flex1: {flex: 1}, // Added for context of parent styling
});
});
const renderFeedSelector = (feedName) =>
render(
<FeedSelector
onFeedSelect={jest.fn()}
CardFeedIcon={<View testID="card-feed-icon" />}
feedName={feedName}
/>,
);
it('should truncate long feed names and show the caret', () => {
const longFeedName = 'This is a very very very very very very very very long feed name that should truncate';
const {getByText, findByTestId} = renderFeedSelector(longFeedName);
// Check if the feed name is present (it should be, truncated)
// We are not asserting the exact ellipsis, but that the component renders without overflow
expect(getByText(longFeedName)).toBeVisible();
// Ensure the icon is rendered and accessible
expect(findByTestId('Icon')).toBeDefined(); // Assuming the caret icon has a testID of 'Icon' or similar
});
it('should display the full feed name when it is short', () => {
const shortFeedName = 'Short Name';
const {getByText} = renderFeedSelector(shortFeedName);
expect(getByText(shortFeedName)).toBeVisible();
});
});
Note on CaretWrapper testing: A more robust test might involve mocking the Icon component to specifically test the layout of CaretWrapper when given long text, verifying that the View within CaretWrapper indeed has flexShrink: 1 and that the Text component's width is constrained. However, the proposed test focuses on the observable behavior of FeedSelector with its children. For the purpose of preventing recurrence, ensuring the flexShrink1 is applied and tested is key.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01b60d704ba377be83
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01b6be874e7d6b47d1
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Company cards page, when a company card feed has a long name, the dropdown caret button is not displayed alongside the card name because the feed name overflows its container and pushes the caret icon off-screen.
What is the root cause of that problem?
In src/components/FeedSelector.tsx:
<View style={styles.flex1}>
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
</Text>
</CaretWrapper>
{shouldShowRBR && (
<Icon
src={expensifyIcons.DotIndicator}
fill={theme.danger}
/>
)}
</View>
- In
FeedSelector.tsx,CaretWrapperis rendered inside<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>without passing astyleprop. - In
src/components/CaretWrapper.tsx:29, the root view defaults to<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter, style]}>. - In React Native / CSS flexbox, a flex child
Viewinside a flex row defaults toflexShrink: 0. - Because
CaretWrapperhasflexShrink: 0by default and no max-width constraint, its layout width expands to the full unconstrained intrinsic width of{feedName}plus the caret icon width. - Even though the inner
<Text>component specifiesstyles.flexShrink1andnumberOfLines={1}, its immediate parent (CaretWrapper'sView) never shrinks, preventing text truncation. - Consequently,
CaretWrapperoverflows the parentView style={styles.flex1}, and theDownArrowicon (as well asDotIndicatorif present) is pushed off to the right outside the visible viewport.
What changes do you think we should make in order to solve the problem?
In src/components/FeedSelector.tsx, pass style={[styles.flexShrink1, styles.mw100]} to CaretWrapper:
// src/components/FeedSelector.tsx:55
<View style={styles.flex1}>
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper style={[styles.flexShrink1, styles.mw100]}>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
</Text>
</CaretWrapper>
{shouldShowRBR && (
<Icon
src={expensifyIcons.DotIndicator}
fill={theme.danger}
/>
)}
</View>
<Text
numberOfLines={1}
style={styles.textLabelSupporting}
>
{supportingText}
</Text>
</View>
Why this solution is optimal:
- This directly follows the established design pattern in
src/components/Search/FilterDropdowns/DropdownButton.tsx:88:<CaretWrapper // Replaces flex1 with flexShrink1 so a long label truncates instead of widening the pill. style={[styles.flexShrink1, styles.mw100, caretWrapperStyle]} - Constraining
CaretWrapperwithflexShrink1andmw100allows it to shrink to the available width within the row (leaving space forshouldShowRBRif active). - The inner
<Text>component correctly truncates with an ellipsis (...), and theDownArrowcaret icon stays anchored immediately adjacent to the truncated name inside the visible container. - It is localized surgically to
FeedSelectorwithout introducing unintended side effects into other consumers ofCaretWrapper.
What specific scenarios should we cover in automated tests?
In tests/unit/FeedSelectorTest.tsx:
- Truncation & Caret Visibility with Long Feed Name:
- Render
FeedSelectorwith a long feed name (e.g. 100 characters). - Assert that
CaretWrapperreceivesstyles.flexShrink1andstyles.mw100. - Verify that both the truncated text and the caret
DownArrowicon remain within the component layout hierarchy.
- Render
- Short Feed Name:
- Render
FeedSelectorwith a short feed name (e.g. "Chase"). - Assert that the full text is displayed without unnecessary clipping and the caret sits directly adjacent to it.
- Render
- RBR Indicator Preservation:
- Render
FeedSelectorwith a long feed name andshouldShowRBR={true}. - Assert that
DotIndicatoricon remains visible and is not pushed off the row.
- Render
What alternative solutions did you explore? (Optional)
- Adding
flexShrink1insideCaretWrapper.tsxglobally: Rejected because modifying the shared primitive affects all callers across the app, which could introduce subtle layout shifts in unrelated modals or headers. Applying the style prop inFeedSelectoris targeted, safe, and robust.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~010415b62c29eb990f
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Company cards page, when a company card feed has a long name, the dropdown caret button is pushed off-screen and disappears because the feed name overflows its container.
What is the root cause of that problem?
In src/components/FeedSelector.tsx (lines 53-65):
<View style={styles.flex1}>
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
</Text>
</CaretWrapper>
CaretWrapperis rendered inside a row flex container without an explicit shrink style.- Under React Native / Flexbox layout rules, a
Viewcomponent defaults toflexShrink: 0. - Because
CaretWrapper's rootViewhasflexShrink: 0and unconstrained width, it expands to accommodate the full intrinsic layout width of{feedName}plus the caret icon. - Even though the child
<Text>component specifiesstyles.flexShrink1andnumberOfLines={1}, its immediate parent (CaretWrapper) never contracts. As a result, the text cannot measure an ellipsis boundary, and the entireCaretWrapper(along with the caret icon and any adjacent status indicator) overflows past the right edge of the viewport.
What changes do you think we should make in order to solve the problem?
Following the established pattern in src/components/Search/FilterDropdowns/DropdownButton.tsx (line 88), pass style={[styles.flexShrink1, styles.mw100]} to <CaretWrapper> in src/components/FeedSelector.tsx:
<View style={styles.flex1}>
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper style={[styles.flexShrink1, styles.mw100]}>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
</Text>
</CaretWrapper>
{shouldShowRBR && (
<Icon
src={expensifyIcons.DotIndicator}
fill={theme.danger}
/>
)}
</View>
Why this is the cleanest solution:
- Applying
styles.flexShrink1andstyles.mw100specifically to the consumer inFeedSelector.tsxensuresCaretWrapperproperly contracts within its parentView (flex: 1)without leaking unwanted layout changes to other consumers ofCaretWrapper.tsx. - The feed name properly truncates with an ellipsis (
...) while ensuring both theDownArrowcaret and the optional RBRDotIndicatorremain fully visible and clickable.
What alternative solutions did you explore? (Optional)
- Modifying
CaretWrapper.tsxdirectly: AddingflexShrink: 1insideCaretWrapper.tsx's root container was explored, but modifying shared primitive containers can introduce regressions across other screens that rely on natural intrinsic width. Passing the style at the call site inFeedSelector.tsxaligns withDropdownButton.tsxand eliminates regression risk.
What automated tests can you add to prevent this from re-occurring?
Add a unit test in tests/unit/FeedSelectorTest.tsx:
- Render
<FeedSelector>with a very long card name (e.g.'A'.repeat(120)). - Verify that
<CaretWrapper>hasflexShrink: 1andmaxWidth: '100%'applied in its style hierarchy. - Verify that the dropdown caret icon (
DownArrow) is rendered and remains part of the accessible button layout alongside the truncated feed name.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Company cards page, when a card feed has a long name, the feed name in FeedSelector does not truncate with an ellipsis and instead pushes the dropdown caret icon (and optional RBR dot indicator) off the right edge of the selector button.
What is the root cause of that problem?
In src/components/FeedSelector.tsx:53-65:
<View style={styles.flex1}>
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
</Text>
</CaretWrapper>
{shouldShowRBR && (
<Icon
src={expensifyIcons.DotIndicator}
fill={theme.danger}
/>
)}
</View>
<Text
numberOfLines={1}
style={styles.textLabelSupporting}
>
{supportingText}
</Text>
</View>
And in src/components/CaretWrapper.tsx:29:
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter, style]}>
{children}
<Icon
src={expensifyIcons.DownArrow}
fill={theme.icon}
width={variables.iconSizeExtraSmall}
height={variables.iconSizeExtraSmall}
/>
</View>
There are two flex-shrinking constraints missing in FeedSelector.tsx:
CaretWrapperis aViewflex item inside<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>, andFeedSelectorpasses nostyleprop to<CaretWrapper>. In React Native / React Native Web,Viewdefaults toflexShrink: 0andminWidth: 'auto'. BecauseCaretWrappernever shrinks below the intrinsic single-line width of{feedName}plus theDownArrowicon, the inner<Text numberOfLines={1} style={[styles.textStrong, styles.flexShrink1]}>always sees a parent wide enough for the full string and never truncates.- In addition, the outer text column
<View style={styles.flex1}>(line 53) and<CaretWrapper>(line 55) needstyles.mnw0(minWidth: 0) alongsidestyles.flexShrink1, styles.mw100on<CaretWrapper>. Note that whenshouldShowRBRistrue,<CaretWrapper>shares the row with theDotIndicatoricon (20px+4pxgap); relying onstyles.mw100(maxWidth: '100%') alone withoutstyles.mnw0allowsCaretWrapperto take100%of the row width and still pushDotIndicatorout of bounds on web flex layout.
What changes do you think we should make in order to solve the problem?
In src/components/FeedSelector.tsx (lines 53-55), add styles.mnw0 to the styles.flex1 container and pass style={[styles.flexShrink1, styles.mnw0, styles.mw100]} to <CaretWrapper> (matching the pattern in src/components/Search/FilterDropdowns/DropdownButton.tsx:88 while ensuring minWidth: 0 when shouldShowRBR is present):
<View style={[styles.flex1, styles.mnw0]}>
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper style={[styles.flexShrink1, styles.mnw0, styles.mw100]}>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
</Text>
</CaretWrapper>
{shouldShowRBR && (
<Icon
src={expensifyIcons.DotIndicator}
fill={theme.danger}
/>
)}
</View>
What alternative solutions did you explore? (Optional)
- Modifying
CaretWrapper.tsxdirectly to always applystyles.flexShrink1: Rejected becauseCaretWrapperis a shared primitive used in other components that pass their own layout styles via thestyleprop. Passingstyle={[styles.flexShrink1, styles.mnw0, styles.mw100]}inFeedSelector.tsxfixes Company Cards, Expensify Card, and Card Reconciliation feed selectors without affecting unrelated callers.
📣 @xian96xx! 📣 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:
- Make sure you've read and understood the contributing guidelines.
- 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.
- 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.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Workspace > Company cards, when a company card feed has a long name, the dropdown caret button (DownArrow icon) is pushed off-screen and not displayed.
What is the root cause of that problem?
In src/components/FeedSelector.tsx (lines 54–69):
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter]}>
<CaretWrapper>
<Text
numberOfLines={1}
style={[styles.textStrong, styles.flexShrink1]}
>
{feedName}
</Text>
</CaretWrapper>
{shouldShowRBR && (
<Icon
src={expensifyIcons.DotIndicator}
fill={theme.danger}
/>
)}
</View>
And inside src/components/CaretWrapper.tsx (lines 28–39):
function CaretWrapper({children, style, caretWidth, caretHeight, isActive = false}: CaretWrapperProps) {
return (
<View style={[styles.flexRow, styles.gap1, styles.alignItemsCenter, style]}>
{children}
<Icon
src={expensifyIcons.DownArrow}
...
Even though the inner <Text> element has styles.flexShrink1, its parent container <CaretWrapper> does NOT have styles.flexShrink1. In flexbox layout, <CaretWrapper> expands to accommodate the text measurement and its outer container pushes the caret <Icon> outside the available screen width. Furthermore, <Icon> inside CaretWrapper does not have styles.flexShrink0 to guarantee that the caret remains strictly visible and never shrinks away.
What changes do you think we should make in order to solve the problem?
-
In
src/components/FeedSelector.tsx: Passstyle={styles.flexShrink1}to<CaretWrapper>:<CaretWrapper style={styles.flexShrink1}> <Text numberOfLines={1} style={[styles.textStrong, styles.flexShrink1]} > {feedName} </Text> </CaretWrapper> -
In
src/components/CaretWrapper.tsx:- Ensure the caret icon has
styles.flexShrink0so it will never be compressed or pushed off even in very tight constraints:
<Icon src={expensifyIcons.DownArrow} fill={theme.icon} width={caretWidth ?? variables.iconSizeExtraSmall} height={caretHeight ?? variables.iconSizeExtraSmall} additionalStyles={[styles.flexShrink0, isActive ? styles.flipUpsideDown : undefined]} /> - Ensure the caret icon has
What alternative solutions did you explore? (Optional)
Setting maxWidth on the text element, but applying flexShrink1 to CaretWrapper and flexShrink0 to the caret icon is the idiomatic, fully responsive React Native solution across all platforms and font sizes.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~015ef940ed32e0c10f
⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.