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

feat: Add opacity overlay in Scan screen but keep the scan window transparent and clear #1420

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jian4on
Copy link
Contributor

@jian4on jian4on commented Jan 30, 2025

Summary of Changes

Add opacity overlay in Scan screen upon the 'ScanCamera' zone but keep the scan window clear, so that the textual contents upon the camera video could be recognized even users scan a bright background. And the clear scan window also improve the experience for QR scan alignment

Screenshots, videos, or gifs

The background image in the screenshot is only for testing, it doesn't exist in real usage.

Breaking change guide

N/A

Related Issues

N/A

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this)
  • If applicable, screenshots, gifs, or video are included for UI changes
  • If applicable, breaking changes are described above along with how to address them
  • Updated documentation as needed for changed code and new or modified features
  • Added sufficient tests so that overall code coverage is not reduced

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

  • Read our contribution guide at least once; it will save you a few review cycles!
  • Your PR will likely not be reviewed until all the above boxes are checked and all automated checks have passed

@jian4on jian4on requested a review from a team as a code owner January 30, 2025 15:51
@jian4on
Copy link
Contributor Author

jian4on commented Jan 30, 2025

Simulator Screenshot - iPhone 16 - 2025-01-29 at 23 32 10

@jian4on
Copy link
Contributor Author

jian4on commented Jan 30, 2025

The Sonar scan failed for some reason not reasonable, I think we can make an exception for this file. The clear window needs some views nesting and some tricky styles, maybe Sonar not happy with this.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Contributor

@bryce-mcmath bryce-mcmath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple things to fix, but also some extra context and feedback:

The reason SonarCloud is griping about the duplication is that there is another component called NewQRView which is very similar but has many additional features and alterations. To see this other component, enable Connection Inviter Capability via developer settings and then reopen the scan screen.

The two components will eventually be merged into one and not gated behind developer mode. In the meantime we can manually dismiss the SonarCloud check on a per-PR basis, but I don't think we should add an exception into our SC config.

The change from this PR should probably be made in both components as well

Comment on lines +36 to +37
marginTop: -90,
borderWidth: 320,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's best to avoid using pixel values for positioning wherever possible. Pixel values can be very brittle and have unforeseen affects across different devices, causing inconsistent UIs. Could we try to make the same change using flexbox?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are too many things need to be discussed, especially the NewQRView component. I pull it to draft and bring the feedbacks to team, thanks.

},
messageContainer: {
zIndex: 999,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing zIndex should also be avoided. It affects iOS and Android differently, and the more zIndex changes in the codebase the more likely we are to run into unexpected UI appearance and styling difficulty. In this specific case, I don't see any effect of the zIndex that couldn't be achieved with just altering the order of JSX elements.

bottomContainer: {
position: 'absolute',
width: '100%',
bottom: 60,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as first comment above

@jian4on jian4on marked this pull request as draft February 3, 2025 19:09
@bryce-mcmath
Copy link
Contributor

@jian4on I brought this up with the rest of the BC team, and we'd like to merge the two components into one but still allow for the two variations. So the change would be making two components into one that is configured based on that connection inviter capability. In other words, there would be no change to the UI for folks using either option, but there would be less duplication. Let me know if that works for you. If it does I will tackle it ASAP so you can finish the work in this PR. 🤝

@timbl-ont
Copy link
Contributor

@bryce-mcmath That makes sense to do first before this PR is completed. I have not had a chance to look at the new connection inviter. Will it impact the OID4VC connection logic?

@bryce-mcmath
Copy link
Contributor

@bryce-mcmath That makes sense to do first before this PR is completed. I have not had a chance to look at the new connection inviter. Will it impact the OID4VC connection logic?

It won't. Both components only affect UI on the scan screen, all the actual connection logic is passed through them by the same function (handleCodeScan)

@bryce-mcmath
Copy link
Contributor

bryce-mcmath commented Feb 6, 2025

@bryce-mcmath That makes sense to do first before this PR is completed. I have not had a chance to look at the new connection inviter. Will it impact the OID4VC connection logic?

@timbl-ont It won't. Both components only affect UI on the scan screen, all the actual connection logic is passed through them by the same function (handleCodeScan)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants