feat: add the party id input component - #77
Open
gabitoesmiapodo wants to merge 11 commits into
Open
Conversation
Identifier and ExplorerLink both declared and forwarded a ref no consumer passes. Adding it back later is non-breaking; keeping it published is a contract we would owe forever for a case nothing has needed yet.
…ponents, hooks and docs
detectEntity classified on a bare '::' check, so a half-typed id linked to a party page that cannot exist. It now uses the same validator the input does.
- Blur reports the reason it starts flagging, so the caller can render a message for the state the field just painted. - A consumer-supplied aria-invalid wins, for errors the kit cannot know about; the demo uses it for a grant to your own party. - Blur trims the whitespace a paste brings, rather than calling it a bad fingerprint. - The invalid state is applied and asserted through anatomy.states. - Corrects the theme comment: flagging goes live from the first blur.
The rule covered how to take a ref but not whether to publish one, which is the decision the kit components actually made.
4 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.
Closes #8
Note: this merges into #74 so review that one first.
Summary
A dApp had no way to let a user enter a Canton party id, so every form rolled its own shape check.
Changes
PartyIdInputreports every change and its validation error to the calleraria-invalidfrom the first blur onward, never while first typingvalidatePartyIdandisValidPartyIdare exported so a form can gate submit on the same checkDeviations
Against the issue's requirements
<Identifier>still owns formatted displayTextInputprimitive exists in the kit, so the field renders a plain<input>; the issue's note assumed one that was never builtRode along with the work
refprop fromIdentifierandExplorerLink, never consumed by anyonescripts/add-component.mjs, a component scaffolder written while making this oneAcceptance criteria
Test plan
Automated tests
pnpm installfrom the repo rootpnpm -C canton-dappbooster testpnpm lintandpnpm typecheckfrom the root and expect no errorsManual verification
pnpm run app:devnicointo Receiver party id, then click elsewherehint::fingerprintid with a leading space, then click elsewhereBreaking changes
IdentifierandExplorerLinkno longer accept arefprop.Nothing in this repo passed one; a consumer that does should drop it or request it back.
Checklist
Screenshots