Skip to content

Conversation

@jrainville
Copy link
Member

What does the PR do

Fixes #19677

Adds a placeholder button to open a QR code scanner dialog. The dialog itself follows the design, though it might be outdated.

Affected areas

  • Renames StatusSyncCodeScanner to StatusQRCodeScanner as it was already generic, it just had a name that was specific. I renamed the signals and props too.
  • New QRCodeScannerDialog component plus Storybook page
  • Adds it to Popups

Architecture compliance

Screencapture of the functionality

User profile URL:

user-url.webm

Address:

address-scan.webm

Random URL:

random-site.webm

Impact on end user

Adds a useful feature, especially on mobile

How to test

  • Click the QR scan button and show a QR code

Risk

Low. Worst case it doesn't scan well

@jrainville jrainville force-pushed the feat/qr-code-scanner-placeholder branch from 291d932 to ef78327 Compare January 8, 2026 21:16
Fixes #19677

Adds a placeholder button to open a QR code scanner dialog. The dialog itself follows the design, though it might be outdated.
@jrainville jrainville force-pushed the feat/qr-code-scanner-placeholder branch from ef78327 to 19660fb Compare January 8, 2026 21:26
@status-im-auto
Copy link
Member

status-im-auto commented Jan 8, 2026

Jenkins Builds

Click to see older builds (13)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ fdd15a4e #3 2026-01-08 21:35:05 ~8 min android/arm64 🤖apk 📲
✔️ 19660fb #3 2026-01-08 21:37:42 ~11 min ios/aarch64 📱ipa 📲
✔️ 19660fb #3 2026-01-08 21:38:18 ~11 min tests/nim 📄log
✔️ 19660fb #3 2026-01-08 21:41:29 ~15 min macos/aarch64-nwaku 🍎dmg
✔️ 19660fb #3 2026-01-08 21:41:53 ~15 min tests/ui 📄log
✔️ 19660fb #3 2026-01-08 21:43:00 ~16 min macos/aarch64 🍎dmg
✔️ 19660fb #3 2026-01-08 21:47:27 ~21 min linux/x86_64 📦tgz
✔️ 19660fb #3 2026-01-08 21:47:35 ~21 min linux/x86_64-nwaku 📦tgz
✔️ 19660fb #3 2026-01-08 21:52:37 ~26 min windows/x86_64 💿exe
✔️ 19660fb pr19679 2026-01-08 22:03:48 ~16 min tests/e2e 📊rpt
✖️ 19660fb PR19679 2026-01-08 22:12:39 ~19 min tests/e2e-windows 📊rpt
✔️ db7b3b6d #4 2026-01-09 05:31:05 ~12 min android/arm64 🤖apk 📲
d8ff36a0 #6 2026-01-09 16:10:29 ~9 min android/arm64 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 7cc1bcd #5 2026-01-09 16:12:21 ~11 min tests/nim 📄log
✔️ 7cc1bcd #5 2026-01-09 16:15:44 ~15 min ios/aarch64 📱ipa 📲
✔️ 7cc1bcd #5 2026-01-09 16:16:13 ~15 min macos/aarch64 🍎dmg
✔️ 7cc1bcd #5 2026-01-09 16:16:21 ~15 min tests/ui 📄log
✔️ 7cc1bcd #5 2026-01-09 16:20:04 ~19 min macos/aarch64-nwaku 🍎dmg
✔️ 7cc1bcd #5 2026-01-09 16:20:16 ~19 min linux/x86_64 📦tgz
✔️ 7cc1bcd #5 2026-01-09 16:21:43 ~20 min linux/x86_64-nwaku 📦tgz
✔️ 7cc1bcd #5 2026-01-09 16:34:52 ~33 min windows/x86_64 💿exe
✔️ 7cc1bcd pr19679 2026-01-09 16:36:52 ~16 min tests/e2e 📊rpt
✖️ 7cc1bcd PR19679 2026-01-09 16:56:43 ~21 min tests/e2e-windows 📊rpt
✔️ 8b43cee2 #7 2026-01-10 05:31:28 ~13 min android/arm64 🤖apk 📲

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM overall, some suggestions to make the new component more flexible

property alias cameraWidth: cameraLoader.width

signal connectionStringFound(connectionString: string)
signal validTagFound(tag: string)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
signal validTagFound(tag: string)
signal validTagFound(string tag)

Better follow the usual signal signature pattern; eventhough it seems the extended JS syntax is also supported here


StatusBaseText {
visible: d.showCamera && cameraLoader.item.currentTag ? true : false
visible: d.showCamera && !!d.errorMessage
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
visible: d.showCamera && !!d.errorMessage
visible: d.showCamera && !!text

errorMessage: qsTr("Status doesn't understand the QR code.")
validate: function (tag) {
// We accept URLs and addresses
return Utils.isURL(tag) || Utils.isValidAddress(tag)
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to pass this validator function from the outside? For better flexibility

Copy link
Member Author

Choose a reason for hiding this comment

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

This component is meant to be the one meant to be used to scan addresses and URLs by the user, so it's not meant to be generic. The generic scanner is StatusQRCodeScanner and it already has an outside validator.

I think putting the logic in this component makes sense, because it is its own area of concern.

id: d

property string validTag: ""
property bool validTagFound: false
Copy link
Member

Choose a reason for hiding this comment

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

The boolean redundant? If validTag !== "" then we know we found something :)

if (Utils.isURL(d.validTag)) {
root.urlScanned(d.validTag)
} else if (Utils.isValidAddress(d.validTag)) {
root.addressScanned(d.validTag)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, maybe the external validator function wouldn't work here with the dedicated signals approach... what about having a toplevel enum for the recognized/supported tag types (easy to extend) and a signal tagFound(int tagType, string tag); wdyt?


footer: Item {
visible: false
}
Copy link
Member

Choose a reason for hiding this comment

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

Uhm, what's the purpose of this? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

To hide the footer 🫣

I don't know what's the clean way to do that

Copy link
Member

Choose a reason for hiding this comment

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

Hmm... footer: null? ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, it was that simple 🤦

@jrainville
Copy link
Member Author

Thanks for the review @caybro . I addressed your comments

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why, but it seems like I broke the translations here @caybro

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.

Placeholder QR Code Scanner

3 participants