8000 make multi value toggle less confusing by edewit · Pull Request #51110 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

make multi value toggle less confusing - #51110

Open
edewit wants to merge 3 commits into
keycloak:mainfrom
edewit:multi-value-toggle
Open

edewit wants to merge 3 commits into
keycloak:mainfrom
edewit:multi-value-toggle

Conversation

@edewit
@edewit edewit commented Jul 23, 2026
Copy link
Copy Markdown
Contributor

Align multivalued rendering precedence across user profile UIs

Ensure inputType-specific controls (select, multiselect,
select-radiobuttons, multiselect-checkboxes, textarea) take precedence
over generic multi-input rendering in React, and mirror the same
fallback behavior in FreeMarker when inputType is unset. Clarify the
Multivalued help text in Admin UI and update the user profile Playwright
spec to assert the new precedence rules.

fixes: #34763
Signed-off-by: Erik Jan de Wit erikjan.dewit@gmail.com

Copilot AI review requested due to automatic review settings July 23, 2026 11:33
@edewit
edewit requested review from a team as code owners July 23, 2026 11:33
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Aligns multivalued user-profile field rendering across React and FreeMarker UIs.

Changes:

  • Prioritizes dedicated inputType controls over generic multi-input rendering.
  • Adds FreeMarker multivalue inference and Playwright coverage.
  • Clarifies the Admin UI help text.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
themes/src/main/resources/theme/base/login/user-profile-commons.ftl Adds inferred multivalue fallback.
js/libs/ui-shared/src/user-profile/UserProfileFields.tsx Implements dedicated-control precedence.
js/apps/admin-ui/test/realm-settings/userprofile.spec.ts Tests toggle persistence and checkbox rendering.
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties Updates multivalued help text.

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.broker.KcOidcBrokerTest#loginWithExistingUserWithBruteForceEnabled

Keycloak CI - Java Distribution IT (windows-latest - temurin - 17)

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for value to contain (ignoring case) "sign in to". Current value: "AUTH_RESPONSE" (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Windows Server 2025', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.19'
Driver info: org.jboss.arquillian.drone.webdriver.htmlunit.DroneHtmlUnitDriver_ByGraphene
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.broker.KcOidcBrokerTest#loginWithExistingUserWithBruteForceEnabled

Keycloak CI - Java Distribution IT (windows-latest - temurin - 17)

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for value to contain (ignoring case) "sign in to". Current value: "AUTH_RESPONSE" (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Windows Server 2025', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.19'
Driver info: org.jboss.arquillian.drone.webdriver.htmlunit.DroneHtmlUnitDriver_ByGraphene
...

Report flaky test

@edewit
edewit force-pushed the multi-value-toggle branch from 7265fe7 to d83fe12 Compare November 27, 2026 12:28
Copilot AI balanced review requested due to automatic review settings November 27, 2026 12:28
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active defects cause multiselect string defaults to crash or corrupt values, omit options configured through custom validators, and leave inferred multivalued fields without working add/remove controls.

3 open issues
1 resolved since last review

Review effort: Balanced

@edewit
edewit force-pushed the multi-value-toggle branch from d83fe12 to 5035b55 Compare December 3, 2026 15:07
Copilot AI balanced review requested due to automatic review settings December 3, 2026 15:07
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describ 8000 e this comment to others. Learn more.

🟡 Changes recommended

Multivalued textarea rendering collapses separate values into a single string when edited, risking data loss.

4 open issues

Review effort: Balanced

@edewit
edewit commented Dec 3, 2026
Copy link
Copy Markdown
Contributor Author

Addressed the Copilot review:

  1. Select/checkbox options now resolve inputOptionsFromValidation with the standard options validator fallback, matching FreeMarker.
  2. Multiselect defaults/values are normalized to arrays so select/deselect no longer throws or splits strings into characters.
  3. Multivalued/textarea combinations keep the multi-input renderer so array values are preserved.
  4. FreeMarker inferred multivalued attributes now get kcMultivalued (and thus add/remove controls via kcMultivalued.js).

Copilot AI balanced review requested due to automatic review settings December 3, 2026 15:21
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved rendering defects can strip textarea line breaks, make labels toggle the wrong controls, select multiple radio options, and expose unusable Add/Remove buttons for read-only attributes.

7 open issues
1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 3, 2026 15:43
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Align multivalued rendering precedence across user profile UIs

Ensure inputType-specific controls (select, multiselect,
select-radiobuttons, multiselect-checkboxes, textarea) take precedence
over generic multi-input rendering in React, and mirror the same
fallback behavior in FreeMarker when inputType is unset. Clarify the
Multivalued help text in Admin UI and update the user profile Playwright
spec to assert the new precedence rules.

fixes: keycloak#34763
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Resolve options from inputOptionsFromValidation, normalize multiselect
string defaults to arrays, keep multi-input for multivalued textareas,
and infer kcMultivalued for FreeMarker when multiple values are present.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Namespace option IDs, keep radios single-select, render textarea
multi-inputs with rows/cols, and skip inferred kcMultivalued for
read-only attributes.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
@edewit
edewit force-pushed the multi-value-toggle branch from 9894c85 to 443b058 Compare December 4, 2026 14:09
Copilot AI balanced review requested due to automatic review settings December 4, 2026 14:09
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The account UI still renders multivalued selection controls as text inputs, and single-select fields fail to normalize stored arrays, causing incorrect highlighting and labeling.

2 open issues

Review effort: Balanced

Comment on lines +77 to +80
render={({ field }) => {
const selectedValues = isMultiValue
? asStringArray(field.value)
: field.value;
Comment on lines +197 to +198
const shouldRenderMultiInput =
!isSelectLikeInput &&
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In User Profile attribute config, Multivalued toggle is confusing

2 participants

0