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-10-12] [$500] Web - Focus outline for checkbox not aligned with border in TaskView #27872

Closed
1 of 6 tasks
kbecciv opened this issue Sep 20, 2023 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Sep 20, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Go to FAB > Assign task. Enter title, share somewhere and create a new task.
  2. In task view, click on composer and press shift + TAB 4 times (or more if there are comments in report).
  3. Notice that, focus outline is not aligned with border, radius is less for outline.

Expected Result:

Radius of outline on focus should be aligned with border like we have for TaskPreview and all other components.

Actual Result:

Focus outline is not aligned with border.

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.72.6
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

img2

img1

vid2.mov
vid1.mov

Expensify/Expensify Issue URL:
Issue reported by: @Nikhil-Vats
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695154519892849

View all open jobs on GitHub

@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 20, 2023
@melvin-bot melvin-bot bot changed the title Web - Focus outline for checkbox not aligned with border in TaskView [$500] Web - Focus outline for checkbox not aligned with border in TaskView Sep 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01d815e4b5fabb24f4

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

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

melvin-bot bot commented Sep 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

@kbecciv
Copy link
Author

kbecciv commented Sep 20, 2023

Proposal by: @Nikhil-Vats
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695154519892849

Proposal

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

Focus outline for checkbox is not aligned with border in TaskView. It is aligned at all other places.

What is the root cause of that problem?

In TaskView, size of checkbox is larger than all other places so we use larger border-radius of 8px. We pass it via props.

containerBorderRadius={8}

In all other places, we use the default border-radius for checkbox that is 4px.
containerBorderRadius: 4,

In order for the outline to be aligned, the border-radius for PressableWithFeedback (ancestor of Checkbox) should be 2px more than the border-radius of Checkbox but right now border-radius of PressableWithFeedback is fixed -

App/src/styles/styles.js

Lines 2642 to 2643 in 6d67552

checkboxPressable: {
borderRadius: 6,

So, except TaskView, outline is aligned for all checkboxes since they have 4px border-radius.
This was finalized in this PR but TaskView component was redesigned later and the checkbox size was made larger without keeping outline in mind which created this bug.

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

We need to make the border-radius of PressableWithFeedback dynamic by making it 2px more than the border-radius of Checkbox. For this, we can make a function in StyleUtils similar to getCheckboxContainerStyle which was created for dynamic border-radius for checkbox.

/**
 * Returns the checkbox pressable style
 */
function getCheckboxPressableStyle(borderRadius: number): ViewStyle | CSSProperties {
    return {
        padding: 2,
        justifyContent: 'center',
        alignItems: 'center',
        // eslint-disable-next-line object-shorthand
        borderRadius: borderRadius,
    };
}

Then, we can remove checkboxPressable styles from styles.js here and use the above utility function instead -

<PressableWithFeedback
    disabled={props.disabled}
    onPress={firePressHandlerOnClick}
    onMouseDown={props.onMouseDown}
    ref={props.forwardedRef}
    style={[props.style, StyleUtils.getCheckboxPressableStyle(props.containerBorderRadius + 2)]} // to align outline, border-radius of pressable should be 2px more than Checkbox
    onKeyDown={handleSpaceKey}
    accessibilityRole={CONST.ACCESSIBILITY_ROLE.CHECKBOX}
    accessibilityState={{checked: props.isChecked}}
    accessibilityLabel={props.accessibilityLabel}
    pressDimmingValue={1}
>

What alternative solutions did you explore? (Optional)

NA
Result -
https://github.com/Expensify/App/assets/31413407/48c6ec3d-c302-47ba-8d72-b2ef2c88fbad

@Nikhil-Vats
Copy link
Contributor

Reposting the proposal as the video is not visible in the one above.

Proposal

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

Focus outline for checkbox is not aligned with border in TaskView. It is aligned at all other places.

What is the root cause of that problem?

In TaskView, size of checkbox is larger than all other places so we use larger border-radius of 8px. We pass it via props.

containerBorderRadius={8}

In all other places, we use the default border-radius for checkbox that is 4px.

containerBorderRadius: 4,

In order for the outline to be aligned, the border-radius for PressableWithFeedback (ancestor of Checkbox) should be 2px more than the border-radius of Checkbox but right now border-radius of PressableWithFeedback is fixed -

App/src/styles/styles.js

Lines 2642 to 2643 in 6d67552

checkboxPressable: {
borderRadius: 6,

So, except TaskView, outline is aligned for all checkboxes since they have 4px border-radius.

This was finalized in this PR but TaskView component was redesigned later and the checkbox size was made larger without keeping outline in mind which created this bug.

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

We need to make the border-radius of PressableWithFeedback dynamic by making it 2px more than the border-radius of Checkbox. For this, we can make a function in StyleUtils similar to getCheckboxContainerStyle which was created for dynamic border-radius for checkbox.

/**
 * Returns the checkbox pressable style
 */
function getCheckboxPressableStyle(borderRadius: number): ViewStyle | CSSProperties {
    return {
        padding: 2,
        justifyContent: 'center',
        alignItems: 'center',
        // eslint-disable-next-line object-shorthand
        borderRadius: borderRadius,
    };
}

Then, we can remove checkboxPressable styles from styles.js here and use the above utility function instead -

<PressableWithFeedback
    disabled={props.disabled}
    onPress={firePressHandlerOnClick}
    onMouseDown={props.onMouseDown}
    ref={props.forwardedRef}
    style={[props.style, StyleUtils.getCheckboxPressableStyle(props.containerBorderRadius + 2)]} // to align outline, border-radius of pressable should be 2px more than Checkbox
    onKeyDown={handleSpaceKey}
    accessibilityRole={CONST.ACCESSIBILITY_ROLE.CHECKBOX}
    accessibilityState={{checked: props.isChecked}}
    accessibilityLabel={props.accessibilityLabel}
    pressDimmingValue={1}
>

What alternative solutions did you explore? (Optional)

NA

Result -

Screen.Recording.2023-09-20.at.2.04.16.AM.mov

@jliexpensify jliexpensify removed their assignment Sep 20, 2023
@jliexpensify
Copy link
Contributor

Removing myself as I was the 2nd B0 assigned

@jjcoffee
Copy link
Contributor

Reviewing on Monday!

@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2023
@jjcoffee
Copy link
Contributor

@Nikhil-Vats has a really nice clear proposal with the correct RCA and the solution makes sense, so happy to go with them!

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to @deetergp, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@deetergp
Copy link
Contributor

Thanks for a very nicely-written proposal, @Nikhil-Vats 👍

@melvin-bot melvin-bot bot removed the Overdue label Sep 29, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 29, 2023
@Nikhil-Vats
Copy link
Contributor

Working on the PR now and will have it ready for review tonight.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Sep 30, 2023
@melvin-bot melvin-bot bot changed the title [$500] Web - Focus outline for checkbox not aligned with border in TaskView [HOLD for payment 2023-10-12] [$500] Web - Focus outline for checkbox not aligned with border in TaskView Oct 5, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.77-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-10-12. 🎊

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

For reference, here are some details about the assignees on this issue:

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
Copy link

melvin-bot bot commented Oct 5, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@jjcoffee] The PR that introduced the bug has been identified. Link to the PR:
  • [@jjcoffee] 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:
  • [@jjcoffee] A discussion in #expensify-bugs 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:
  • [@jjcoffee] Determine if we should create a regression test for this bug.
  • [@jjcoffee] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 11, 2023
@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: N/A root cause has existed since the beginning
  • 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: N/A
  • A discussion in #expensify-bugs 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: N/A
  • Determine if we should create a regression test for this bug. No - too low impact
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

@jjcoffee
Copy link
Contributor

@sonialiap Checklist complete!

@melvin-bot melvin-bot bot added the Overdue label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

@deetergp, @sonialiap, @jjcoffee, @Nikhil-Vats Whoops! This issue is 2 days overdue. Let's get this updated quick!

@sonialiap
Copy link
Contributor

sonialiap commented Oct 17, 2023

@jjcoffee review + bonus = $750 - paid ✔️
@Nikhil-Vats report + fix + bonus = $800 - offer sent

@melvin-bot melvin-bot bot removed the Overdue label Oct 17, 2023
@sonialiap sonialiap added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Oct 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@Expensify Expensify deleted a comment from melvin-bot bot Oct 17, 2023
@sonialiap
Copy link
Contributor

I'm OOO Oct 16-23. Adding leave buddy

@jliexpensify Requires payment once offers are accepted. Can be closed once paid https://www.upwork.com/ab/applicants/1704525429405278208/hired

@jjcoffee
Copy link
Contributor

@jliexpensify Offer accepted!

@sonialiap
Copy link
Contributor

I've issued payment to Joel ✔️

@Nikhil-Vats
Copy link
Contributor

@sonialiap @jliexpensify I have accepted the offer.

@jliexpensify
Copy link
Contributor

Paid and job closed!

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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants