You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for Payment Dec 19th] [$125] Share code - Profile initial inside the QR code is misaligned #74794
Version Number: 9.2.48-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: N/A Email or phone of affected tester (no customers):applausetester+bm951@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Web, mweb App Component: Workspace Settings
In the steps described in the OP, the issue only occurs when: You open the QR code from the Workspace Overview page, and then navigate to the Admin page and open the QR code.
When you open the QR code in the Workspace Overview and then again in the Admin page, then the HTML document containing twoSvg with the same ClipPath ID.
And duplicate IDs lead to unpredictable behavior, especially when elements are referenced using clipPath="url(#clip-logo-background)". (in this case, the reference points to the logo from the Workspace Overview page instead of the correct one.)
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
Since react-native-qrcode-svg supports all React versions (including those before React 18), and useId() is only available in React 18+, we can:
Implement a custom useUniqueId hook
let idCounter = 0;
function useId() {
// If React provides useId (React 18+), use it — stable and SSR-friendly.
// The existence of React.useId is stable across renders, so calling this conditionally is safe.
if (typeof React.useId === 'function') {
const nativeId = React.useId();
return nativeId;
}
return idCounter++; // Alternatively, we can use Math.random()
}
or generate a unique ID by combining values such as the QR value and size.
changed the title [-]Share code - Profile initial inside the QR code is misaligned[/-][+][$125] Share code - Profile initial inside the QR code is misaligned[/+]on Nov 14, 2025
Activity
melvin-bot commentedon Nov 11, 2025
Triggered auto assignment to @trjExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.dmkt9 commentedon Nov 11, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The profile initial inside the QR code appears misaligned/off-center
What is the root cause of that problem?
The
svgLogoused on the detail profile page is currently using alogoRatioof0.25(CONST.QR.DEFAULT_LOGO_SIZE_RATIO):App/src/pages/ShareCodePage.tsx
Line 137 in c51a657
What changes do you think we should make in order to solve the problem?
For the
svgLogo, we should useCONST.QR.EXPENSIFY_LOGO_SIZE_RATIOinstead.App/src/pages/ShareCodePage.tsx
Line 137 in c51a657
logoRatio={logo === expensifyLogo || svgLogo ? CONST.QR.EXPENSIFY_LOGO_SIZE_RATIO : CONST.QR.DEFAULT_LOGO_SIZE_RATIO}What alternative solutions did you explore? (Optional)
N/A
linhvovan29546 commentedon Nov 12, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The profile initial inside the QR code appears misaligned/off-center
What is the root cause of that problem?
We use react-native-qrcode-svg to render the QR code here:
App/src/components/QRCode.tsx
Lines 76 to 88 in 82a45ab
In the steps described in the OP, the issue only occurs when: You open the QR code from the
Workspace Overviewpage, and then navigate to theAdminpage and open the QR code.The problem happens specifically in this flow because
react-native-qrcode-svguses a global ID for theClipPath.https://github.com/Expensify/react-native-qrcode-svg/blob/a8ffa82b7f4baca838096547c466f41adac49e8a/src/index.js#L35
https://github.com/Expensify/react-native-qrcode-svg/blob/a8ffa82b7f4baca838096547c466f41adac49e8a/src/index.js#L43
When you open the QR code in the Workspace Overview and then again in the Admin page, then the HTML document containing two
Svgwith the same ClipPath ID.And duplicate IDs lead to unpredictable behavior, especially when elements are referenced using
clipPath="url(#clip-logo-background)". (in this case, the reference points to the logo from the Workspace Overview page instead of the correct one.)What changes do you think we should make in order to solve the problem?
We should make the ClipPath ID unique for each QR code instance.
We can achieve this is by using React’s built-in
useId()hook to generate unique IDs and pass them to the ClipPath and its url reference.https://github.com/Expensify/react-native-qrcode-svg/blob/a8ffa82b7f4baca838096547c466f41adac49e8a/src/index.js#L31
What alternative solutions did you explore? (Optional)
Since
react-native-qrcode-svgsupports all React versions (including those before React 18), and useId() is only available in React 18+, we can:Implement a custom useUniqueId hook
or generate a unique ID by combining values such as the QR value and size.
[-]Share code - Profile initial inside the QR code is misaligned[/-][+][$125] Share code - Profile initial inside the QR code is misaligned[/+]melvin-bot commentedon Nov 14, 2025
melvin-bot commentedon Nov 14, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021989365886944342466
44 remaining items
melvin-bot commentedon Dec 27, 2025
@trjExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
linhvovan29546 commentedon Dec 29, 2025
@trjExpensify Sobit Neupane OOO until January 10th
melvin-bot commentedon Jan 1, 2026
@trjExpensify Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
MarioExpensify commentedon Jan 2, 2026
@trjExpensify in this case, should we wait for @sobitneupane to come back?
trjExpensify commentedon Jan 5, 2026
Yeah, usually... but it's a minor misalignment issue, so I'm just going to proceed.
Closing!
garrettmknight commentedon Mar 16, 2026
$125 approved for @sobitneupane