Skip to content

[HOLD for payment 2023-10-12] [$500] Web - Focus outline for checkbox not aligned with border in TaskView #27872

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com 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

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 20, 2023
  2. 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[/+] on Sep 20, 2023
  3. melvin-bot commented on Sep 20, 2023

    @melvin-bot

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

  4. melvin-bot commented on Sep 20, 2023

    @melvin-bot
  5. melvin-bot commented on Sep 20, 2023

    @melvin-bot

    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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 20, 2023
  7. melvin-bot commented on Sep 20, 2023

    @melvin-bot

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

  8. melvin-bot commented on Sep 20, 2023

    @melvin-bot

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

  9. kbecciv commented on Sep 20, 2023

    @kbecciv
    Author

    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

  10. Nikhil-Vats commented on Sep 20, 2023

    @Nikhil-Vats
    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
  11. 29 remaining items

  12. melvin-bot commented on Oct 16, 2023

    @melvin-bot

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

  13. sonialiap commented on Oct 17, 2023

    @sonialiap
    Contributor

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

  14. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 17, 2023
  15. melvin-bot commented on Oct 17, 2023

    @melvin-bot

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

  16. deleted a comment from melvin-bot on Oct 17, 2023
  17. sonialiap commented on Oct 17, 2023

    @sonialiap
    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

  18. jjcoffee commented on Oct 17, 2023

    @jjcoffee
    Contributor

    @jliexpensify Offer accepted!

  19. sonialiap commented on Oct 17, 2023

    @sonialiap
    Contributor

    I've issued payment to Joel ✔️

  20. Nikhil-Vats commented on Oct 17, 2023

    @Nikhil-Vats
    Contributor

    @sonialiap @jliexpensify I have accepted the offer.

  21. jliexpensify commented on Oct 17, 2023

    @jliexpensify
    Contributor

    Paid and job closed!

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions