Skip to content

feat(davinci-client): support single checkbox component#629

Merged
ancheetah merged 2 commits into
mainfrom
SDKS-4926-single-checkbox
May 19, 2026
Merged

feat(davinci-client): support single checkbox component#629
ancheetah merged 2 commits into
mainfrom
SDKS-4926-single-checkbox

Conversation

@ancheetah
Copy link
Copy Markdown
Collaborator

@ancheetah ancheetah commented May 11, 2026

JIRA Ticket

https://pingidentity.atlassian.net/browse/SDKS-4926

Description

What

Adds a new ValidatedBooleanCollector type to davinci-client to handle DaVinci flows that include a single checkbox field (SINGLE_CHECKBOX / inputType: BOOLEAN). The collector holds a boolean value and follows the same validated collector pattern as ValidatedTextCollector. An e2e reference implementation (booleanComponent) is included in the test app.

TODO: E2E test suite will be added in another ticket with agreements e2e https://pingidentity.atlassian.net/browse/SDKS-5000

Changes

New types

  • ValidatedBooleanCollectorValidatedSingleValueCollectorWithValue<'ValidatedBooleanCollector', boolean>
  • SingleCheckboxField — raw DaVinci field shape (type: 'SINGLE_CHECKBOX', inputType: 'BOOLEAN')

Type improvements

  • SingleValueCollectorWithValue<T, V> and ValidatedSingleValueCollectorWithValue<T, V> are now generic over their value type (V, defaults to string), replacing the loose string | number | boolean union
  • CollectorValueType<T> now maps ValidatedBooleanCollectorboolean
  • SingleValueCollectors union updated to use explicit named aliases instead of anonymous generics
  • SingleValueCollectorTypes and SingleValueFields expanded with 'ValidatedBooleanCollector' / SingleCheckboxField
  • updateCollectorValues action payload now accepts boolean

Logic

  • returnValidatedBooleanCollector factory function added to collector.utils.ts
  • nodeCollectorReducer handles the SINGLE_CHECKBOX case and enforces a boolean guard on value updates
  • Collectors union in node.types.ts includes ValidatedBooleanCollector

E2E

  • New e2e/davinci-app/components/boolean.ts — renders a single checkbox and wires updater to the change event
  • e2e/davinci-app/main.ts routes ValidatedBooleanCollector to the new component

Housekeeping

  • .gitignore — ignores .claude/skills and .claude/CLAUDE.md

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Added single-checkbox field with boolean value support, required validation, and form rendering.
  • Tests

    • Added/end-to-end and unit tests covering initialization, validation, and update behavior for the checkbox.
  • Documentation

    • Added release notes/changeset documenting the new checkbox and related typing/validator changes.
  • Chores

    • Updated dev dependency entries and updated ignore rules to exclude local tool artifacts.

Review Change Stack

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 11, 2026

🦋 Changeset detected

Latest commit: 913b98b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/davinci-client Minor
@forgerock/device-client Minor
@forgerock/journey-client Minor
@forgerock/oidc-client Minor
@forgerock/protect Minor
@forgerock/sdk-types Minor
@forgerock/sdk-utilities Minor
@forgerock/iframe-manager Minor
@forgerock/sdk-logger Minor
@forgerock/sdk-oidc Minor
@forgerock/sdk-request-middleware Minor
@forgerock/storage Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

This PR adds support for checkbox-based boolean input to the DaVinci client by introducing a new ValidatedBooleanCollector type, SingleCheckboxField form variant, and corresponding UI component. Changes span the type system, collector factory, Redux state management, client API, and e2e test integration.

Changes

ValidatedBooleanCollector Feature

Layer / File(s) Summary
Type System Foundation
packages/davinci-client/src/lib/davinci.types.ts, packages/davinci-client/src/lib/collector.types.ts
SingleCheckboxField with boolean input type is added; single-value collector types are extended with ValidatedBooleanCollector and refactored to accept generic value type parameter V replacing fixed string | number | boolean union.
Client Value Type Mapping
packages/davinci-client/src/lib/client.types.ts, packages/davinci-client/src/lib/client.types.test-d.ts
CollectorInputTypes union introduced to consolidate supported input values; CollectorValueType<T> gains conditional mapping for ValidatedBooleanCollectorboolean; Validator and Updater typings updated to use consolidated input union.
Collector Factory Construction
packages/davinci-client/src/lib/collector.utils.ts
returnSingleValueCollector extended to handle SingleCheckboxField and build ValidatedBooleanCollector instances with boolean defaults and conditional required validation; new returnValidatedBooleanCollector helper added; returnValidator generalized to Validator<T>.
Password policy validator typing
packages/davinci-client/src/lib/password-policy.rules.ts
returnPasswordPolicyValidator now returns Validator<ValidatedPasswordCollector>; typing/imports adjusted.
Client Store and Update API
packages/davinci-client/src/lib/client.store.ts
Client update method signature permits boolean values.
Redux State Management
packages/davinci-client/src/lib/node.reducer.ts
Redux reducer initializes SINGLE_CHECKBOX collectors via returnValidatedBooleanCollector; updateCollectorValues payload expanded to allow boolean; reducer enforces boolean typing for validated boolean collectors on update.
Tests and Type Tests
packages/davinci-client/src/lib/collector.utils.test.ts, packages/davinci-client/src/lib/node.reducer.test.ts, packages/davinci-client/src/lib/collector.types.test-d.ts, packages/davinci-client/src/lib/client.types.test-d.ts, packages/davinci-client/src/lib/node.types.test-d.ts
Add/adjust tests: validator cases for boolean required rule, reducer tests for SINGLE_CHECKBOX initialization and updates, and type-level assertions for collector inference and updater typing.
E2E Checkbox UI Component
e2e/davinci-app/components/boolean.ts, e2e/davinci-app/main.ts, e2e/davinci-suites/src/form-fields.test.ts
Add booleanComponent rendering a single checkbox from ValidatedBooleanCollector, integrate into e2e app, and update e2e assertion expecting single-checkbox-field: false on submit.
API Report Updates
packages/davinci-client/api-report/davinci-client.api.md, packages/davinci-client/api-report/davinci-client.types.api.md
Generated API reports updated to reflect CollectorInputTypes, ValidatedBooleanCollector, PhoneNumberExtensionCollector, SingleCheckboxField, generified single-value collectors, and Validator typing changes.
Configuration & Docs
.gitignore, .changeset/single-checkbox.md, package.json
.gitignore adds .claude entries; changeset documents the minor release; package.json scripts/devDependency ordering adjusted and ts-patch set to 3.3.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • cerebrl
  • vatsalparikh

"🐰 A checkbox hops in, boolean and bright,
From types to UI it checks what's right.
Validator hums, Redux sets the state,
E2E confirms the form's new fate.
Hooray — small changes, typed and light!"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main feature being added: support for a single checkbox component in davinci-client.
Description check ✅ Passed The PR description is comprehensive and well-structured, covering JIRA ticket link, detailed explanation of what/why, all new types, type improvements, logic changes, E2E implementation, and housekeeping items.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SDKS-4926-single-checkbox

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 11, 2026

View your CI Pipeline Execution ↗ for commit 913b98b

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 2m 45s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-18 19:50:37 UTC

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
e2e/davinci-app/components/boolean.ts (2)

1-6: 💤 Low value

Nitpick: Copyright year inconsistency.

This file uses copyright year 2026, while other files in the codebase use 2025. Consider using 2025 for consistency, unless this is intentional.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/components/boolean.ts` around lines 1 - 6, Update the
copyright header year from 2026 to 2025 in the top-of-file comment block in
e2e/davinci-app/components/boolean.ts so it matches the rest of the repository;
edit the existing comment lines (the block that starts with "Copyright (c) 2026
Ping Identity Corporation") to use 2025 instead.

24-28: 💤 Low value

Optional: Duplicate label might cause confusion.

The component creates a group label (lines 26-28) and an individual checkbox label (lines 41-43), both displaying the same text from collector.output.label. For a single checkbox component, this creates visual duplication. Consider removing the group label or differentiating the text.

♻️ Possible refinement
-  // Create a heading/label for the checkbox group
-  const groupLabel = document.createElement('div');
-  groupLabel.textContent = collector.output.label || 'Single Checkbox';
-  groupLabel.className = 'single-checkbox-label';
-  containerDiv.appendChild(groupLabel);
-
   // Create checkboxes for each option
   const wrapper = document.createElement('div');
   wrapper.className = 'checkbox-wrapper';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/components/boolean.ts` around lines 24 - 28, The component
currently creates a duplicate visible label by appending a groupLabel (const
groupLabel) with text from collector.output.label and also rendering an
individual checkbox label later, causing visual duplication in the
single-checkbox UI; fix by removing or hiding the redundant group label when
rendering a single checkbox — either stop creating/appending groupLabel (remove
the containerDiv.appendChild(groupLabel) lines) or change groupLabel.textContent
to a different contextual string (or add a CSS class to visually hide it) and
ensure the individual checkbox label (the per-checkbox label element) remains
the primary visible label.
packages/davinci-client/src/lib/collector.types.ts (1)

634-635: 💤 Low value

Formatting change unrelated to PR objective.

The reformatting of AttestationValue and AssertionValue from multiline to single-line Omit expressions appears unrelated to the checkbox support feature. While this doesn't change functionality, consider whether this formatting change belongs in a separate PR focused on code style.

Also applies to: 653-654

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/collector.types.ts` around lines 634 - 635,
The PR contains unrelated formatting changes: the multiline Omit types for
AttestationValue and AssertionValue were collapsed into single-line forms;
revert these formatting-only edits so they remain multiline (as before) and move
any styling-only changes to a separate PR. Locate the AttestationValue and
AssertionValue type declarations in collector.types.ts and restore their
original multiline formatting (preserving the exact type members:
Omit<PublicKeyCredential, 'rawId' | 'response' | 'getClientExtensionResults' |
'toJSON'> and Omit<PublicKeyCredential, 'rawId' | 'response' |
'getClientExtensionResults' | 'toJSON'> respectively), ensuring no functional
changes are introduced.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/davinci-app/components/boolean.ts`:
- Around line 34-39: The SingleCheckboxField's required flag isn't applied to
the created checkbox element; update the element creation in the component that
builds the checkbox (where checkbox is created from collector.output) to set
checkbox.required = !!collector.output.required (and optionally
checkbox.setAttribute('aria-required','true') for accessibility) so the HTML
required validation is honored; ensure you reference collector.output.required
and the checkbox element in the SingleCheckboxField handling logic.
- Around line 46-49: The change handler for the checkbox uses the static value
attribute and compares target.value === 'checked', which is always true; update
the event listener on checkbox (the callback passed to
checkbox.addEventListener('change', ...)) to call updater with the actual
boolean state using target.checked instead of comparing target.value, i.e.,
replace the expression target.value === 'checked' with target.checked so the
updater receives the real checked state.

In `@packages/davinci-client/src/lib/collector.utils.ts`:
- Line 250: The new AND check causes required-only text fields to skip
validation; revert the outer conditional in the text-field branch to use OR
(i.e. change "else if ('validation' in field && field.validation && 'regex' in
field.validation)" back to "else if ('validation' in field || 'required' in
field)") so that fields with either validation or required:true are handled by
the ValidatedTextCollector/validation logic (the inner branches already
distinguish regex vs required), preventing them from falling through to
SingleValueCollector.

In `@packages/davinci-client/src/lib/node.reducer.ts`:
- Around line 196-198: The SINGLE_CHECKBOX branch in node.reducer.ts currently
calls returnValidatedBooleanCollector(field, idx) without passing the prefill
value; update the case for 'SINGLE_CHECKBOX' to extract the data variable from
formData (same way other branches do) and call
returnValidatedBooleanCollector(field, idx, data). Then update
returnValidatedBooleanCollector to accept the extra data parameter and forward
it into returnSingleValueCollector so SINGLE_CHECKBOX supports prefilled values,
mirroring how returnTextCollector and returnSingleSelectCollector handle the
data.

---

Nitpick comments:
In `@e2e/davinci-app/components/boolean.ts`:
- Around line 1-6: Update the copyright header year from 2026 to 2025 in the
top-of-file comment block in e2e/davinci-app/components/boolean.ts so it matches
the rest of the repository; edit the existing comment lines (the block that
starts with "Copyright (c) 2026 Ping Identity Corporation") to use 2025 instead.
- Around line 24-28: The component currently creates a duplicate visible label
by appending a groupLabel (const groupLabel) with text from
collector.output.label and also rendering an individual checkbox label later,
causing visual duplication in the single-checkbox UI; fix by removing or hiding
the redundant group label when rendering a single checkbox — either stop
creating/appending groupLabel (remove the containerDiv.appendChild(groupLabel)
lines) or change groupLabel.textContent to a different contextual string (or add
a CSS class to visually hide it) and ensure the individual checkbox label (the
per-checkbox label element) remains the primary visible label.

In `@packages/davinci-client/src/lib/collector.types.ts`:
- Around line 634-635: The PR contains unrelated formatting changes: the
multiline Omit types for AttestationValue and AssertionValue were collapsed into
single-line forms; revert these formatting-only edits so they remain multiline
(as before) and move any styling-only changes to a separate PR. Locate the
AttestationValue and AssertionValue type declarations in collector.types.ts and
restore their original multiline formatting (preserving the exact type members:
Omit<PublicKeyCredential, 'rawId' | 'response' | 'getClientExtensionResults' |
'toJSON'> and Omit<PublicKeyCredential, 'rawId' | 'response' |
'getClientExtensionResults' | 'toJSON'> respectively), ensuring no functional
changes are introduced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 524a05e9-77c1-451f-9f1a-fa7ce5b9287b

📥 Commits

Reviewing files that changed from the base of the PR and between 44f9be3 and f4d8163.

📒 Files selected for processing (12)
  • .gitignore
  • e2e/davinci-app/components/boolean.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/tsconfig.json
💤 Files with no reviewable changes (1)
  • packages/davinci-client/tsconfig.json

Comment on lines +34 to +39
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = collector.output.key;
checkbox.name = collector.output.key || 'single-checkbox-field';
checkbox.checked = collector.output.value as boolean;
checkbox.value = 'checked';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Minor: Consider adding required attribute support.

The SingleCheckboxField type includes a required property, but the component doesn't set the HTML required attribute on the checkbox element. This means required validation won't work as expected.

🛡️ Proposed fix
   const checkbox = document.createElement('input');
   checkbox.type = 'checkbox';
   checkbox.id = collector.output.key;
   checkbox.name = collector.output.key || 'single-checkbox-field';
   checkbox.checked = collector.output.value as boolean;
   checkbox.value = 'checked';
+  if (collector.output.required) {
+    checkbox.required = true;
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = collector.output.key;
checkbox.name = collector.output.key || 'single-checkbox-field';
checkbox.checked = collector.output.value as boolean;
checkbox.value = 'checked';
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = collector.output.key;
checkbox.name = collector.output.key || 'single-checkbox-field';
checkbox.checked = collector.output.value as boolean;
checkbox.value = 'checked';
if (collector.output.required) {
checkbox.required = true;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/components/boolean.ts` around lines 34 - 39, The
SingleCheckboxField's required flag isn't applied to the created checkbox
element; update the element creation in the component that builds the checkbox
(where checkbox is created from collector.output) to set checkbox.required =
!!collector.output.required (and optionally
checkbox.setAttribute('aria-required','true') for accessibility) so the HTML
required validation is honored; ensure you reference collector.output.required
and the checkbox element in the SingleCheckboxField handling logic.

Comment thread e2e/davinci-app/components/boolean.ts
Comment thread packages/davinci-client/src/lib/collector.utils.ts
Comment on lines +196 to +198
case 'SINGLE_CHECKBOX': {
return returnValidatedBooleanCollector(field, idx);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check the signature and implementation of returnValidatedBooleanCollector

# Find the implementation of returnValidatedBooleanCollector
ast-grep --pattern $'export function returnValidatedBooleanCollector($$$) {
  $$$
}'

# Also search for its usage to understand the expected parameters
rg -n -A10 "returnValidatedBooleanCollector" --type ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 4218


🏁 Script executed:

#!/bin/bash

# Check returnSingleValueCollector implementation
rg -n -B5 -A15 "export function returnSingleValueCollector" packages/davinci-client/src/lib/collector.utils.ts

# Check returnTextCollector signature and implementation
rg -n -B5 -A15 "export function returnTextCollector" packages/davinci-client/src/lib/collector.utils.ts

# Get more context around the SINGLE_CHECKBOX case in node.reducer.ts
# to understand where data comes from
rg -n -B20 "case 'SINGLE_CHECKBOX'" packages/davinci-client/src/lib/node.reducer.ts | head -50

Repository: ForgeRock/ping-javascript-sdk

Length of output: 3362


🏁 Script executed:

#!/bin/bash

# Get the full implementation of returnSingleValueCollector
sed -n '155,200p' packages/davinci-client/src/lib/collector.utils.ts

# Also check what happens after line 200 to see how data is used
sed -n '155,250p' packages/davinci-client/src/lib/collector.utils.ts

Repository: ForgeRock/ping-javascript-sdk

Length of output: 4790


🏁 Script executed:

#!/bin/bash

# Get more context around SINGLE_CHECKBOX to understand the data variable
# and see how similar field types handle boolean-like data
sed -n '150,210p' packages/davinci-client/src/lib/node.reducer.ts

# Also check RADIO and DROPDOWN cases mentioned in the review
rg -n -B2 -A5 "case 'RADIO':|case 'DROPDOWN':" packages/davinci-client/src/lib/node.reducer.ts | head -40

Repository: ForgeRock/ping-javascript-sdk

Length of output: 2838


🏁 Script executed:

#!/bin/bash

# Check how the data value flows through for ValidatedBooleanCollector
# See if there's any conversion from boolean to string
sed -n '210,250p' packages/davinci-client/src/lib/collector.utils.ts

# Also check if there are TypeScript type definitions for ValidatedBooleanCollector
rg -n "ValidatedBooleanCollector" packages/davinci-client/src --type ts | head -20

Repository: ForgeRock/ping-javascript-sdk

Length of output: 3503


Add prefill support for SINGLE_CHECKBOX field type.

The SINGLE_CHECKBOX case doesn't extract or pass the data variable to returnValidatedBooleanCollector, unlike all other field types (e.g., TEXT, RADIO, DROPDOWN). This prevents checkboxes from supporting prefilled values from formData. Both the call site in node.reducer.ts and the returnValidatedBooleanCollector function need to be updated to pass the data through to returnSingleValueCollector, similar to how returnTextCollector and returnSingleSelectCollector handle it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/node.reducer.ts` around lines 196 - 198, The
SINGLE_CHECKBOX branch in node.reducer.ts currently calls
returnValidatedBooleanCollector(field, idx) without passing the prefill value;
update the case for 'SINGLE_CHECKBOX' to extract the data variable from formData
(same way other branches do) and call returnValidatedBooleanCollector(field,
idx, data). Then update returnValidatedBooleanCollector to accept the extra data
parameter and forward it into returnSingleValueCollector so SINGLE_CHECKBOX
supports prefilled values, mirroring how returnTextCollector and
returnSingleSelectCollector handle the data.

@ancheetah ancheetah force-pushed the SDKS-4926-single-checkbox branch from f4d8163 to af9e242 Compare May 11, 2026 20:26
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
e2e/davinci-app/main.ts (1)

298-300: ⚡ Quick win

Consider adding validation support for ValidatedBooleanCollector.

The ValidatedBooleanCollector handler passes only davinciClient.update(collector) to booleanComponent, but the collector type includes validation rules and the name indicates validation support. Compare with TextCollector handling (lines 234-240), which passes both update() and validate().

If the boolean component needs to enforce "required" validation (e.g., mandatory checkbox acceptance), consider passing davinciClient.validate(collector) as a third argument.

♻️ Potential enhancement
      } else if (collector.type === 'ValidatedBooleanCollector') {
-        booleanComponent(formEl, collector, davinciClient.update(collector));
+        booleanComponent(
+          formEl,
+          collector,
+          davinciClient.update(collector),
+          davinciClient.validate(collector),
+        );
      }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/main.ts` around lines 298 - 300, The
ValidatedBooleanCollector branch currently calls booleanComponent(formEl,
collector, davinciClient.update(collector)) but omits validation; modify the
ValidatedBooleanCollector handling so booleanComponent receives the validate
handler as well (e.g., pass davinciClient.validate(collector) in addition to
davinciClient.update(collector)), mirroring how TextCollector supplies both
update() and validate(); update the call site at the ValidatedBooleanCollector
branch to include davinciClient.validate(collector) so required/other validation
rules on the collector are enforced.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@e2e/davinci-app/main.ts`:
- Around line 298-300: The ValidatedBooleanCollector branch currently calls
booleanComponent(formEl, collector, davinciClient.update(collector)) but omits
validation; modify the ValidatedBooleanCollector handling so booleanComponent
receives the validate handler as well (e.g., pass
davinciClient.validate(collector) in addition to
davinciClient.update(collector)), mirroring how TextCollector supplies both
update() and validate(); update the call site at the ValidatedBooleanCollector
branch to include davinciClient.validate(collector) so required/other validation
rules on the collector are enforced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ff5f004-90c6-4033-83d2-2d5eaa35204e

📥 Commits

Reviewing files that changed from the base of the PR and between f4d8163 and af9e242.

📒 Files selected for processing (15)
  • .gitignore
  • e2e/davinci-app/components/boolean.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/tsconfig.json
💤 Files with no reviewable changes (1)
  • packages/davinci-client/tsconfig.json
✅ Files skipped from review due to trivial changes (4)
  • .gitignore
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/api-report/davinci-client.api.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/davinci-client/src/lib/client.types.ts
  • e2e/davinci-app/components/boolean.ts
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/collector.utils.ts

Copy link
Copy Markdown
Collaborator

@ryanbas21 ryanbas21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial pass through

Comment on lines -14 to -31
{
"path": "../sdk-effects/storage"
},
{
"path": "../sdk-utilities"
},
{
"path": "../sdk-types"
},
{
"path": "../sdk-effects/sdk-request-middleware"
},
{
"path": "../sdk-effects/oidc"
},
{
"path": "../sdk-effects/logger"
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems aggressive, are we sure we're in sync?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be added back in the latest push. For some reason pnpm build and git commit keep switching between adding and removing these.

) {
if (collector.type === 'ValidatedBooleanCollector') {
if (typeof action.payload.value !== 'boolean') {
throw new Error('Value argument must be a boolean');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should try to avoid further tech debt here. this is impure in a reducer.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do it after we merge your pr that already addresses this? It looks like that is still in review.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with throwing in a reducer for this PR, but I agree with Ryan that we need to refactor this sooner than later. Let's have this discussion soon and land on a holistic solution.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ryan has an open PR here. Let's try to prioritize this week. #626

Comment thread e2e/davinci-app/components/boolean.ts Outdated
// Add event listener to handle single-select behavior
checkbox.addEventListener('change', (event) => {
const target = event.target as HTMLInputElement;
updater(target.value === 'checked');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want target.checked here, value is always 'checked'?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding this correctly, the value is only checked when the checkbox is actually checked. I can explore more when I write the e2e.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/checkbox#value_2

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, coderabbbit is complaining about the same thing. I'll fix it now

| AutoCollectors,
) {
const rules = collector.input.validation;
return (value: string | string[] | Record<string, unknown>) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to add boolean to this function argument type, right?

Copy link
Copy Markdown
Collaborator Author

@ancheetah ancheetah May 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the entire returnValidator helper with generics so we have type narrowing on the returned validator input param. Added boolean.

key: string;
value: string | number | boolean;
type: string;
validation: (ValidationRequired | ValidationRegex)[];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the scenario where we use the ValidationRegex in the runtime? I don't see us using it, we just add a specific object type to the validation property in the collector builder.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's for ValidatedTextCollector

return returnObjectValueCollector(field, idx, prefillData);
}
case 'SINGLE_CHECKBOX': {
return returnValidatedBooleanCollector(field, idx);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to pass in prefillData here also? What if DaVinci says to pre-check the box?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this option in DaVinci but I'll double check with Andy

@ancheetah ancheetah force-pushed the SDKS-4926-single-checkbox branch from af9e242 to 48f2b8e Compare May 18, 2026 18:05
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/davinci-client/src/lib/node.reducer.test.ts (1)

1433-1598: ⚡ Quick win

Consider adding formData initialization test for consistency.

The test suite covers the core functionality well. However, other collector types in this file (e.g., TextCollector at lines 145-221, PhoneNumberCollector at lines 839-889) include tests for populating initial values from formData. Consider adding a similar test for ValidatedBooleanCollector to maintain consistency, unless pre-populating boolean checkboxes from formData is intentionally not supported.

Example test structure:

it('should populate ValidatedBooleanCollector with formData value', () => {
  const action = {
    type: 'node/next',
    payload: {
      fields: [
        {
          key: 'agree',
          type: 'SINGLE_CHECKBOX',
          inputType: 'BOOLEAN',
          label: 'I agree to the terms',
          required: false,
        },
      ],
      formData: {
        value: {
          agree: true,
        },
      },
    },
  };
  // Assert that output.value is true
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/node.reducer.test.ts` around lines 1433 -
1598, Add a test that verifies nodeCollectorReducer populates a
ValidatedBooleanCollector from formData by dispatching a 'node/next' action
whose payload includes fields with key 'agree' (type 'SINGLE_CHECKBOX',
inputType 'BOOLEAN') and formData containing value: { agree: true }, then assert
the returned collector (type ValidatedBooleanCollector) has output.value ===
true (and input.value === true if expected); if pre-population is intentionally
unsupported, instead add a test asserting that formData boolean is ignored and
document that behavior in the test name. Reference nodeCollectorReducer and
ValidatedBooleanCollector to locate where to add the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/davinci-suites/src/form-fields.test.ts`:
- Line 56: The test should actively interact with the single-checkbox-field and
the event handler in boolean.ts should read the checkbox state via
target.checked instead of comparing target.value to the hardcoded 'checked';
update the form-fields.test.ts to add a .check() call for
'single-checkbox-field' (matching how other checkboxes are exercised) and fix
boolean.ts by replacing the target.value === 'checked' comparison with using
target.checked so the handler reflects the real checked state.

---

Nitpick comments:
In `@packages/davinci-client/src/lib/node.reducer.test.ts`:
- Around line 1433-1598: Add a test that verifies nodeCollectorReducer populates
a ValidatedBooleanCollector from formData by dispatching a 'node/next' action
whose payload includes fields with key 'agree' (type 'SINGLE_CHECKBOX',
inputType 'BOOLEAN') and formData containing value: { agree: true }, then assert
the returned collector (type ValidatedBooleanCollector) has output.value ===
true (and input.value === true if expected); if pre-population is intentionally
unsupported, instead add a test asserting that formData boolean is ignored and
document that behavior in the test name. Reference nodeCollectorReducer and
ValidatedBooleanCollector to locate where to add the test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1217b03b-5475-4f7d-ba59-9b4d0175f8af

📥 Commits

Reviewing files that changed from the base of the PR and between af9e242 and 48f2b8e.

📒 Files selected for processing (20)
  • .changeset/single-checkbox.md
  • .gitignore
  • e2e/davinci-app/components/boolean.ts
  • e2e/davinci-app/main.ts
  • e2e/davinci-suites/src/form-fields.test.ts
  • package.json
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/client.types.test-d.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/node.reducer.test.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts
✅ Files skipped from review due to trivial changes (4)
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • .changeset/single-checkbox.md
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/davinci-client/src/lib/client.store.ts
  • e2e/davinci-app/main.ts
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/collector.types.ts

Comment thread e2e/davinci-suites/src/form-fields.test.ts
@ancheetah ancheetah force-pushed the SDKS-4926-single-checkbox branch from 48f2b8e to 913b98b Compare May 18, 2026 19:46
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 18, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@629

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@629

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@629

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@629

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@629

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@629

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@629

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@629

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@629

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@629

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@629

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@629

commit: 913b98b

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.87755% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.21%. Comparing base (eafe277) to head (913b98b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/davinci-client/src/lib/node.reducer.ts 80.00% 2 Missing ⚠️
packages/davinci-client/src/lib/collector.utils.ts 97.22% 1 Missing ⚠️

❌ Your project status has failed because the head coverage (18.21%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #629      +/-   ##
==========================================
+ Coverage   18.07%   18.21%   +0.13%     
==========================================
  Files         155      155              
  Lines       24398    24440      +42     
  Branches     1203     1212       +9     
==========================================
+ Hits         4410     4451      +41     
- Misses      19988    19989       +1     
Files with missing lines Coverage Δ
packages/davinci-client/src/lib/client.store.ts 0.28% <ø> (ø)
packages/davinci-client/src/lib/client.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/collector.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/davinci.types.ts 100.00% <ø> (ø)
packages/davinci-client/src/lib/node.types.ts 100.00% <ø> (ø)
...es/davinci-client/src/lib/password-policy.rules.ts 98.55% <100.00%> (+0.02%) ⬆️
packages/davinci-client/src/lib/collector.utils.ts 85.79% <97.22%> (+0.64%) ⬆️
packages/davinci-client/src/lib/node.reducer.ts 71.30% <80.00%> (+0.82%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

Deployed a74194e to https://ForgeRock.github.io/ping-javascript-sdk/pr-629/a74194e123b0672eabf3aa38304687ae2e23ba62 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Copy Markdown
Contributor

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/device-client - 0.0 KB (-10.0 KB, -100.0%)
🔻 @forgerock/journey-client - 0.0 KB (-91.9 KB, -100.0%)

📊 Minor Changes

📈 @forgerock/davinci-client - 54.1 KB (+0.7 KB)

➖ No Changes

@forgerock/storage - 1.5 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/iframe-manager - 2.4 KB
@forgerock/sdk-oidc - 4.8 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/sdk-types - 7.9 KB
@forgerock/protect - 144.6 KB
@forgerock/device-client - 10.0 KB
@forgerock/sdk-utilities - 11.2 KB
@forgerock/oidc-client - 25.2 KB
@forgerock/journey-client - 91.9 KB


14 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/davinci-client/src/lib/collector.utils.test.ts (1)

1679-1680: ⚡ Quick win

Import assert explicitly from vitest to avoid globals coupling.

Lines 1679, 1712, 1727, 1745, and 1780 use assert() without importing it, relying on Vitest's globals: true configuration. Making this explicit keeps tests stable if the global configuration changes.

Suggested patch
-import { describe, it, expect } from 'vitest';
+import { describe, it, expect, assert } from 'vitest';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/collector.utils.test.ts` around lines 1679 -
1680, Tests currently call assert() as a global; explicitly import it from
Vitest to avoid coupling to globals. Add "import { assert } from 'vitest';" at
the top of the test file (so references to assert() in the file—e.g., the
assertions around errors at the shown diff and the other occurrences) use the
imported symbol instead of the global, and run/adjust any lints if needed.
packages/davinci-client/src/lib/password-policy.rules.ts (1)

11-11: ⚡ Quick win

Change Validator to a type-only import to match the file's type import convention.

Validator is used only as a type annotation (lines 92, 94) and should be imported as import type for consistency with other type imports in the file (lines 9–10) and to clarify intent.

Suggested patch
-import { Validator } from './client.types.js';
+import type { Validator } from './client.types.js';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/davinci-client/src/lib/password-policy.rules.ts` at line 11, The
import for Validator should be type-only: change the existing import statement
that brings in Validator to an `import type` form so it is a type-only import
consistent with other imports; update the import that currently reads `import {
Validator } from './client.types.js'` to use type-only import and leave all
usages (the type annotations referencing Validator in functions/variables around
where it's used) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/davinci-client/src/lib/collector.utils.test.ts`:
- Around line 1679-1680: Tests currently call assert() as a global; explicitly
import it from Vitest to avoid coupling to globals. Add "import { assert } from
'vitest';" at the top of the test file (so references to assert() in the
file—e.g., the assertions around errors at the shown diff and the other
occurrences) use the imported symbol instead of the global, and run/adjust any
lints if needed.

In `@packages/davinci-client/src/lib/password-policy.rules.ts`:
- Line 11: The import for Validator should be type-only: change the existing
import statement that brings in Validator to an `import type` form so it is a
type-only import consistent with other imports; update the import that currently
reads `import { Validator } from './client.types.js'` to use type-only import
and leave all usages (the type annotations referencing Validator in
functions/variables around where it's used) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ce203f2d-1d60-47a8-b32d-66cabde6165a

📥 Commits

Reviewing files that changed from the base of the PR and between 48f2b8e and 913b98b.

📒 Files selected for processing (21)
  • .changeset/single-checkbox.md
  • .gitignore
  • e2e/davinci-app/components/boolean.ts
  • e2e/davinci-app/main.ts
  • e2e/davinci-suites/src/form-fields.test.ts
  • package.json
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/davinci-client/src/lib/client.store.ts
  • packages/davinci-client/src/lib/client.types.test-d.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • packages/davinci-client/src/lib/collector.types.ts
  • packages/davinci-client/src/lib/collector.utils.test.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • packages/davinci-client/src/lib/node.reducer.test.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/node.types.test-d.ts
  • packages/davinci-client/src/lib/node.types.ts
  • packages/davinci-client/src/lib/password-policy.rules.ts
✅ Files skipped from review due to trivial changes (2)
  • .gitignore
  • packages/davinci-client/src/lib/node.types.test-d.ts
🚧 Files skipped from review as they are similar to previous changes (12)
  • .changeset/single-checkbox.md
  • packages/davinci-client/src/lib/client.store.ts
  • e2e/davinci-app/main.ts
  • e2e/davinci-suites/src/form-fields.test.ts
  • packages/davinci-client/src/lib/client.types.test-d.ts
  • packages/davinci-client/src/lib/collector.types.test-d.ts
  • packages/davinci-client/src/lib/collector.utils.ts
  • e2e/davinci-app/components/boolean.ts
  • packages/davinci-client/src/lib/client.types.ts
  • packages/davinci-client/src/lib/node.reducer.ts
  • packages/davinci-client/src/lib/davinci.types.ts
  • package.json

Comment on lines +123 to +129

/**
* A function type that polls for the current status during challenge or continue polling.
*
* @returns A promise resolving to a `PollingStatus` string indicating the current state,
* or an `InternalErrorResponse` if the poll request fails.
*/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this comment is referencing something that's not in this file. Was this an accident?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just adds a comment for the Poller interface below

) {
if (collector.type === 'ValidatedBooleanCollector') {
if (typeof action.payload.value !== 'boolean') {
throw new Error('Value argument must be a boolean');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with throwing in a reducer for this PR, but I agree with Ryan that we need to refactor this sooner than later. Let's have this discussion soon and land on a holistic solution.

@ancheetah ancheetah merged commit 9f93d5e into main May 19, 2026
9 checks passed
@ancheetah ancheetah deleted the SDKS-4926-single-checkbox branch May 19, 2026 20:42
@ryanbas21 ryanbas21 mentioned this pull request May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants