Skip to content

Move pre-selected assignee to top of list in Issue New Expensify Card flow - #98131

Merged
robertjchen merged 4 commits into
Expensify:mainfrom
marufsharifi:fix/issue-new-assignee-selected-order
Sep 2, 2026
Merged

Move pre-selected assignee to top of list in Issue New Expensify Card flow#98131
robertjchen merged 4 commits into
Expensify:mainfrom
marufsharifi:fix/issue-new-assignee-selected-order

Conversation

@marufsharifi

@marufsharifi marufsharifi commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Part of the ongoing rollout to show pre-selected list items at the top when a selection list (re)opens. This applies the established pattern to the Issue New Expensify Card → "Who needs a card?" assignee step, mirroring the already-merged assign-card AssigneeStep.

Fixed Issues

$ #69184
PROPOSAL: #69184 (comment)

Tests

Precondition: admin on a workspace with Expensify Card enabled and ≥ 12 eligible members.

  1. Open Issue new Expensify Card → the "Who needs a card?" step. Select the low-sorting member and continue.
  2. Tap back to the assignee step.
    • Verify: the previously selected member is pinned to the top and shown as selected; no flicker/jump on reopen.
  3. From a card's Confirmation step, edit the assignee.
    • Verify: the current assignee is pinned to the top on open.
  4. Type a search term matching the pinned member and others.
    • Verify: the pinned member stays at the top of the results.
  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

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
Screen.Recording.2026-08-26.at.6.47.40.PM.mov
Android: mWeb Chrome
Screen_Recording_20260824_151543_Chrome.mp4
iOS: Native
Screen.Recording.2026-08-26.at.7.17.50.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-08-24.at.5.14.14.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-24.at.3.03.41.PM.mov

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
.../workspace/expensifyCard/issueNew/AssigneeStep.tsx 74.35% <100.00%> (+74.35%) ⬆️
... and 7 files with indirect coverage changes

@marufsharifi
marufsharifi marked this pull request as ready for review August 28, 2026 17:52
@marufsharifi
marufsharifi requested review from a team as code owners August 28, 2026 17:52
@melvin-bot
melvin-bot Bot requested review from linhvovan29546 and removed request for a team August 28, 2026 17:52
@melvin-bot

melvin-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

@linhvovan29546 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 August 28, 2026 17:52
@linhvovan29546

Copy link
Copy Markdown
Contributor

@marufsharifi Can you please add a test? Thanks

textInputOptions={textInputOptions}
isLoadingNewOptions={canInviteMembers && !!isSearchingForReports}
initiallyFocusedItemKey={issueNewCard?.data?.assigneeEmail}
initiallyFocusedItemKey={initialAssigneeEmail}

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.

I think we should add shouldScrollToFocusedIndexOnMount={false} as well.

@marufsharifi

Copy link
Copy Markdown
Contributor Author

@linhvovan29546 The feedbacks have been applied, thanks

@linhvovan29546

linhvovan29546 commented Aug 30, 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
Screen.Recording.2026-08-30.at.09.33.15.mov
Android: mWeb Chrome
Screen.Recording.2026-08-30.at.09.30.04.mov
iOS: HybridApp
Screen.Recording.2026-08-30.at.09.33.53.mov
iOS: mWeb Safari
Screen.Recording.2026-08-30.at.09.15.50.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-30.at.09.10.01.mov

@melvin-bot
melvin-bot Bot requested a review from robertjchen August 30, 2026 02:37

@robertjchen robertjchen 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.

thanks!

@marufsharifi

Copy link
Copy Markdown
Contributor Author

@robertjchen, could you please ask someone else to take a look at this pr, since @heyjennahay seems to be ooo. thanks.

@robertjchen

Copy link
Copy Markdown
Contributor

I think this is fine to merge 👍

@robertjchen
robertjchen merged commit 2846409 into Expensify:main Sep 2, 2026
35 of 37 checks passed
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/robertjchen in version: 9.4.69-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required — no draft PR created.

This PR only changes the ordering of an existing list: on the "Who needs a card?" step, the already-selected member is pinned to the top when the step reopens. It adds no new feature, setting, button, or step, and it renames nothing.

How I checked

What the PR changessrc/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx: the member list is passed through moveInitialSelectionToTop before search filtering, and shouldScrollToFocusedIndexOnMount is disabled. Everything the user sees is otherwise identical — same members, same labels, same actions.

What the help site says about this flow — the only article documenting card issuance is docs/articles/new-expensify/expensify-card/Set-Up-and-Manage-the-Expensify-Card-US.md:54-74 (and its UK/EU counterpart). Step 3 reads "Select the employee" — it never describes how that list is sorted or where the selected member appears.

Broader sweep — I grepped all of docs/articles for statements about list ordering (sorted, alphabetical, top of the list, pre-selected). The only hits are Insights reports, saved searches, and chat priority modes. Nothing covers member or assignee pickers.

Since the linked issue Expensify/App#69184 is a UI-polish rollout across many pickers, future PRs in the same series will land in the same place: no documented behavior to update.

@marufsharifi, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

Note: since no docs changes were needed, there is no linked help site PR to review. If you disagree and want an article to call out the pinning behavior, reply with @MelvinBot and the article you'd like it added to, and I'll open the draft PR.


view run

@OSBotify

OSBotify commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 9.4.69-1 🚀

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

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.

5 participants