Skip to content

Add support to configure CSS Classes via flows - #3859

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:add-flows-component-meta
Jul 9, 2026
Merged

Add support to configure CSS Classes via flows#3859
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:add-flows-component-meta

Conversation

@brionmario

@brionmario brionmario commented Jul 9, 2026

Copy link
Copy Markdown
Member

Purpose

Adds the authoring-side capability in the Flow Composer/console to configure custom CSS Classes on flow resources, complementing the existing Element ID support.

Approach

  • New ClassesPropertyField.tsx component in the resource property panel for entering/managing CSS classes on a flow element.
  • Wired into ResourceProperties.tsx (flows feature) and ResourceProperties.tsx (login-flow feature).
  • elements.ts model extended with a classes field.
  • Element adapters (CheckboxAdapter, DefaultInputAdapter, OTPInputAdapter, PhoneNumberInputAdapter) updated to pass the new field through.
  • Design package flow adapters (DividerAdapter, IconAdapter, ImageAdapter, RichTextAdapter, StackAdapter, TextAdapter) updated to render/forward the configured classes.
  • New i18n strings added to en-US.ts for the new property field's labels/help text.
Screenshot 2026-07-09 at 16 31 06

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added a “CSS Classes” editor to the console and login flow for managing space-separated class names (add, edit, remove).
  • Enhancements
    • Flow elements now consistently use the unified classes setting for styling, and key rendered components now include stable IDs.
  • Localization
    • Added new English strings for the classes editor (label, placeholder, and “Add class”).
  • Tests
    • Added/updated tests covering the classes editor and adapter styling behavior.

@coderabbitai

coderabbitai Bot commented Jul 9, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5cc600a8-f8dc-49b0-a4e7-d1c79a764980

📥 Commits

Reviewing files that changed from the base of the PR and between 0b547bb and c33476a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ResourceProperties.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/__tests__/ClassesPropertyField.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/CheckboxAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/DefaultInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/OTPInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/PhoneNumberInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/CheckboxAdapter.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/DefaultInputAdapter.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/OTPInputAdapter.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/PhoneNumberInputAdapter.test.tsx
  • frontend/apps/console/src/features/flows/models/elements.ts
  • frontend/apps/console/src/features/login-flow/components/resource-property-panel/ResourceProperties.tsx
  • frontend/packages/design/src/components/flow/adapters/DividerAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/IconAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/ImageAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/StackAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/TextAdapter.tsx
  • frontend/packages/i18n/src/locales/en-US.ts
  • pnpm-workspace.yaml
✅ Files skipped from review due to trivial changes (4)
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/tests/PhoneNumberInputAdapter.test.tsx
  • frontend/packages/design/src/components/flow/adapters/ImageAdapter.tsx
  • frontend/packages/i18n/src/locales/en-US.ts
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/tests/DefaultInputAdapter.test.tsx
🚧 Files skipped from review as they are similar to previous changes (17)
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ResourceProperties.tsx
  • frontend/packages/design/src/components/flow/adapters/TextAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/tests/CheckboxAdapter.test.tsx
  • frontend/apps/console/src/features/flows/models/elements.ts
  • frontend/packages/design/src/components/flow/adapters/IconAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/DividerAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/OTPInputAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/StackAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/tests/OTPInputAdapter.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/DefaultInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/PhoneNumberInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx
  • pnpm-workspace.yaml
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/CheckboxAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/tests/ClassesPropertyField.test.tsx
  • frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx
  • frontend/apps/console/src/features/login-flow/components/resource-property-panel/ResourceProperties.tsx

📝 Walkthrough

Walkthrough

Adds classes?: string support for flow elements, a UI to edit space-separated class lists, panel wiring to expose it, adapter updates to consume it, and workspace dependency catalog changes.

Changes

CSS classes property support

Layer / File(s) Summary
Element model and ClassesPropertyField component
frontend/apps/console/src/features/flows/models/elements.ts, frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx, frontend/apps/console/src/features/i18n/src/locales/en-US.ts, frontend/apps/console/src/features/flows/components/resource-property-panel/__tests__/ClassesPropertyField.test.tsx
Adds classes?: string to the Element interface and implements ClassesPropertyField for editing space-separated class lists, including add/edit/remove behavior and localized field strings.
Resource property panel wiring
frontend/apps/console/src/features/flows/components/resource-property-panel/ResourceProperties.tsx, frontend/apps/console/src/features/login-flow/components/resource-property-panel/ResourceProperties.tsx
Adds classes to TOP_LEVEL_EDITABLE_PROPS and renders ClassesPropertyField in console and login-flow resource property panels across element categories and fallback branches.
Input element adapters migrate className to classes
frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/CheckboxAdapter.tsx, frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/DefaultInputAdapter.tsx, frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/OTPInputAdapter.tsx, frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/PhoneNumberInputAdapter.tsx, frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/*
Removes className from input element types and updates checkbox, text, OTP, and phone number adapters to set id and read styling from classes.
Flow design component adapters apply id and classes
frontend/packages/design/src/components/flow/adapters/DividerAdapter.tsx, frontend/packages/design/src/components/flow/adapters/IconAdapter.tsx, frontend/packages/design/src/components/flow/adapters/ImageAdapter.tsx, frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx, frontend/packages/design/src/components/flow/adapters/StackAdapter.tsx, frontend/packages/design/src/components/flow/adapters/TextAdapter.tsx
Updates divider, icon, image, rich text, stack, and text adapters to render id={component.id} and merge component.classes into their class names across all rendering branches.
Workspace dependency updates
pnpm-workspace.yaml
Bumps the pnpm catalog versions for @thunderid/react and @thunderid/react-router, and broadens the release-age exclusion pattern for @thunderid/* packages.

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

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The template is mostly followed, but the breaking-changes section is omitted despite public API removals that appear breaking. Uncomment and complete the breaking changes section with impact and migration guidance, or explain why the API changes are non-breaking.
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding CSS class support in flows.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

frontend/apps/console/src/features/flows/components/resource-property-panel/ResourceProperties.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

frontend/apps/console/src/features/flows/components/resource-property-panel/__tests__/ClassesPropertyField.test.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 17 others

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx (1)

160-161: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract repeated id/className composition into a shared helper.

This exact id={component.id} + [cn(base), component.classes].filter(Boolean).join(' ') pattern is duplicated 6x in this file alone, and again in ImageAdapter, StackAdapter, and TextAdapter. Consider a small shared utility (e.g. combineFlowClasses(base: string, classes?: string)) in the design package to centralize this logic.

♻️ Example helper
+// e.g. in a shared utils module
+export const combineFlowClasses = (base: string, classes?: string): string =>
+  [cn(base), classes].filter(Boolean).join(' ');
-        id={component.id}
-        className={[cn('Flow--richText'), component.classes].filter(Boolean).join(' ')}
+        id={component.id}
+        className={combineFlowClasses('Flow--richText', component.classes)}

Also applies to: 192-193, 218-219, 238-239, 264-265, 277-278

🤖 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 `@frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx`
around lines 160 - 161, The repeated id/className composition in RichTextAdapter
should be centralized into a shared helper so the same pattern can be reused
across this file and the other adapters. Add a small utility in the design
package (for example a helper like combineFlowClasses(base, classes)) that
returns the filtered joined class string, then update RichTextAdapter to use it
wherever `id={component.id}` and `cn(...)/filter(Boolean).join(' ')` are
repeated, and mirror the same refactor in ImageAdapter, StackAdapter, and
TextAdapter.
🤖 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
`@frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx`:
- Around line 33-53: `ClassesPropertyFieldPropsInterface.propertyValue` is too
narrow for `Element.classes`, which can be undefined. Update the
`ClassesPropertyField` props type so `propertyValue` accepts undefined, and keep
the existing `parseClasses` handling since it already normalizes missing values.
Make the change in `ClassesPropertyFieldPropsInterface` so callers can pass
`element.classes` directly without a TypeScript mismatch.

---

Nitpick comments:
In `@frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx`:
- Around line 160-161: The repeated id/className composition in RichTextAdapter
should be centralized into a shared helper so the same pattern can be reused
across this file and the other adapters. Add a small utility in the design
package (for example a helper like combineFlowClasses(base, classes)) that
returns the filtered joined class string, then update RichTextAdapter to use it
wherever `id={component.id}` and `cn(...)/filter(Boolean).join(' ')` are
repeated, and mirror the same refactor in ImageAdapter, StackAdapter, and
TextAdapter.
🪄 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 Plus

Run ID: 9dc26fc5-ca34-4023-8363-4e92c57f1cd1

📥 Commits

Reviewing files that changed from the base of the PR and between 2d47a7f and cec60a0.

📒 Files selected for processing (15)
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ResourceProperties.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/CheckboxAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/DefaultInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/OTPInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/PhoneNumberInputAdapter.tsx
  • frontend/apps/console/src/features/flows/models/elements.ts
  • frontend/apps/console/src/features/login-flow/components/resource-property-panel/ResourceProperties.tsx
  • frontend/packages/design/src/components/flow/adapters/DividerAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/IconAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/ImageAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/StackAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/TextAdapter.tsx
  • frontend/packages/i18n/src/locales/en-US.ts

Comment on lines +33 to +53
export interface ClassesPropertyFieldPropsInterface {
/**
* The resource associated with the property.
*/
resource: Resource;
/**
* The key of the property.
*/
propertyKey: string;
/**
* Space-separated list of CSS class names currently configured.
*/
propertyValue: string;
/**
* The event handler for the property change.
* @param propertyKey - The key of the property.
* @param newValue - The new space-separated class list.
* @param resource - The resource associated with the property.
*/
onChange: (propertyKey: string, newValue: string, resource: Resource, debounce?: boolean) => void;
}

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

propertyValue type should accept undefined to match Element.classes.

Element.classes is classes?: string (optional), but ClassesPropertyFieldPropsInterface.propertyValue is typed as string. If the parent passes element.classes directly, TypeScript would flag the mismatch. The parseClasses function already handles undefined via value ?? '', so the runtime guard exists — only the type annotation is too narrow.

🔧 Proposed type fix
 export interface ClassesPropertyFieldPropsInterface {
   /**
    * The key of the property.
    */
   propertyKey: string;
   /**
    * Space-separated list of CSS class names currently configured.
    */
-  propertyValue: string;
+  propertyValue?: string;
📝 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
export interface ClassesPropertyFieldPropsInterface {
/**
* The resource associated with the property.
*/
resource: Resource;
/**
* The key of the property.
*/
propertyKey: string;
/**
* Space-separated list of CSS class names currently configured.
*/
propertyValue: string;
/**
* The event handler for the property change.
* @param propertyKey - The key of the property.
* @param newValue - The new space-separated class list.
* @param resource - The resource associated with the property.
*/
onChange: (propertyKey: string, newValue: string, resource: Resource, debounce?: boolean) => void;
}
export interface ClassesPropertyFieldPropsInterface {
/**
* The resource associated with the property.
*/
resource: Resource;
/**
* The key of the property.
*/
propertyKey: string;
/**
* Space-separated list of CSS class names currently configured.
*/
propertyValue?: string;
/**
* The event handler for the property change.
* `@param` propertyKey - The key of the property.
* `@param` newValue - The new space-separated class list.
* `@param` resource - The resource associated with the property.
*/
onChange: (propertyKey: string, newValue: string, resource: Resource, debounce?: boolean) => void;
}
🤖 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
`@frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx`
around lines 33 - 53, `ClassesPropertyFieldPropsInterface.propertyValue` is too
narrow for `Element.classes`, which can be undefined. Update the
`ClassesPropertyField` props type so `propertyValue` accepts undefined, and keep
the existing `parseClasses` handling since it already normalizes missing values.
Make the change in `ClassesPropertyFieldPropsInterface` so callers can pass
`element.classes` directly without a TypeScript mismatch.

@brionmario
brionmario force-pushed the add-flows-component-meta branch from cec60a0 to 658d6b3 Compare July 9, 2026 10:47
@brionmario
brionmario force-pushed the add-flows-component-meta branch from 658d6b3 to f7ae6a0 Compare July 9, 2026 11:14
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@brionmario
brionmario force-pushed the add-flows-component-meta branch from f7ae6a0 to 0b547bb Compare July 9, 2026 13:05
JayaShakthi97
JayaShakthi97 previously approved these changes Jul 9, 2026

@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

🤖 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
`@frontend/apps/console/src/features/flows/components/resource-property-panel/__tests__/ClassesPropertyField.test.tsx`:
- Around line 49-50: The no-delete assertion in ClassesPropertyField.test.tsx is
too weak because `queryByRole('button', {name: ''})` will miss the real delete
button name from the Tooltip mock. Update the test to use the same
accessible-name query pattern as the delete-button case in the
`ClassesPropertyField` test, so it explicitly verifies that the delete control
is absent rather than just looking for an empty-name button.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f846dbd-c84a-4368-b8cd-61a6e49a10aa

📥 Commits

Reviewing files that changed from the base of the PR and between 658d6b3 and 0b547bb.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ResourceProperties.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/__tests__/ClassesPropertyField.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/CheckboxAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/DefaultInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/OTPInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/PhoneNumberInputAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/CheckboxAdapter.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/DefaultInputAdapter.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/OTPInputAdapter.test.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/__tests__/PhoneNumberInputAdapter.test.tsx
  • frontend/apps/console/src/features/flows/models/elements.ts
  • frontend/apps/console/src/features/login-flow/components/resource-property-panel/ResourceProperties.tsx
  • frontend/packages/design/src/components/flow/adapters/DividerAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/IconAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/ImageAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/StackAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/TextAdapter.tsx
  • frontend/packages/i18n/src/locales/en-US.ts
  • pnpm-workspace.yaml
✅ Files skipped from review due to trivial changes (1)
  • frontend/packages/i18n/src/locales/en-US.ts
🚧 Files skipped from review as they are similar to previous changes (15)
  • frontend/packages/design/src/components/flow/adapters/StackAdapter.tsx
  • frontend/apps/console/src/features/flows/models/elements.ts
  • frontend/packages/design/src/components/flow/adapters/IconAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/PhoneNumberInputAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/TextAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ResourceProperties.tsx
  • frontend/packages/design/src/components/flow/adapters/DividerAdapter.tsx
  • pnpm-workspace.yaml
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/DefaultInputAdapter.tsx
  • frontend/apps/console/src/features/login-flow/components/resource-property-panel/ResourceProperties.tsx
  • frontend/apps/console/src/features/flows/components/resource-property-panel/ClassesPropertyField.tsx
  • frontend/packages/design/src/components/flow/adapters/RichTextAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/OTPInputAdapter.tsx
  • frontend/packages/design/src/components/flow/adapters/ImageAdapter.tsx
  • frontend/apps/console/src/features/flows/components/resources/elements/adapters/input/CheckboxAdapter.tsx

Comment on lines +49 to +50
// Only row, no delete button should be rendered.
expect(screen.queryByRole('button', {name: ''})).not.toBeInTheDocument();

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Delete-button absence assertion won't catch regressions.

queryByRole('button', {name: ''}) looks for a button with an empty accessible name. The delete button's accessible name comes from the Tooltip title ('common:actions.delete' via the mock), so this query would return null even if a delete button were incorrectly rendered. Use the same query pattern as the delete test at Line 101.

💚 Proposed fix
-    // Only row, no delete button should be rendered.
-    expect(screen.queryByRole('button', {name: ''})).not.toBeInTheDocument();
+    // Only row, no delete button should be rendered.
+    expect(screen.queryByRole('button', {name: 'common:actions.delete'})).not.toBeInTheDocument();
📝 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
// Only row, no delete button should be rendered.
expect(screen.queryByRole('button', {name: ''})).not.toBeInTheDocument();
// Only row, no delete button should be rendered.
expect(screen.queryByRole('button', {name: 'common:actions.delete'})).not.toBeInTheDocument();
🤖 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
`@frontend/apps/console/src/features/flows/components/resource-property-panel/__tests__/ClassesPropertyField.test.tsx`
around lines 49 - 50, The no-delete assertion in ClassesPropertyField.test.tsx
is too weak because `queryByRole('button', {name: ''})` will miss the real
delete button name from the Tooltip mock. Update the test to use the same
accessible-name query pattern as the delete-button case in the
`ClassesPropertyField` test, so it explicitly verifies that the delete control
is absent rather than just looking for an empty-name button.

@brionmario
brionmario added this pull request to the merge queue Jul 9, 2026
@ThaminduDilshan
ThaminduDilshan removed this pull request from the merge queue due to a manual request Jul 9, 2026
@brionmario
brionmario added this pull request to the merge queue Jul 9, 2026
Merged via the queue into thunder-id:main with commit 9dc91a2 Jul 9, 2026
24 checks passed
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