Skip to content

Add independent reveal buttons for QR codes in Settings#197

Merged
StephaneDelcroix merged 1 commit intomainfrom
fix/this-blur-the-qrcode-the-qrcode-should-h-20260223-1521
Feb 23, 2026
Merged

Add independent reveal buttons for QR codes in Settings#197
StephaneDelcroix merged 1 commit intomainfrom
fix/this-blur-the-qrcode-the-qrcode-should-h-20260223-1521

Conversation

@StephaneDelcroix
Copy link
Collaborator

Problem

The QR code blur state was coupled to the token's showToken toggle. Users had to reveal the access token just to see the QR code, which is a privacy concern (the token is more sensitive than the QR code).

Fix

  • Added independent showQrCode and showDirectQrCode boolean fields
  • Added eye-icon reveal/hide buttons next to each QR code (DevTunnel and Direct Sharing), matching the existing UX pattern used for the access token
  • QR code blur is now controlled independently from token blur

Changes

  • Settings.razor: Added reveal buttons next to QR codes, using separate state booleans
  • Settings.razor.css: Added .qr-reveal-btn styling

The QR code blur was tied to the token's showToken toggle, so the only
way to unblur a QR code was to reveal the token first. Now each QR code
(DevTunnel and Direct Sharing) has its own eye-icon reveal button and
independent state (showQrCode / showDirectQrCode), matching the UX
pattern already used for the access token.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@StephaneDelcroix StephaneDelcroix merged commit efa4260 into main Feb 23, 2026
@StephaneDelcroix StephaneDelcroix deleted the fix/this-blur-the-qrcode-the-qrcode-should-h-20260223-1521 branch February 23, 2026 15:24
PureWeen added a commit that referenced this pull request Feb 23, 2026
…wQrCode/showDirectQrCode)

PR #194 introduced QR blur using showToken, but PR #197 subsequently
replaced that with independent showQrCode/showDirectQrCode variables and
dedicated qr-reveal-btn buttons. The tests were left asserting the old
showToken-based behaviour, causing them to fail against current main.

- Update QrCodeImages_UseBlurredClassFromShowTokenToggle to match the
  two independent variables (showQrCode, showDirectQrCode) with specific
  patterns per img src, replacing the fragile count-based regex check
- Update TokenValue_UsesBlurredClassFromShowTokenToggle to assert the
  blur expression is specifically on the token-value element (not just
  anywhere in the file), preventing false positives from QR img tags
- Extend ShowToken_DefaultsFalse to also verify showQrCode and
  showDirectQrCode default to false
- Fix settings-qr-code-blur scenario: click .qr-code .qr-reveal-btn
  (not .tunnel-token .copy-btn) and assert QR+token are independent

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Feb 23, 2026
…low-up to #194) (#199)

## Problem
PR #194 introduced QR code blur using `showToken`. PR #197 subsequently
replaced that with independent `showQrCode`/`showDirectQrCode` variables
and dedicated `qr-reveal-btn` buttons. The tests added in #194 were left
asserting the old `showToken`-based behaviour, causing them to fail
against current `main`.

## Fixes
- **`QrCodeImages_UseBlurredClassFromShowTokenToggle`** → renamed to
`QrCodeImages_UseBlurredClassFromIndependentQrToggles`: replaces the
count-based regex with two specific patterns matching `showQrCode` and
`showDirectQrCode` per their respective `src` attributes
- **`TokenValue_UsesBlurredClassFromShowTokenToggle`**: changed from
`Assert.Contains` anywhere in the file to `Assert.Matches` scoped to the
`token-value` element — prevents false positives now that QR `<img>`
tags also contain blur expressions
- **`ShowToken_DefaultsFalse`**: extended to also assert `showQrCode`
and `showDirectQrCode` default to false
- **`settings-qr-code-blur` scenario**: updated to click `.qr-code
.qr-reveal-btn` (not `.tunnel-token .copy-btn`) and to verify QR and
token toggles are independent (QR revealed, token still blurred)

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant