Skip to content

[Due for payment 2026-01-29] [$250] Change Approver dialog - make options explicit & skip when single option #77306

Closed

Description

@marcaaron

coming from https://expensify.slack.com/archives/C07NMDKEFMH/p1765388830729039

cc @garrettmknight

Problem

  • Dialog reads like paragraphs, not a selectable list.
  • Page appears when only one option.
  • No option is preselected.
Image

Solution

  • Header: "Choose an option to change the approver for this report. (Update your workspace settings to change this permanently for all reports.)"
  • If options.length === 1, skip the dialog and apply the single choice.
  • Render options and ensure one option is selected by default.

Requirements

  • Header updated.
  • Dialog skipped when only one option exists.
  • Options shown with a default selection.
Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022005687283419334557
  • Upwork Job ID: 2005687283419334557
  • Last Price Increase: 2026-01-05
  • Automatic offers:
    • nyomanjyotisa | Contributor | 110083706
Issue OwnerCurrent Issue Owner: @

Activity

  1. self-assigned this
    on Dec 11, 2025
  2. added
    External
    on Dec 11, 2025
  3. added
    Help Wanted
    on Dec 11, 2025
  4. melvin-bot commented on Dec 11, 2025

    @melvin-bot

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

  5. nyomanjyotisa commented on Dec 11, 2025

    @nyomanjyotisa
    Member

    🚨 Edited by proposal-police: This proposal was edited at 2025-12-11 01:09:15 UTC.

    Proposal

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

    Change Approver dialog - make options explicit & skip when single option

    What is the root cause of that problem?

    The header is built from separate subtitle and description translations

    const listHeader = useMemo(
    () => (
    <>
    <Text style={[styles.ph5, styles.mb5]}>{translate('iou.changeApprover.subtitle')}</Text>
    <View style={[styles.ph5, styles.mb5, styles.renderHTML, styles.flexRow]}>
    <RenderHTML html={translate('iou.changeApprover.description', {workflowSettingLink: `${environmentURL}/${ROUTES.WORKSPACE_WORKFLOWS.getRoute(policy?.id)}`})} />
    </View>
    </>
    ),
    [environmentURL, policy?.id, styles.flexRow, styles.mb5, styles.ph5, styles.renderHTML, translate],
    );

    And the selectedApproverType state is initialized as undefined, so no option is preselected

    const [selectedApproverType, setSelectedApproverType] = useState<ApproverType>();

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

    1. We can create a new translation key like iou.changeApprover.header and then update the header to use the new text format
                header: ({workflowSettingLink}: WorkflowSettingsParam) =>
                    `Choose an option to change the approver for this report. (Update your <a href="${workflowSettingLink}">workspace settings</a> to change this permanently for all reports.)`,
        const listHeader = useMemo(
            () => (
                <View style={[styles.ph5, styles.mb5, styles.renderHTML, styles.flexRow]}>
                    <RenderHTML
                        html={translate('iou.changeApprover.header', {
                            workflowSettingLink: `${environmentURL}/${ROUTES.WORKSPACE_WORKFLOWS.getRoute(policy?.id)}`,
                        })}
                    />
                </View>
            ),
            [environmentURL, policy?.id, styles.flexRow, styles.mb5, styles.ph5, styles.renderHTML, translate],
        );

    const listHeader = useMemo(
    () => (
    <>
    <Text style={[styles.ph5, styles.mb5]}>{translate('iou.changeApprover.subtitle')}</Text>
    <View style={[styles.ph5, styles.mb5, styles.renderHTML, styles.flexRow]}>
    <RenderHTML html={translate('iou.changeApprover.description', {workflowSettingLink: `${environmentURL}/${ROUTES.WORKSPACE_WORKFLOWS.getRoute(policy?.id)}`})} />
    </View>
    </>
    ),
    [environmentURL, policy?.id, styles.flexRow, styles.mb5, styles.ph5, styles.renderHTML, translate],
    );

    1. Initialize selectedApproverType with the first option
        // Auto-select first option if none selected
        useEffect(() => {
            if (selectedApproverType === undefined && approverTypes.length > 0) {
                setSelectedApproverType(approverTypes[0].keyForList as ApproverType);
            }
        }, [approverTypes, selectedApproverType]);
    
        // Skip dialog if only one option
        useEffect(() => {
            if (!isLoadingReportData && !hasAutoAppliedRef.current && approverTypes.length === 1 && selectedApproverType === approverTypes[0].keyForList) {
                hasAutoAppliedRef.current = true;
                changeApprover();
            }
        }, [approverTypes, selectedApproverType, changeApprover, isLoadingReportData]);

    1. We can pass initiallyFocusedItemKey={selectedApproverType} to the SelectionList as well to make the preselected item highlighted

    1. After adding an approver, Navigation.dismissModal was called synchronously, which meant the report update from addReportApprover would cause ReportChangeApproverPage to re-render and trigger the auto-apply logic before the modal was dismissed. We can wrap Navigation.dismissModal in requestAnimationFrame or Navigation.setNavigationActionToMicrotaskQueue to prevent the skip dialog / auto-apply from retriggering
            requestAnimationFrame(() => {
                Navigation.dismissModal();
            });

    Navigation.dismissModal();

    What alternative solutions did you explore? (Optional)

    None

  6. changed the title [-]Change Approver dialog - make options explicit & skip when single option[/-] [+][HOLD] Change Approver dialog - make options explicit & skip when single option[/+] on Dec 11, 2025
  7. marcaaron commented on Dec 11, 2025

    @marcaaron
    ContributorAuthor

    Putting a hold on this while we continue to discuss.

  8. locked and limited conversation to collaborators on Dec 11, 2025
  9. changed the title [-][HOLD] Change Approver dialog - make options explicit & skip when single option[/-] [+]Change Approver dialog - make options explicit & skip when single option[/+] on Dec 29, 2025
  10. unlocked this conversation on Dec 29, 2025
  11. 31 remaining items

  12. melvin-bot commented on Jan 29, 2026

    @melvin-bot

    Issue is ready for payment but no BZ is assigned. @kadiealexander you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

  13. kadiealexander commented on Feb 3, 2026

    @kadiealexander
    Contributor

    Payment Summary

    @alitoshmatov please complete the checklist!

  14. kadiealexander commented on Feb 4, 2026

    @kadiealexander
    Contributor

    @alitoshmatov bump on this!

  15. kadiealexander commented on Feb 9, 2026

    @kadiealexander
    Contributor

    Bumped @alitoshmatov in Slack here.

  16. alitoshmatov commented on Feb 13, 2026

    @alitoshmatov
    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: This was not a bug, more like change of original behavior which was introduced in [Change Approver] Add support to bypass approver on an expense report  #66899

    • [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: No discussion was created

    • [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: https://github.com/Expensify/Expensify/issues/600042

    Regression Test Proposal

    Precondition:

    • Create a Control workspace
    • Invite at least one member to the workspace
    • The member has submitted an expense in the workspace

    Test:

    1. As the owner, open the expense created by the member
    2. Click More -> Change approver
    3. Verify that the Change approver dialog is skipped and the user is redirected to the Add approver screen
    4. Choose one member as the approver and click Save
    5. Click More -> Change approver
    6. Verify that the Change approver dialog is not skipped because there are two options
    7. Verify that the first option is selected by default
    8. Verify that the header reads as Choose an option to change the approver for this report. (Update your workspace settings to change this permanently for all reports.)

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-75b6-acb2-4392-f501f25557f4
  17. kadiealexander commented on Feb 13, 2026

    @kadiealexander
    Contributor

    Payment summary here.

  18. moved this from MEDIUM or LOW to Done in [#whatsnext] #migrateon Feb 13, 2026
  19. JmillsExpensify commented on Feb 21, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @alitoshmatov

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

Metadata

Metadata

Labels

Awaiting PaymentDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions