Skip to content

fix(admin): let the PIN gate be cancelled instead of trapping the user - #167

Merged
jherforth merged 1 commit into
jherforth:mainfrom
mrramam:fix/admin-pin-cancel
Sep 14, 2026
Merged

jherforth merged 1 commit into
jherforth:mainfrom
mrramam:fix/admin-pin-cancel

Conversation

@mrramam

@mrramam mrramam commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Opening Admin on a device that needs the PIN gives a modal whose Cancel button does nothing. Escape does nothing. Clicking the backdrop does nothing. The only way out is to reload the page. This fixes that

Cancel, Escape and a backdrop click all route to handlePinModalClose, which
returned without acting whenever the panel was unauthenticated. That is every
time the gate is shown, so all three did nothing.

There is no other way out. The gate renders in place of the whole panel, and
PinModal is a nested Dialog whose backdrop covers the containing dialog's close
button; Escape only reaches the topmost modal, which is the one with the inert
handler. The user has to reload the page.

The early return reads as protection against revealing the panel un-authenticated,
but the unauthenticated branch renders only the modal, so there is nothing behind
it to protect. Cancelling now closes Admin and returns to the dashboard.

The same shape applied to the set-PIN flow: with no PIN configured, opening Set
Admin PIN and cancelling hit the mode === 'set' && !pinExists guard and trapped
the user identically. Nothing forces that flow — it starts from a button — so the
guard is removed and cancelling returns to the panel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jherforth jherforth added the bug Something isn't working label Sep 14, 2026
@jherforth jherforth added this to the 1.9 milestone Sep 14, 2026
@jherforth
jherforth merged commit b866dcf into jherforth:main Sep 14, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in HomeGlow Kanban Sep 14, 2026
@mrramam
mrramam deleted the fix/admin-pin-cancel branch September 14, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants