Skip to content

[Due for payment 2025-06-24] [Auto-Submit] Create the new Beta, NVP and Modal #63195

@MarioExpensify

Description

@MarioExpensify

Auto-Submit Project

Tracking Issue: https://github.com/Expensify/Expensify/issues/457732

Design Doc Section: 2.1 [External] Create the new Beta, NVP and Modal


Task

Map the new "autoSubmit" beta

Create the new const in CONST.ts:

   BETAS: {
	// ...
       AUTO_SUBMIT: 'autoSubmit',
   },
   BUTTON_STATES: {

And a helper function in Permissions.ts:

function canUseAutoSubmit(betas: OnyxEntry<Beta[]>): boolean {
   return !!betas?.includes(CONST.BETAS.AUTO_SUBMIT) || canUseAllBetas(betas);
}

These will be helpful when implementing the logic to display the new modal.

Create the new modal NVP:

A new NVP will be used to switch when / how the new Auto-Submit educational modal will be displayed, we need to create and map the new NVP in ONYXKEYS.ts:

   /** The user has seen and dismissed the instant submit explanation modal */
   NVP_DISMISSED_INSTANT_SUBMIT_EXPLANATION: 'nvp_dismissedInstantSubmitExplanation',

   // ... 

   [ONYXKEYS.NVP_DISMISSED_INSTANT_SUBMIT_EXPLANATION]: boolean;

From the [detailed design]
(https://docs.google.com/document/d/1_970yj98KyTip7_9kM3IM5WyZfBMSycRfhZNXyc9n3w/edit?tab=t.0#heading=h.nkp3t26mpodx):

The new NVP will use the usual “SetNameValuePair” command to save its multiple states so we don't need to implement any new backend call. When the user dismisses the modal for the first time we need to make sure to create the NVP with the value set as “false”, when the user checks the “Don't show again” checkbox and dismisses the modal, we need to set the value as “true”.

Here are the possible values of the new NVP:

  • "undefined" - The modal has never been displayed for the user, the first time the modal is displayed, it should not display the “Don't show again” checkbox. After the modal is displayed for the first time, the NVP value must be set to “false”.
  • false” - The modal must be displayed with the “Don't show again” button.
  • true” - The modal should not be displayed anymore.

Create the new modal (FE):

Using the FeatureTrainingModal as a foundation, we must implement a new educational modal for Auto-Submit:

Image

The modal must check the "nvp_dismissedInstantSubmitExplanation" NVP and use its rules to determine if the dismiss checkbox should be displayed or not:

Image

Displaying the modal in the Report details page is not part of this issue.

Issue OwnerCurrent Issue Owner: @garrettmknight

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2EngineeringNewFeatureSomething to build that is a new item.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions