Show a notice when a saved field value was rejected - #21
Open
masnwilliams wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
masnwilliams
marked this pull request as ready for review
August 2, 2026 18:41
masnwilliams
force-pushed
the
hypeship/replace-existing-field-notice
branch
from
August 5, 2026 23:12
7ab0711 to
0a99efa
Compare
masnwilliams
force-pushed
the
hypeship/replace-existing-field-notice
branch
from
August 5, 2026 23:31
0a99efa to
bc63cd6
Compare
Managed-auth fields carry replace_existing when the site rejected the stored credential. Carry it through the canonical projection and render a notice on the field so the user knows a new value is required.
masnwilliams
force-pushed
the
hypeship/replace-existing-field-notice
branch
from
August 5, 2026 23:44
bc63cd6 to
32fd50b
Compare
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.
summary
When a site explicitly rejects a stored credential, the pause records
replace_existingon the field so the user can be told the saved value is no longer usable. Nothing rendered it: the canonical projection dropped the flag, and neither field type declared it, so the form re-rendered as an ordinary empty input with no indication of why it was asked again.changes
replace_existingonManagedAuthFieldandDiscoveredFieldfieldsFromCanonical, which previously copied six keys and stoppedfieldReplaceExistingNoticelabel and theinputReplaceNoticeappearance slotThe notice uses the existing
--kma-color-dangertoken and the same typography as.kma-input-hint; no new design values.ordering
Based on #20, which introduces
fieldsFromCanonical. Review that first; this diff is only the flag.The API side ships in kernel/kernel#3094, which adds
replace_existingto theDiscoveredFieldschema. Until that deploys the flag only arrives on canonicalfields, which this handles; afterwards it arrives on both and both paths render.tests
bun test,bun run typecheck,bun run build, andprettier --checkall pass.Four pure cases in
state.test.ts:falsediscovered_fieldspass the flag through untouched, which is the path that goes live firsttoStrictEqualon the whole projected field, not a subset. The existing tests usetoMatchObject, which is why a dropped key passes unnoticed — this one fails if the projection forgets any property the form rendersThe first and fourth were verified to fail with the
fieldsFromCanonicalline reverted; the legacy and unset cases stay green in both states.Not covered: the render itself. The package has no DOM test setup, so
UnifiedAuthFormhas no test at any level and this change does not add one.Note
Low Risk
UI-only messaging and optional field metadata plumbing in managed-auth-react; no auth or credential handling changes.
Overview
When the backend sets
replace_existingon a field (saved credential rejected by the site), the auth form now shows a danger-styled notice under the input instead of a blank field with no explanation.replace_existingis added toManagedAuthFieldandDiscoveredField, forwarded throughfieldsFromCanonical(which also merges legacyplaceholder/hintby ref), and rendered inUnifiedAuthFormabove the field hint when both apply. Customization usesfieldReplaceExistingNoticeand theinputReplaceNoticeappearance slot; default copy and.kma-input-replace-noticestyling reuse existing danger/hint tokens.state.test.tsadds coverage for canonical, legacy, and full projected field shape so dropped flags are caught.Reviewed by Cursor Bugbot for commit 32fd50b. Bugbot is set up for automated code reviews on this repo. Configure here.