feat(input-opt): add input OTP masking options on parent, group and slot#1244
Open
liam-langstaff wants to merge 4 commits intospartan-ng:mainfrom
Open
feat(input-opt): add input OTP masking options on parent, group and slot#1244liam-langstaff wants to merge 4 commits intospartan-ng:mainfrom
liam-langstaff wants to merge 4 commits intospartan-ng:mainfrom
Conversation
86e7f70 to
e0c18c6
Compare
liam-langstaff
commented
Mar 3, 2026
liam-langstaff
commented
Mar 3, 2026
liam-langstaff
commented
Mar 3, 2026
Greptile SummaryThis PR adds configurable OTP character masking at three levels — root ( Key changes:
Issues found:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["brn-input-otp\n[mask]=true/false (root)"] --> B["div[hlmInputOtpGroup]\n[mask]=true/false/undefined (group)\nHostDirective: BrnInputOtpMask"]
B --> C["hlm-input-otp-slot\n[mask]=true/false/undefined (slot)"]
C --> D["brn-input-otp-slot\n_hasMask computed"]
D --> E{"slot.mask()\n!= undefined?"}
E -- Yes --> F["Use slot mask"]
E -- No --> G{"groupMask?.mask()\n!= undefined?"}
G -- Yes --> H["Use group mask"]
G -- No --> I["Use root mask\n(brn-input-otp.mask)"]
F --> J["MaskValuePipe\ntransform(char, hasMask, 200ms)"]
H --> J
I --> J
J --> K{"mask=false\nor char falsy?"}
K -- Yes --> L["Render raw char"]
K -- No --> M{"New char\nor mask toggled on?"}
M -- Yes --> N["Show char briefly\nstart 200ms timer"]
N --> O["Timer fires → _shouldMaskNow=true\nCDR.markForCheck()"]
O --> P["Render ✱ (U+2217)"]
M -- No --> Q{"_shouldMaskNow?"}
Q -- Yes --> P
Q -- No --> L
Last reviewed commit: 2c10352 |
apps/app/src/app/pages/(components)/components/(input-otp)/input-otp--mask.example.ts
Show resolved
Hide resolved
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.
PR Checklist
Please check if your PR fulfills the following requirements:
guidelines: https://github.com/spartan-ng/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
PR Type
What kind of change does this PR introduce?
Which package are you modifying?
Primitives
Others
What is the current behavior?
--
Adds configurable masking for OTP slots across Brain and Helm.
• Introduces OTP character masking with brief reveal-then-mask behavior.
• Adds mask-value pipe and tests to cover masking timing and edge cases.
• Adds BrnInputOtpMask directive for group-level masking control.
• Wires group masking into Helm via hlmInputOtpGroup host directive.
• Supports per-slot [mask] overrides in hlm-input-otp-slot.
• Defines mask precedence as: slot mask -> group mask -> root brn-input-otp mask.
• Keeps existing behavior unchanged when masking is not enabled.
Does this PR introduce a breaking change?
Other information
masked_input_otp.mp4