Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2023-06-21] [$1000] Inconsistent styling on create task push to page #20007

Closed
thienlnam opened this issue Jun 1, 2023 · 34 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.

Comments

@thienlnam
Copy link
Contributor

thienlnam commented Jun 1, 2023

https://expensify.slack.com/archives/C04QEB4MJEQ/p1685378425623999

The labels should use our textSupporting color
The small label should be closer to the value
the arrows/carets should use our icon color and should be at 20x20

The style on the second step of creating a task is inconsistent with the push-to-page style from other places in the app. I feel like we keep recreating this style instead of just using the same global component.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018dddd8a08831da39
  • Upwork Job ID: 1664377958553657344
  • Last Price Increase: 2023-06-01
@thienlnam
Copy link
Contributor Author

Current:
Screenshot 2023-06-01 at 2 05 57 PM

Styles should look like
Screenshot 2023-06-01 at 2 06 18 PM

@thienlnam thienlnam self-assigned this Jun 1, 2023
@thienlnam thienlnam added External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. labels Jun 1, 2023
@melvin-bot melvin-bot bot changed the title Inconsistent styling on create task push to page [$1000] Inconsistent styling on create task push to page Jun 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~018dddd8a08831da39

@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

Triggered auto assignment to @muttmuure (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot melvin-bot bot added the Daily KSv2 label Jun 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

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

@allroundexperts
Copy link
Contributor

allroundexperts commented Jun 1, 2023

Proposal

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

Make task page confirmation styles consistent

What is the root cause of that problem?

Not a bug but a feature.

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

We have to edit our MenuItem component such that it supports following new props:

  1. withoutHover: By default, MenuItem when hovered, shows a different background colour. To circumvent this, we have to check the value of the new props withoutHover here. This gets replaced by:
StyleUtils.getButtonBackgroundColorStyle(getButtonState(props.focused || (props.withHover && hovered), pressed, props.success, props.disabled, props.interactive), true),
  1. alternateText: In order to display text on top of the MenuItem like in the image below, we have to use another prop called alternateText. This can be added here:
{props.alternateText &&
                <View style={[styles.pl5]}>
                    <Text style={StyleUtils.combineStyles(styles.sidebarLinkText, styles.optionAlternateText, styles.textLabelSupporting, styles.pre)}>{props.alternateText}</Text>
                </View>
            }
Screenshot 2023-06-02 at 3 39 28 AM

Lastly, we also need to support an array of icon in the MenuItems component. In order to achieve this, we have to change this condition to:

    {Boolean(props.icon) && !_.isArray(props.icon) && (

At top of this condition, we have to add the following:

{Boolean(props.icon) && _.isArray(props.icon) && (
      <MultipleAvatars
          icons={props.icon}
          size={CONST.AVATAR_SIZE.DEFAULT}
          secondAvatarStyle={[StyleUtils.getBackgroundAndBorderStyle(themeColors.appBG)]}
      />
)}

Once these changes are applied, we can use MenuItem instead of TaskSelectorLink as follow:

<MenuItem
          alternateText={assignee.displayName ? props.translate('newTaskPage.assignee'): ''}
          title={assignee.displayName ? assignee.displayName : props.translate('newTaskPage.assignee')}
          description={assignee.subtitle}
          onPress={() => Navigation.navigate(ROUTES.NEW_TASK_ASSIGNEE)}
          shouldShowRightIcon
          icon={assignee.icons}
          withHover={false}
/>

Once we use the MenuItem we won't need the horizontal padding that we use here.

The approach can be further optimised in a PR.

What alternative solutions did you explore? (Optional)

This needs to be changed to:

   <Text style={[styles.label, styles.textLabelSupporting, props.icons.length > 0 ? styles.mb2 : styles.mb0]}>{props.translate(props.label)}</Text>

This needs to be changed to:

<Icon
    src={Expensicons.ArrowRight}
    fill={themeColors.icon}
    width={variables.iconSizeNormal}
    height={variables.iconSizeNormal}
    inline
/>

Result

Screenshot 2023-06-02 at 2 15 51 AM

@sethraj14
Copy link

Proposal

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

Inconsistent styling on create task push to page

What is the root cause of that problem?

Not providing right styles to the text and icons

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

We could make the styles consistent by changing these lines -

<Text style={[styles.label, styles.textLabelSupporting, props.icons.length > 0 ? styles.mb2 : styles.mb0]}>{props.translate(props.label)}</Text>

and pass these styles to icon -

<Icon src={Expensicons.ArrowRight} fill={themeColors.icon} width={variables.iconSizeNormal} height={variables.iconSizeNormal} inline />

Screenshot 2023-06-02 at 2 53 51 AM

What alternative solutions did you explore? (Optional)

@s77rt
Copy link
Contributor

s77rt commented Jun 1, 2023

@allroundexperts Thanks for the proposal. Can we re-use MenuItemWithTopDescription instead of recreating the component?

@s77rt
Copy link
Contributor

s77rt commented Jun 1, 2023

@sethraj14 Thanks for the proposal. Same question as above ^

@allroundexperts
Copy link
Contributor

@allroundexperts Thanks for the proposal. Can we re-use MenuItemWithTopDescription instead of recreating the component?

Yep. We can. Posting 'how' in some time.

@sethraj14
Copy link

@allroundexperts Thanks for the proposal. Can we re-use MenuItemWithTopDescription instead of recreating the component?

Yes, I was exploring the same as we use this in every other place.

@allroundexperts
Copy link
Contributor

@s77rt Proposal updated.

@sethraj14
Copy link

@s77rt

Proposal

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

Inconsistent styling on create task push to page

What is the root cause of that problem?

Not providing right styles to the text and icons

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

In order to shift to MenuItemWithTopDescription we have these fields to map -

  1. label -> description (with props.translate(<value_here>))
  2. text -> title
  3. onPress -> onPress
  4. disabled -> shouldShowRightIcon
  5. alternateText -> Add new props alternateText to MenuItem
  6. icon -> Add support for array of icons

After adding these props, we need to change the MenuItem file like this here-

                                {Boolean(props.icon) && _.isArray(props.icon) && (
                                    <MultipleAvatars
                                        icons={props.icon}
                                        size={CONST.AVATAR_SIZE.DEFAULT}
                                        secondAvatarStyle={[StyleUtils.getBackgroundAndBorderStyle(themeColors.appBG)]}
                                    />
                                )}
                                {Boolean(props.alternateText) && (
                                    <View style={[styles.pl0]}>
                                        <Text
                                            style={titleTextStyle}
                                            numberOfLines={1}
                                        >
                                            {convertToLTR(props.title)}
                                        </Text>
                                        <Text style={StyleUtils.combineStyles(styles.sidebarLinkText, styles.optionAlternateText, styles.textLabelSupporting, styles.pre)}>
                                            {props.alternateText}
                                        </Text>
                                    </View>
                                )}

Hover should be there as it will be consistent with other similar screens.

Discard isShareDestination as it is not doing anything in the current implementation

Finally the NewTaskPage file will look like this -

<ScrollView>
                <View style={styles.flex1}>
                    <MenuItemWithTopDescription
                        description={props.translate('newTaskPage.title')}
                        title={props.task.title}
                        onPress={() => Navigation.navigate(ROUTES.NEW_TASK_TITLE)}
                        shouldShowRightIcon={true}
                    />
                    <MenuItemWithTopDescription
                        description={props.translate('newTaskPage.description')}
                        title={props.task.description}
                        onPress={() => Navigation.navigate(ROUTES.NEW_TASK_DESCRIPTION)}
                        shouldShowRightIcon={true}
                    />
                    <MenuItemWithTopDescription
                        alternateText={assignee.subtitle}
                        description={props.translate('newTaskPage.assignee')}
                        title={assignee.displayName || ''}
                        onPress={() => Navigation.navigate(ROUTES.NEW_TASK_ASSIGNEE)}
                        shouldShowRightIcon={true}
                        icon={assignee.icons}
                    />
                    <MenuItemWithTopDescription
                        alternateText={shareDestination.subtitle}
                        description={props.translate('newTaskPage.shareSomewhere')}
                        title={shareDestination.displayName || ''}
                        onPress={() => Navigation.navigate(ROUTES.NEW_TASK_SHARE_DESTINATION)}
                        shouldShowRightIcon={true}
                        icon={shareDestination.icons}
                    />
                    <FormAlertWithSubmitButton
                        isAlertVisible={submitError}
                        message={errorMessage}
                        onSubmit={() => onSubmit()}
                        enabledWhenOffline
                        buttonText={props.translate('newTaskPage.confirmTask')}
                        containerStyles={[styles.mh0, styles.mt5, styles.flex1]}
                    />
                </View>
            </ScrollView>

The final solution will be cleaned and optimized.

What alternative solutions did you explore? (Optional)

We could make the styles consistent by changing these lines -

<Text style={[styles.label, styles.textLabelSupporting, props.icons.length > 0 ? styles.mb2 : styles.mb0]}>{props.translate(props.label)}</Text>

and pass these styles to icon -

<Icon src={Expensicons.ArrowRight} fill={themeColors.icon} width={variables.iconSizeNormal} height={variables.iconSizeNormal} inline />

Screenshot 2023-06-02 at 2 53 51 AM

@melvin-bot
Copy link

melvin-bot bot commented Jun 1, 2023

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@s77rt
Copy link
Contributor

s77rt commented Jun 2, 2023

@allroundexperts Thanks. This is looking good but let's not worry about the hover style, it's better to keep it for consistency.

🎀 👀 🎀 C+ reviewed

cc @thienlnam

@s77rt
Copy link
Contributor

s77rt commented Jun 2, 2023

@sethraj14 Thanks. I think the idea is the same as @allroundexperts's so we will just go with the first. But feel free to check other issues with Help Wanted label here.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

📣 @allroundexperts You have been assigned to this job by @thienlnam!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@thienlnam
Copy link
Contributor Author

Assigned, thanks! Also one more thing can we make sure to add a bold style to the assignee name while we're already here?

@allroundexperts
Copy link
Contributor

PR created #20145

@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

@s77rt, @allroundexperts, @thienlnam, @muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@s77rt
Copy link
Contributor

s77rt commented Jun 12, 2023

Not overdue. PR is merged.

@muttmuure
Copy link
Contributor

Not on prod yet

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 14, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Inconsistent styling on create task push to page [HOLD for payment 2023-06-21] [$1000] Inconsistent styling on create task push to page Jun 14, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.27-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-06-21. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jun 21, 2023
@muttmuure
Copy link
Contributor

@allroundexperts @s77rt invited to job

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@s77rt
Copy link
Contributor

s77rt commented Jun 26, 2023

@muttmuure Applied!

@muttmuure
Copy link
Contributor

Offer sent to @s77rt. Still waiting on @allroundexperts to apply

@allroundexperts
Copy link
Contributor

Offer sent to @s77rt. Still waiting on @allroundexperts to apply

Can you send me the link please?

@s77rt
Copy link
Contributor

s77rt commented Jun 28, 2023

@muttmuure Accepted!

@melvin-bot melvin-bot bot added the Overdue label Jun 30, 2023
@muttmuure
Copy link
Contributor

@s77rt paid, @allroundexperts offer sent

@melvin-bot melvin-bot bot removed the Overdue label Jul 3, 2023
@allroundexperts
Copy link
Contributor

@s77rt paid, @allroundexperts offer sent

@muttmuure Accepted!

@melvin-bot melvin-bot bot added the Overdue label Jul 5, 2023
@thienlnam
Copy link
Contributor Author

I think we're all good here? @allroundexperts Did your contract get paid out?

@melvin-bot melvin-bot bot removed the Overdue label Jul 6, 2023
@allroundexperts
Copy link
Contributor

Seems like its still in progress @thienlnam.

Screenshot 2023-07-06 at 10 40 02 AM

@muttmuure
Copy link
Contributor

Contract paid out for @allroundexperts too.

Thanks for your patience here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement.
Projects
None yet
Development

No branches or pull requests

5 participants