Skip to content

feat: Custom code: add connection switcher - #765

Open
tamalchowdhury wants to merge 6 commits into
mainfrom
tamal/new/custom-ui-switch-js
Open

feat: Custom code: add connection switcher#765
tamalchowdhury wants to merge 6 commits into
mainfrom
tamal/new/custom-ui-switch-js

Conversation

@tamalchowdhury

@tamalchowdhury tamalchowdhury commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a new doc page for the connection switcher feature for the custom page. It also updates the reference to sibling pages.

Summary by CodeRabbit

  • Documentation
    • Added a guide for adding a connection switcher to custom authentication pages, including setup, secure switching, and supported behaviors.
    • Expanded page customization guidance with improved examples, templating and directory structure notes, configuration details, and supported page routes.
    • Refined language-management documentation covering fallback behavior, language detection, right-to-left support, and localized content.
    • Updated asset guidance for CSP-safe custom domains, including logo and favicon examples.
    • Improved discoverability with refreshed metadata, keywords, and related capability links.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 234f0745-2cf9-4c9a-801f-3390a2dd1e41

📥 Commits

Reviewing files that changed from the base of the PR and between efb1c2e and 3a2c99e.

📒 Files selected for processing (2)
  • src/content/docs/design/content-customization/set-language-for-pages.mdx
  • src/content/docs/design/customize-with-code/switch-connection.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/content/docs/design/content-customization/set-language-for-pages.mdx
  • src/content/docs/design/customize-with-code/switch-connection.mdx

Walkthrough

The documentation adds connection switching guidance and page-context reference. It also updates custom UI linking, page structure, localization, logo field names, and CSP-safe asset guidance.

Changes

Custom UI documentation

Layer / File(s) Summary
Connection switcher article
src/content/docs/design/customize-with-code/switch-connection.mdx
Adds a JSX implementation example, switching behavior notes, connection fields, and data attributes.
Authentication page context
src/content/docs/design/customize-with-code/understand-page-design.mdx
Documents page structure, customization routes, event and widget content shapes, and connection-switching context fields.
Related capability linking
src/content/docs/design/customize-with-code/custom-ui-examples.mdx
Links the connection switcher capability and updates page metadata.
Localization and design asset guidance
src/content/docs/design/content-customization/set-language-for-pages.mdx, src/content/docs/design/customize-with-code/manage-design-assets.mdx
Updates language configuration, localized field names, logo examples, and CSP-safe asset hosting guidance.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: danielrivers

Poem

A rabbit hops through pages bright,
Switcher buttons work just right.
Languages bloom and logos gleam,
Context shapes the custom theme.
Fresh links guide the way! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding connection switcher documentation for custom code pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tamal/new/custom-ui-switch-js

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.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/content/docs/design/customize-with-code/switch-connection.mdx (1)

51-82: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Omit the login hint attribute when empty in JSX.

The aside below mentions to "Omit the attribute if nothing has been entered yet." In React/JSX, passing an empty string ("") to a data attribute will render it in the DOM as data-kinde-change-connection-login-hint="". To truly omit the attribute, the value needs to evaluate to undefined.

Consider updating the JSX to pass enteredEmail || undefined so the attribute is omitted when the variable is an empty string.

♻️ Proposed fix
-              data-kinde-change-connection-login-hint={enteredEmail}
+              data-kinde-change-connection-login-hint={enteredEmail || undefined}
🤖 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 `@src/content/docs/design/customize-with-code/switch-connection.mdx` around
lines 51 - 82, Update the data-kinde-change-connection-login-hint attribute in
the Page component to evaluate to undefined when enteredEmail is empty, such as
by using the existing enteredEmail value with a falsy fallback, so React omits
the attribute while preserving non-empty login hints.
🤖 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 `@src/content/docs/design/customize-with-code/switch-connection.mdx`:
- Around line 51-82: Update the data-kinde-change-connection-login-hint
attribute in the Page component to evaluate to undefined when enteredEmail is
empty, such as by using the existing enteredEmail value with a falsy fallback,
so React omits the attribute while preserving non-empty login hints.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 558d9c58-6811-47e0-a5a1-23c238b3389c

📥 Commits

Reviewing files that changed from the base of the PR and between 886d14b and d36f23c.

📒 Files selected for processing (3)
  • src/content/docs/design/customize-with-code/custom-ui-examples.mdx
  • src/content/docs/design/customize-with-code/switch-connection.mdx
  • src/content/docs/design/customize-with-code/understand-page-design.mdx

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploying kinde-docs-preview with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3a2c99e
Status: ✅  Deploy successful!
Preview URL: https://adfcc62c.kinde-docs-preview.pages.dev
Branch Preview URL: https://tamal-new-custom-ui-switch-j.kinde-docs-preview.pages.dev

View logs

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/content/docs/design/customize-with-code/manage-design-assets.mdx (1)

78-86: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix unclosed JSX tag and property casing.

In JSX, void HTML elements like <source> must be self-closed, and standard React attributes should be camelCased (e.g., srcSet instead of srcset). Updating this prevents compilation errors for developers copying this snippet.

🐛 Proposed fix
 	<source
 		media="(prefers-color-scheme: dark)"
-		srcset={getDarkModeLogoUrl()}
-	>
+		srcSet={getDarkModeLogoUrl()}
+	/>
 	<img
 		src={getLogoUrl()}
 		alt={event.context.widget.content.logo_alt}
 	/>
🤖 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 `@src/content/docs/design/customize-with-code/manage-design-assets.mdx` around
lines 78 - 86, Update the JSX in the picture markup by self-closing the source
element and changing its srcset attribute to the camelCase srcSet form; leave
the existing getDarkModeLogoUrl, getLogoUrl, and image content unchanged.
🧹 Nitpick comments (3)
src/content/docs/design/customize-with-code/understand-page-design.mdx (3)

236-237: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove duplicate page entries.

The (register) and (login) pages are already listed just above this under the "Common pages" heading. Consider removing them here to avoid repetition.

♻️ Proposed fix
 ### Authentication
 
 Pages involved in initiating authentication flows.
 
-- `(register)` - The sign-up page.
-- `(login)` - The sign-in page.
 - `(sso_home_realm)` - Displayed when a user selects **Continue with SSO** to choose their identity provider.
🤖 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 `@src/content/docs/design/customize-with-code/understand-page-design.mdx`
around lines 236 - 237, Remove the duplicate `(register)` and `(login)` page
entries from the current page list in understand-page-design.mdx, keeping their
existing entries under the “Common pages” heading unchanged.

319-326: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add missing hyphen separators.

Consider adding hyphens after the property names to maintain formatting consistency throughout the document.

♻️ Proposed fix
-- `domains` contains relevant domain info
-  - `kindeDomain` your domain on Kinde, e.g. `https://example.kinde.com`
-- `widget` contains data generated from the widget
-  - `content` an object containing page content - translated and with placeholders replaced
-    - `page_title` the title of the page, commonly used in the `<title>` tag for the browser tab
-    - `heading` the main heading for the page
-    - `description` the page description
-    - `logo_alt` the alt text for your company logo
+- `domains` - contains relevant domain info
+  - `kindeDomain` - your domain on Kinde, e.g. `https://example.kinde.com`
+- `widget` - contains data generated from the widget
+  - `content` - an object containing page content - translated and with placeholders replaced
+    - `page_title` - the title of the page, commonly used in the `<title>` tag for the browser tab
+    - `heading` - the main heading for the page
+    - `description` - the page description
+    - `logo_alt` - the alt text for your company logo
🤖 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 `@src/content/docs/design/customize-with-code/understand-page-design.mdx`
around lines 319 - 326, Update the property descriptions in the widget content
documentation by adding hyphen separators after each property name—page_title,
heading, description, and logo_alt—matching the existing list formatting used
throughout the document.

304-304: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add missing hyphen separator.

Consider adding a hyphen after the property name to remain consistent with the formatting used in the rest of the file.

♻️ Proposed fix
-- `authUrlParams` contains useful info from the authorization request URL
+- `authUrlParams` - contains useful info from the authorization request URL
🤖 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 `@src/content/docs/design/customize-with-code/understand-page-design.mdx` at
line 304, Update the `authUrlParams` list item in the page design documentation
to add the missing hyphen separator after the property name, matching the
formatting of surrounding list entries.
🤖 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 `@src/content/docs/design/content-customization/set-language-for-pages.mdx`:
- Line 100: Update the img src expression in the documentation snippet to use a
quoted string placeholder instead of the JSX-like <img_url> token, while
preserving the existing content.logo_alt alt text.

---

Outside diff comments:
In `@src/content/docs/design/customize-with-code/manage-design-assets.mdx`:
- Around line 78-86: Update the JSX in the picture markup by self-closing the
source element and changing its srcset attribute to the camelCase srcSet form;
leave the existing getDarkModeLogoUrl, getLogoUrl, and image content unchanged.

---

Nitpick comments:
In `@src/content/docs/design/customize-with-code/understand-page-design.mdx`:
- Around line 236-237: Remove the duplicate `(register)` and `(login)` page
entries from the current page list in understand-page-design.mdx, keeping their
existing entries under the “Common pages” heading unchanged.
- Around line 319-326: Update the property descriptions in the widget content
documentation by adding hyphen separators after each property name—page_title,
heading, description, and logo_alt—matching the existing list formatting used
throughout the document.
- Line 304: Update the `authUrlParams` list item in the page design
documentation to add the missing hyphen separator after the property name,
matching the formatting of surrounding list entries.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b7df49dd-f0e5-4652-9b43-05a45731ebd4

📥 Commits

Reviewing files that changed from the base of the PR and between d36f23c and efb1c2e.

📒 Files selected for processing (3)
  • src/content/docs/design/content-customization/set-language-for-pages.mdx
  • src/content/docs/design/customize-with-code/manage-design-assets.mdx
  • src/content/docs/design/customize-with-code/understand-page-design.mdx

Comment thread src/content/docs/design/content-customization/set-language-for-pages.mdx Outdated
@onderay
onderay requested a review from DanielRivers July 15, 2026 01:59
@tamalchowdhury tamalchowdhury changed the title feat: Add connection switcher feat: Custom code: add connection switcher Jul 16, 2026

@dtoxvanilla1991 dtoxvanilla1991 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.

Please have a look at 2 below 📓

Comment thread src/content/docs/design/customize-with-code/switch-connection.mdx Outdated
Comment thread src/content/docs/design/content-customization/set-language-for-pages.mdx Outdated
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.

3 participants