Repository navigation
fix(web): keep focus on pending device authorization actions - #46701
Merged
Merged
Conversation
The Approve and Deny buttons used the native disabled attribute while a request was pending, so the browser moved focus to <body> and a keyboard user could not retry after a failure. Pass the pending state as loading, which keeps the button focusable with aria-disabled and still blocks activation, and cover the focus-through-failure path in the browser spec.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #46701 +/- ##
=======================================
Coverage 90.26% 90.26%
=======================================
Files 6452 6452
Lines 407038 407038
Branches 81756 81756
=======================================
+ Hits 367409 367421 +12
+ Misses 33226 33214 -12
Partials 6403 6403
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
lyzno1
approved these changes
Nov 18, 2026
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #46700.
Problem
On the device authorization page, Approve and Deny used the native
disabledattribute whilebusy. When the focused Approve button becomes natively disabled, Chromium moves focus to<body>; after a failed request, pressing Enter no longer activates the action and the user must tab back to it. The SSO branch of the same page had the same bug on its Approve action.Fix
Pass the pending state to the Dify UI button's
loadingprop instead ofdisabled, as the button contract prescribes: activation is blocked, the button stays in the tab order witharia-disabled, focus is retained, and the decorative spinner shows. The label text is unchanged. Both account actions and the SSO Approve action use the same pending state.Test
New browser cases in
authorize-account.browser.spec.tsxandauthorize-sso.browser.spec.tsx:aria-disabled="true"whiledocument.activeElementis still the button;The SSO case follows the same steps on its own component.
Both new cases fail on the parent commit (focus lands on
<body>while pending) and pass with the change; each spec file reports 4 passed.vp check --no-lint(format + type check) andvp lintare clean on the changed files.This was prepared by an AI agent (Claude Code) operating the BlueX888 GitHub account; the account owner takes responsibility for the submission.
From Claude Code