Skip to content

[Due for payment 2026-01-28] [$100] Fix Badge Alignment on workspace members page #79341

Closed

Description

@war-in

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.2.98-0
Reproducible in staging?: YES
Reproducible in production?: YES
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:
Slack conversation (hyperlinked to channel name):

Action Performed:

Break down in numbered steps

  1. Open /workspace/<workspaceID>/members
  2. Have at least three members
  3. One member should have Owner badge, second should be an Admin (click on the user, select role and choose admin) and the last one - Auditor

Expected Result:

All badges should be aligned to the right

Actual Result:

Badges are not right-aligned

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022010690753627221946
  • Upwork Job ID: 2010690753627221946
  • Last Price Increase: 2026-01-12
  • Automatic offers:
    • situchan | Reviewer | 110087479
    • nyomanjyotisa | Contributor | 110087482
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @lydiabarclay

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 12, 2026
  2. melvin-bot commented on Jan 12, 2026

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. situchan commented on Jan 12, 2026

    @situchan
    Contributor

    Assignment ✋

  4. nyomanjyotisa commented on Jan 12, 2026

    @nyomanjyotisa
    Member

    Proposal

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

    Fix Badge Alignment on workspace members page

    What is the root cause of that problem?

    In the wide layout, the badge is wrapped in a View with only getMinimumWidth(variables.w72) and no right alignment

    <View style={[StyleUtils.getMinimumWidth(variables.w72)]}>
    <MemberRightIcon
    role={policyEmployee.role}
    owner={policy?.owner}
    login={details.login}
    />
    </View>

    In the narrow layout, MemberRightIcon is rendered directly without a wrapper, so it isn't right-aligned

    <MemberRightIcon
    role={policyEmployee.role}
    owner={policy?.owner}
    login={details.login}
    />

    Then, the Badge component has styles.alignSelfCenter hardcoded in its wrapper styles, which overrides any parent container alignment

    styles.alignSelfCenter,

    When a child element has alignSelf set, it takes precedence over the parent's alignItems. This means wrapping the badge in a container with styles.alignItemsEnd doesn't work because the badge's own alignSelfCenter overrides it

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

    Pass badgeStyles prop with styles.alignSelfEnd to MemberRightIcon badges to override the default alignSelfCenter

    export default function MemberRightIcon({role, owner, login}: MemberRightIconProps) {
        const {translate} = useLocalize();
        const styles = useThemeStyles();
    
        let badgeText: TranslationPaths | undefined;
        if (owner && owner === login) {
            badgeText = 'common.owner';
        } else if (role === CONST.POLICY.ROLE.ADMIN) {
            badgeText = 'common.admin';
        } else if (role === CONST.POLICY.ROLE.AUDITOR) {
            badgeText = 'common.auditor';
        }
        if (badgeText) {
            return <Badge text={translate(badgeText)} badgeStyles={[styles.alignSelfEnd]} />;
        }
        return null;
    }

    export default function MemberRightIcon({role, owner, login}: MemberRightIconProps) {
    const {translate} = useLocalize();
    let badgeText: TranslationPaths | undefined;
    if (owner && owner === login) {
    badgeText = 'common.owner';
    } else if (role === CONST.POLICY.ROLE.ADMIN) {
    badgeText = 'common.admin';
    } else if (role === CONST.POLICY.ROLE.AUDITOR) {
    badgeText = 'common.auditor';
    }
    if (badgeText) {
    return <Badge text={translate(badgeText)} />;
    }
    return null;
    }

    What alternative solutions did you explore? (Optional)

    Add a badgeStyles prop to MemberRightIcon and pass styles.alignSelfEnd from WorkspaceMembersPage to override the default alignSelfCenter only on the workspace members page

    type MemberRightIconProps = {
        owner?: string;
        role?: string;
        login?: string;
        badgeStyles?: StyleProp<ViewStyle>;
    };
    
    export default function MemberRightIcon({role, owner, login, badgeStyles}: MemberRightIconProps) {
        const {translate} = useLocalize();
    
        let badgeText: TranslationPaths | undefined;
        if (owner && owner === login) {
            badgeText = 'common.owner';
        } else if (role === CONST.POLICY.ROLE.ADMIN) {
            badgeText = 'common.admin';
        } else if (role === CONST.POLICY.ROLE.AUDITOR) {
            badgeText = 'common.auditor';
        }
        if (badgeText) {
            return <Badge text={translate(badgeText)} badgeStyles={badgeStyles} />;
        }
        return null;
    }

    type MemberRightIconProps = {
    owner?: string;
    role?: string;
    login?: string;
    };
    export default function MemberRightIcon({role, owner, login}: MemberRightIconProps) {
    const {translate} = useLocalize();
    let badgeText: TranslationPaths | undefined;
    if (owner && owner === login) {
    badgeText = 'common.owner';
    } else if (role === CONST.POLICY.ROLE.ADMIN) {
    badgeText = 'common.admin';
    } else if (role === CONST.POLICY.ROLE.AUDITOR) {
    badgeText = 'common.auditor';
    }
    if (badgeText) {
    return <Badge text={translate(badgeText)} />;
    }
    return null;
    }

    Then pass badgeStyles with styles.alignSelfEnd

                    rightElement: isControlPolicyWithWideLayout ? (
                        <>
                            <View style={[styles.flex1, styles.pr3]}>
                                <Text
                                    numberOfLines={1}
                                    style={[styles.alignSelfStart]}
                                >
                                    {policyEmployee.employeeUserID}
                                </Text>
                            </View>
                            <View style={[styles.flex1, styles.pr3]}>
                                <Text
                                    numberOfLines={1}
                                    style={[styles.alignSelfStart]}
                                >
                                    {policyEmployee.employeePayrollID}
                                </Text>
                            </View>
                            <View style={[StyleUtils.getMinimumWidth(variables.w72)]}>
                                <MemberRightIcon
                                    role={policyEmployee.role}
                                    owner={policy?.owner}
                                    login={details.login}
                                    badgeStyles={[styles.alignSelfEnd]}
                                />
                            </View>
                        </>
                    ) : (
                        <MemberRightIcon
                            role={policyEmployee.role}
                            owner={policy?.owner}
                            login={details.login}
                            badgeStyles={[styles.alignSelfEnd]}
                        />
                    ),

    rightElement: isControlPolicyWithWideLayout ? (
    <>
    <View style={[styles.flex1, styles.pr3]}>
    <Text
    numberOfLines={1}
    style={[styles.alignSelfStart]}
    >
    {policyEmployee.employeeUserID}
    </Text>
    </View>
    <View style={[styles.flex1, styles.pr3]}>
    <Text
    numberOfLines={1}
    style={[styles.alignSelfStart]}
    >
    {policyEmployee.employeePayrollID}
    </Text>
    </View>
    <View style={[StyleUtils.getMinimumWidth(variables.w72)]}>
    <MemberRightIcon
    role={policyEmployee.role}
    owner={policy?.owner}
    login={details.login}
    />
    </View>
    </>
    ) : (
    <MemberRightIcon
    role={policyEmployee.role}
    owner={policy?.owner}
    login={details.login}
    />
    ),

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 12, 2026
  6. changed the title [-]Fix Badge Alignment on workspace members page[/-] [+][$250] Fix Badge Alignment on workspace members page[/+] on Jan 12, 2026
  7. melvin-bot commented on Jan 12, 2026

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 12, 2026
  9. melvin-bot commented on Jan 12, 2026

    @melvin-bot

    Current assignee @situchan is eligible for the External assigner, not assigning anyone new.

  10. situchan commented on Jan 12, 2026

    @situchan
    Contributor

    @nyomanjyotisa's alternative solution looks good.
    I've gone through all usages of MemberRightIcon and this happens only on workspace members page.

    🎀 👀 🎀 C+ reviewed

  11. melvin-bot commented on Jan 12, 2026

    @melvin-bot

    Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  12. 10 remaining items

  13. nyomanjyotisa commented on Jan 13, 2026

    @nyomanjyotisa
    Member

    The PR is ready @situchan

  14. lydiabarclay commented on Jan 28, 2026

    @lydiabarclay
    Contributor

    Whoops automation failed here

  15. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Jan 28, 2026
  16. changed the title [-][$100] Fix Badge Alignment on workspace members page[/-] [+][Due for payment 2026-01-28] [$100] Fix Badge Alignment on workspace members page[/+] on Jan 28, 2026
  17. lydiabarclay commented on Jan 28, 2026

    @lydiabarclay
    Contributor

    @situchan can you fill out a bz checklist please?

  18. situchan commented on Jan 28, 2026

    @situchan
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/75242/changes#r2738296049

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    This is super minor style issue so we might not need regression test.

  19. lydiabarclay commented on Jan 28, 2026

    @lydiabarclay
    Contributor

    Payment Summary

    Contributor: @nyomanjyotisa paid $250 via Upwork
    Contributor+: @situchan paid $250 via Upwork

    ✅ No regression test needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions