Skip to content

Remove the noRightMarginOnSubscriptContainer prop from ReportAvatar - #100575

Merged
roryabraham merged 6 commits into
Expensify:mainfrom
software-mansion-labs:chore/remove-no-right-margin-on-subscript-container
Sep 17, 2026
Merged

roryabraham merged 6 commits into
Expensify:mainfrom
software-mansion-labs:chore/remove-no-right-margin-on-subscript-container

Conversation

@jmusial

@jmusial jmusial commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Replaces the boolean noRightMarginOnSubscriptContainer prop on ReportActionAvatars and ReportAvatar with a generic subscriptAvatarContainerStyle style prop.

Fixed Issues

$ #99941
PROPOSAL:

Tests

  1. Open app, sign in to an account with a workspace.
  2. Navigate to Workspaces > [workspace] > Rooms.
  3. Verify that room avatars in the table render with no extra right margin.

Offline tests

QA Steps

Same as tests

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native image
Android: mWeb Chrome image
iOS: Native image
iOS: mWeb Safari image
MacOS: Chrome / Safari image

@jmusial jmusial changed the title remove noRightMarginOnSubscriptContainer prop Remove the noRightMarginOnSubscriptContainer prop from ReportAvatar Sep 8, 2026
@jmusial

jmusial commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@MelvinBot review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 19fcd1cb8c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@MelvinBot

MelvinBot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Code review

LGTM on the refactor — this is a clean 1:1 swap with no behavior change, and all 4 call sites were converted with none missed. Three non-blocking notes below, plus the PR body needs filling in before merge.

Correctness

The old containerStyle={noRightMarginOnSubscriptContainer ? styles.mr0 : {}} became containerStyle={subscriptAvatarContainerStyle}, so the default goes from {} to undefined. That's a no-op — SubscriptAvatarFrame.tsx:35 puts it in a style array, which drops undefined. Every previous noRightMarginOnSubscriptContainer call site now passes styles.mr0 explicitly, which is exactly what the flag resolved to.

Notes

  1. The prop name points at the wrong element. subscriptAvatarContainerStyle styles the outer frame that wraps both the primary avatar and the subscript badge, while its sibling subscriptAvatarBorderColor targets the badge itself (SubscriptAvatar.tsx:65). Two props sharing a subscriptAvatar prefix but hitting different nodes will get misused. Consider subscriptContainerStyle, or at least change the JSDoc at index.tsx:67 to say it styles the subscript stack's outer container.

  2. SubscriptCardFeedAvatar isn't covered. The new prop also feeds index.tsx:218, but the new test only exercises the SUBSCRIPT branch. A subscriptCardFeed variant of the same assertion would close that.

  3. A new prop instead of the existing ones is the right call — worth stating since the linked issue asked to "express the margin override through the existing container-style props." Neither existing prop reaches the subscript frame, and ReportActionItemSingle needs styles.actionAvatar for single and styles.mr0 for subscript, so they can't be collapsed into one prop. Reusing singleAvatarContainerStyle would have been wrong.

Needed before merge

The PR body is a bare template: no explanation of change, no Tests or QA Steps, empty PROPOSAL:, and no checklists or screenshots. I couldn't run documented test steps because there aren't any yet. Since ReportActionItemSingle and DynamicNewTaskPage are both on the changed list, the steps should at least cover a chat report action avatar, the new-task assignee avatar, and the narrow-layout workspace rooms table row.

Verification details

Reviewed at 19fcd1c.

  • git grep noRightMarginOnSubscriptContainer on origin/main returns 11 hits across 6 files; all 6 are updated in this PR and the grep returns nothing on the branch. No stragglers.
  • The removed useThemeStyles import is safe — styles. has zero remaining references in ReportActionAvatars/index.tsx. useStyleUtils is still used at index.tsx:268.
  • The new UI test is not vacuous: the default subscript frame gets marginRight: variables.avatarChatSpacing via getContainerStyles, so asserting marginRight: 0 genuinely proves the override wins.
  • ReportAvatarTest uses toMatchObject, so forwarding the new prop through {...rest} in ReportAvatar.tsx:96 satisfies it.
  • singleAvatarContainerStyle={[styles.actionAvatar]} → styles.actionAvatar is safe: the consuming ?? at index.tsx:268 only checks nullishness, and both forms are non-null.
  • ESLint on the 5 changed source files reports 2 rulesdir/no-inline-useOnyx-selector errors, at ReportActionItemSingle.tsx:133 and DynamicNewTaskPage.tsx:80. Both are pre-existing — the same code is present on origin/main on lines this PR doesn't touch. Not yours to fix here.
  • I was not able to execute the Jest suite in this environment, so the two test files are reviewed statically only. CI results are authoritative.

Reply with @MelvinBot <your feedback> to refine this review.


view run · view recording

@jmusial
jmusial marked this pull request as ready for review September 15, 2026 11:57
@jmusial
jmusial requested review from a team as code owners September 15, 2026 11:57
@melvin-bot
melvin-bot Bot requested review from a team, huult and joekaufmanexpensify and removed request for a team September 15, 2026 11:57
@melvin-bot

melvin-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

@huult Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from heyjennahay and removed request for a team September 15, 2026 11:57
@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

No product review needed.

@huult

huult commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@jmusial could you sync with main?

@huult

huult commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp Screenshot 2026-09-17 at 15 10 38
Android: mWeb Chrome Screenshot 2026-09-17 at 15 11 27
iOS: HybridApp Screenshot 2026-09-17 at 15 12 43
iOS: mWeb Safari Screenshot 2026-09-17 at 15 13 11
MacOS: Chrome / Safari Screenshot 2026-09-17 at 15 08 01

@huult

huult commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@jmusial Tag me once you’ve resolved the conflicts, and I’ll approve this PR.

@jmusial

jmusial commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@huult all yours

@huult huult left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@melvin-bot
melvin-bot Bot requested a review from roryabraham September 17, 2026 14:26

@roryabraham roryabraham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice and simple

@roryabraham
roryabraham merged commit 396398e into Expensify:main Sep 17, 2026
35 of 37 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.82-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 cancelled 🔪
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site changes are required for this PR, so I did not create a draft docs PR.

This is an internal API refactor with no user-visible change. It swaps the boolean noRightMarginOnSubscriptContainer prop for a generic subscriptAvatarContainerStyle style prop on ReportActionAvatars and ReportAvatar. Every call site passes styles.mr0, which is exactly what the old boolean resolved to, so the rendered output is identical.

What I checked

The diff only touches component props and their call sites:

Nothing in the diff changes what a customer sees or does:

  • No new or renamed feature, page, tab, setting, or button
  • No copy changes — no src/languages/*.ts files were touched
  • No change to any documented workflow or navigation path
  • The PR's own test plan is a visual no-regression check ("verify that room avatars in the table render with no extra right margin"), not new behavior to document

Help site articles under docs/articles describe customer-facing workflows and UI labels. A prop rename that produces identical rendering has no article to update.

@jmusial, there is no help site PR to link because this change is not customer-facing. Please confirm you agree that no docs update is needed. If you think an article does need updating, reply with which one and what changed, and I will open the draft PR.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.86-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes are required. I did not create a docs draft PR.

This PR is an internal API refactor with no user-facing change. It swaps the boolean noRightMarginOnSubscriptContainer prop for a generic subscriptAvatarContainerStyle style prop on ReportActionAvatars and ReportAvatar, and updates the four call sites to pass styles.mr0 through the new prop. The rendered margin is identical before and after.

Why nothing in docs/articles is affected

Help site articles document user-facing behavior — feature names, settings labels, buttons, and workflows. This PR changes none of those:

  • No copy change. No src/languages/*.ts file is touched, so no UI string, label, or button text changes.
  • No behavior change. Every call site passes the same styles.mr0 value the boolean used to hard-code, so avatars render exactly as they did.
  • No new or removed feature. The prop is a component-internal styling detail that never appears in the product UI.
  • Nothing to update in the articles. The touched surfaces — the workspace rooms table, report action avatars, and the new task page — have no help site content describing avatar spacing. The only docs/articles grep hits for "subscript" are the word "subscription" in billing articles.

Files changed are all under src/components, src/pages, and tests/ — no docs/ path is in the diff.

Since there is no docs PR, there is nothing for you to review on the help site side. If you would like an article updated anyway — for example because [Performance] ReportActionAvatars — remove the noRightMarginOnSubscriptContainer prop from ReportAvatar (Expensify/App#99941) is part of a larger change that does alter what users see — reply with @MelvinBot and point me at the behavior you want documented, and I will open the draft PR.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.89-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/luacmartins in version: 9.4.89-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

Bundle Size Analysis (Sentry):

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants