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-09-11] [$1000] Web - Inconsistency bug: Incorrect Hand Cursor Displayed Throughout PDF Document in Attachment Viewer #25796

Closed
1 of 6 tasks
izarutskaya opened this issue Aug 23, 2023 · 32 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

@izarutskaya
Copy link

izarutskaya commented Aug 23, 2023

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 any conversation
  2. Click the plus sign -> Add Attachment and select a pdf file, but do not send it yet
  3. go to the PDF body within the previewer
  4. Notice that the cursor behavior is correct in the previewer, with the hand cursor only displayed when hovering over hyperlinks or interactive elements
  5. Send the attachment
  6. Click the same attachment you sent to open it in the attachment viewer
  7. In the attachment viewer, observe that the hand cursor is displayed throughout the entire PDF document, even in areas where there are no hyperlinks or interactive elements

Expected Result:

The hand cursor should only be displayed when hovering over hyperlinks or other interactive elements within the PDF document, both in the initial attachment previewer and the attachment viewer. When the mouse cursor is not over any interactive element, it should display the default cursor.

Actual Result:

The hand cursor is displayed throughout the entire PDF document in the attachment viewer, unlike the correct behavior observed in the initial attachment previewer.

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: v1.3.56-20

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

PDFcursor.mp4
Recording.1303.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Habben101

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691710745839059

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0103449447ce220c8a
  • Upwork Job ID: 1696237688336969728
  • Last Price Increase: 2023-08-28
  • Automatic offers:
    • namhihi237 | Contributor | 26416157
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 23, 2023
@namhihi237
Copy link
Contributor

namhihi237 commented Aug 23, 2023

Proposal

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

display normal cursor and not clickable when hovering on white space

What is the root cause of that problem?

This issue has been fixed once in here
But after we refactor here it happened again.
Same as before, PDFView inside a PressableWithFeedback incase there's a onPress prop.

render() {
return this.props.onPress ? (
<PressableWithoutFeedback
onPress={this.props.onPress}
style={[styles.flex1, styles.flexRow, styles.alignSelfStretch]}

Here we are passing onPress.
<AttachmentView
source={item.source}
file={item.file}
isAuthTokenRequired={item.isAuthTokenRequired}
isFocused={activeSource === item.source}
onPress={() => canUseTouchScreen && setShouldShowArrows(!shouldShowArrows)}

In the previous fix, we had set the default for onPress to undefined to prevent when using PDFView without passing the onPress prop. But here we always pass a boolean in.

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

We should update in here:

onPress={ canUseTouchScreen ? () => setShouldShowArrows(!shouldShowArrows): undefined}

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 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

@rayane-djouah
Copy link
Contributor

Proposal

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

There's an inconsistency in the cursor behavior when viewing a PDF attachment. The hand cursor is displayed throughout the entire PDF document in the attachment viewer, even when not hovering over hyperlinks or interactive elements.

What is the root cause of that problem?

The cursor behavior for the PDF viewer in the attachment viewer is being influenced by global or inherited CSS styles, causing it to display the hand cursor throughout.

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

To ensure consistent cursor behavior in the attachment viewer, we need to explicitly set the cursor style for the PDF viewer component.
Code Changes:
CSS Adjustments: Set the cursor style for the PDFView component to default to override any inherited styles that might be affecting the cursor behavior.

PDFView: {
    ...
    cursor: 'default',
},

Apply this style in:

App/src/styles/styles.js

Lines 2106 to 2117 in 8d5ae3a

PDFView: {
// `display: grid` is not supported in native platforms!
// It's being used on Web/Desktop only to vertically center short PDFs,
// while preventing the overflow of the top of long PDF files.
display: 'grid',
backgroundColor: themeColors.modalBackground,
width: '100%',
height: '100%',
justifyContent: 'center',
overflow: 'hidden',
alignItems: 'center',
},

Result:

pdfview.mp4

What alternative solutions did you explore? (Optional)

N/A

@kevinksullivan
Copy link
Contributor

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

@kevinksullivan Whoops! This issue is 2 days overdue. Let's get this updated quick!

@kevinksullivan kevinksullivan added the External Added to denote the issue can be worked on by a contributor label Aug 28, 2023
@melvin-bot melvin-bot bot changed the title Web - Inconsistency bug: Incorrect Hand Cursor Displayed Throughout PDF Document in Attachment Viewer [$1000] Web - Inconsistency bug: Incorrect Hand Cursor Displayed Throughout PDF Document in Attachment Viewer Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0103449447ce220c8a

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

melvin-bot bot commented Aug 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

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

@ArekChr
Copy link
Contributor

ArekChr commented Aug 29, 2023

Thanks for the proposals! The proposal from @namhihi237 looks good to me!

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@rayane-djouah
Copy link
Contributor

@ArekChr @srikarparsi I'd like to advocate for my proposal over the other for addressing the cursor inconsistency issue in our PDF attachment viewer. Here's why:

  • Addressing the Root Cause: my proposal tackles the cursor inconsistency directly by adjusting the CSS, providing stability regardless of other codebase changes.
  • Preventing Regression: Given the issue's recurrence history,

This issue has been fixed once in #23976
But after we refactor here it happened again.

a CSS-centric solution, as in my proposal, diminishes chances of future regression.

  • Simplicity in Solution: By opting for a CSS-based approach, we benefit from a clear and maintainable fix. The other proposal, relying on conditional logic, might be more prone to future changes and potential fragility.
  • Consistency without Logic Dependency: The CSS fix ensures consistent cursor behavior without being tied to other conditional logics.
  • Future-Proofing: Focusing on the CSS ensures that our solution stays consistent, even with future feature updates or changes to the PDF viewer component.

In light of the above points and considering the issue's regression history, I believe that my proposal offers a more robust and long-term solution. Looking forward to your thoughts!

@namhihi237
Copy link
Contributor

@rayane-djouah I guess you haven't tested the case of image preview and protected pdf. Your solution does not cover this.

@rayane-djouah
Copy link
Contributor

It works perfectly with this cases.
here is a video:

27.New.Expensify.-.Google.Chrome.2023-08-29.12-49-36.mp4

@namhihi237
Copy link
Contributor

  • For image, you can hover on white space not in image
  • For protected pdf hover on here
Screenshot 2023-08-29 at 18 57 54

@namhihi237
Copy link
Contributor

Videos with your solution

Screen.Recording.2023-08-29.at.18.59.26.mov

@srikarparsi
Copy link
Contributor

Thanks @ArekChr! @namhihi237's proposal looks good to me as well.

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

melvin-bot bot commented Aug 30, 2023

📣 @namhihi237 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Aug 30, 2023
@namhihi237
Copy link
Contributor

@ArekChr @srikarparsi The PR is already for review. But I am not sure why PR does not assign anyone

@namhihi237
Copy link
Contributor

Ah, PR has been assigned for review

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

🎯 ⚡️ Woah @ArekChr / @namhihi237, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @namhihi237 got assigned: 2023-08-30 17:03:20 Z
  • when the PR got merged: 2023-09-01 04:27:42 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 4, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Inconsistency bug: Incorrect Hand Cursor Displayed Throughout PDF Document in Attachment Viewer [HOLD for payment 2023-09-11] [$1000] Web - Inconsistency bug: Incorrect Hand Cursor Displayed Throughout PDF Document in Attachment Viewer Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.62-4 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-09-11. 🎊

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 Sep 4, 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:

  • [@ArekChr] The PR that introduced the bug has been identified. Link to the PR:
  • [@ArekChr] 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:
  • [@ArekChr] 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:
  • [@ArekChr] Determine if we should create a regression test for this bug.
  • [@ArekChr] 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.
  • [@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@ArekChr
Copy link
Contributor

ArekChr commented Sep 5, 2023

Regression test proposal

  1. Go to any conversation with a PDF attachment.
  2. Open the attachment preview.
  3. Ensure that cursor behaviour is not hand cursor when hovering different elements than hyperlinks.

Do we agree 👍 or 👎

@kevinksullivan
Copy link
Contributor

Waiting on payment

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 Daily KSv2 labels Sep 11, 2023
@namhihi237
Copy link
Contributor

@kevinksullivan Any update payment. Thanks.

@melvin-bot melvin-bot bot removed the Overdue label Sep 14, 2023
@kevinksullivan
Copy link
Contributor

Paid and closed!

@Habben101
Copy link

@kevinksullivan, I'm the reporter of the bug, and I already applied for the job on Upwork, but haven't heard from anyone since then.

@kevinksullivan
Copy link
Contributor

Ah my apologies @Habben101 . Offer sent! Lmk when you accept and I'll get that paid.

@Habben101
Copy link

No worries and Thanks @kevinksullivan. I've accepted the offer.

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

7 participants