Skip to content

[$1000] The cursor is displayed as pointer on the archived room banner text #13452

Closed

Description

@kavimuru

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Actions Performed:

  1. Go to any archived room
  2. Hover over the “This chat room has been archived.” text

Expected Result:

Standard cursor is displayed as the text is not pressable

Actual Result:

Pointer/hand cursor is displayed

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Web

Version Number: 1.2.37-0
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

Recording.1073.mp4
Screen.Recording.2022-12-08.at.9.42.08.PM.mov

Expensify/Expensify Issue URL:
Issue reported by: @adeel0202
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1670521824762439

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01776d53155c170045
  • Upwork Job ID: 1601274785687920640
  • Last Price Increase: 2022-12-12

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 9, 2022
  2. melvin-bot commented on Dec 9, 2022

    @melvin-bot

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

  3. syedsaroshfarrukhdot commented on Dec 9, 2022

    @syedsaroshfarrukhdot
    Contributor

    Proposal :-

    We need to pass pointerEventsNone to text

    diff --git a/src/components/Banner.js b/src/components/Banner.js
    index 3b5a8d66e..6e7558eb8 100644
    --- a/src/components/Banner.js
    +++ b/src/components/Banner.js
    @@ -12,6 +12,7 @@ import * as StyleUtils from '../styles/StyleUtils';
     import getButtonState from '../libs/getButtonState';
     import Tooltip from './Tooltip';
     import withLocalize, {withLocalizePropTypes} from './withLocalize';
    +import pointerEventsNone from '../styles/pointerEventsNone';
     
     const propTypes = {
         /** Text to display in the banner. */
    @@ -76,7 +77,7 @@ const Banner = props => (
                         {
                             props.shouldRenderHTML
                                 ? <RenderHTML html={props.text} />
    -                            : <Text style={[...props.textStyles]} onPress={props.onPress}>{props.text}</Text>
    +                            : <Text style={[...props.textStyles, pointerEventsNone]} onPress={props.onPress}>{props.text}</Text>
                         }

    After Fix:-

    Screen.Recording.2022-12-09.at.5.46.42.AM.mov
  4. adeel0202 commented on Dec 9, 2022

    @adeel0202
    Contributor

    I reported this bug and proposed the solution on slack. Posting it here too.

    Proposal

    Inside the Banner.js component, onPress is added to the Text component on line 79, which makes this text pressable. I don't think that onPress is being used or needed there, so removing that will fix this issue.

    -  <Text style={[...props.textStyles]} onPress={props.onPress}>{props.text}</Text>
    +  <Text style={[...props.textStyles]}>{props.text}</Text>

    Result

    cursor.result.mov
  5. syedsaroshfarrukhdot commented on Dec 9, 2022

    @syedsaroshfarrukhdot
    Contributor

    Update Proposal

    As we need onPress In Some Situations We Can Take A New Props isPressable in ArchivedReportFooter to pass in Banner.js

    diff --git a/src/components/ArchivedReportFooter.js b/src/components/ArchivedReportFooter.js
    index c271b0f8c..d05f0441a 100644
    --- a/src/components/ArchivedReportFooter.js
    +++ b/src/components/ArchivedReportFooter.js
    @@ -71,6 +71,7 @@ const ArchivedReportFooter = (props) => {
                 })}
                 shouldRenderHTML={archiveReason !== CONST.REPORT.ARCHIVE_REASON.DEFAULT}
                 shouldShowIcon
    +            isPressable ={archiveReason === CONST.REPORT.ARCHIVE_REASON.DEFAULT}
             />
         );
     };
    
    diff --git a/src/components/Banner.js b/src/components/Banner.js
    index 3b5a8d66e..b6393f1cc 100644
    --- a/src/components/Banner.js
    +++ b/src/components/Banner.js
    @@ -38,6 +38,9 @@ const propTypes = {
         // eslint-disable-next-line react/forbid-prop-types
         textStyles: PropTypes.arrayOf(PropTypes.object),
     
    +    /** Should this component show the pointer? */
    +    isPressable: PropTypes.bool,
    +
         ...withLocalizePropTypes,
     };
     
    @@ -76,6 +79,7 @@ const Banner = props => (
                         {
                             props.shouldRenderHTML
                                 ? <RenderHTML html={props.text} />
    +                            : props.isPressable ? <Text style={[...props.textStyles]}>{props.text}</Text> 
                                 : <Text style={[...props.textStyles]} onPress={props.onPress}>{props.text}</Text>
                         }
                     </View>

    After Fix :-

    Screen.Recording.2022-12-09.at.9.03.54.AM.mov
  6. adeel0202 commented on Dec 9, 2022

    @adeel0202
    Contributor

    Proposal 2

    I don't think we need onPress in the text component as that text component only renders when shouldRenderHTML prop is false and shouldRenderHTML prop is false only when the archiveReason is default i.e. this case.

    However, if we still don't want to remove onPress due to any reason, then we can either use shouldRenderHTML prop to add pressable condition or we can create a separate prop for it i.e. isTextPressable.

    --- a/src/components/ArchivedReportFooter.js
    +++ b/src/components/ArchivedReportFooter.js
    @@ -70,6 +70,7 @@ const ArchivedReportFooter = (props) => {
                     policyName: `<strong>${ReportUtils.getPolicyName(props.report, props.policies)}</strong>`,
                 })}
                 shouldRenderHTML={archiveReason !== CONST.REPORT.ARCHIVE_REASON.DEFAULT}
    +            isTextPressable={archiveReason !== CONST.REPORT.ARCHIVE_REASON.DEFAULT}
                 shouldShowIcon
             />
         );
    --- a/src/components/Banner.js
    +++ b/src/components/Banner.js
    @@ -26,6 +26,9 @@ const propTypes = {
         /** Should this component render the text as HTML? */
         shouldRenderHTML: PropTypes.bool,
     
    +    /** Should the text component be pressable */
    +    isTextPressable: PropTypes.bool,
    +
         /** Callback called when the close button is pressed */
         onClose: PropTypes.func,
     
    @@ -43,6 +46,7 @@ const propTypes = {
     
     const defaultProps = {
         shouldRenderHTML: false,
    +    isTextPressable: true,
         shouldShowIcon: false,
         shouldShowCloseButton: false,
         onClose: () => {},
    @@ -76,7 +80,7 @@ const Banner = props => (
                         {
                             props.shouldRenderHTML
                                 ? <RenderHTML html={props.text} />
    -                            : <Text style={[...props.textStyles]} onPress={props.onPress}>{props.text}</Text>
    +                            : <Text style={[...props.textStyles]} onPress={props.isTextPressable ? props.onPress : undefined}>{props.text}</Text>
                         }
                     </View>
                     {props.shouldShowCloseButton && (
  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 9, 2022
  8. melvin-bot commented on Dec 9, 2022

    @melvin-bot

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

  9. changed the title [-]The cursor is displayed as pointer on the archived room banner text[/-] [+][$1000] The cursor is displayed as pointer on the archived room banner text[/+] on Dec 9, 2022
  10. melvin-bot commented on Dec 9, 2022

    @melvin-bot
  11. melvin-bot commented on Dec 9, 2022

    @melvin-bot

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

  12. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 9, 2022
  13. 38 remaining items

  14. melvin-bot commented on Dec 28, 2022

    @melvin-bot

    @puneetlath, @priyeshshah11, @Santhosh-Sellavel Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  15. JmillsExpensify commented on Dec 28, 2022

    @JmillsExpensify
    Contributor

    @puneetlath You want me to jump in and help move this one forward?

  16. priyeshshah11 commented on Dec 29, 2022

    @priyeshshah11
    Contributor

    @JmillsExpensify @puneetlath This PR was merged within 3 days and was released to production a week ago. I believe it has passed the 7 days so just waiting for the payment to be finalised

  17. priyeshshah11 commented on Jan 2, 2023

    @priyeshshah11
    Contributor

    @JmillsExpensify @puneetlath This PR was merged within 3 days and was released to production a week ago. I believe it has passed the 7 days so just waiting for the payment to be finalised

    @JmillsExpensify @puneetlath any updates on this please?

  18. JmillsExpensify commented on Jan 2, 2023

    @JmillsExpensify
    Contributor

    Just assigned myself to help out. Based on the linked PR, this PR is eligible for a 50% bonus. That means that the following payouts are due:

  19. JmillsExpensify commented on Jan 2, 2023

    @JmillsExpensify
    Contributor

    Based on the above, I've just paid out @priyeshshah11 and @Santhosh-Sellavel. @adeel0202 Contract for reporting has been shared.

  20. JmillsExpensify commented on Jan 2, 2023

    @JmillsExpensify
    Contributor

    Update: All contributors are now paid out! Sorry for the delay.

  21. JmillsExpensify commented on Jan 2, 2023

    @JmillsExpensify
    Contributor

    @puneetlath I don't see a BZ checklist for this one. Mind chiming in on the regression/convo parts of that list?

  22. adeel0202 commented on Jan 2, 2023

    @adeel0202
    Contributor

    Thanks, @JmillsExpensify. Kindly end the contract too.

  23. priyeshshah11 commented on Jan 2, 2023

    @priyeshshah11
    Contributor

    Update: All contributors are now paid out! Sorry for the delay.

    Thanks! 😄 @JmillsExpensify

  24. puneetlath commented on Jan 5, 2023

    @puneetlath
    Contributor
  25. JmillsExpensify commented on Jan 11, 2023

    @JmillsExpensify
    Contributor

    Are we good to close this one out?

  26. puneetlath commented on Jan 11, 2023

    @puneetlath
    Contributor

    Yep!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions