Skip to content

Patch added to handle the reactive classes or dynamic classes handlin… - #2678

Open
khathija-ahamadi wants to merge 1 commit into
mainfrom
bug/4443-invalid-state-input-patch
Open

Patch added to handle the reactive classes or dynamic classes handlin…#2678
khathija-ahamadi wants to merge 1 commit into
mainfrom
bug/4443-invalid-state-input-patch

Conversation

@khathija-ahamadi

@khathija-ahamadi khathija-ahamadi commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

💡 What is the current behavior?

The Input field Invalid State post inputting invalid input reappears even after removing the invalid input and start entering valid input.

GitHub Issue Number: #2617

🆕 What is the new behavior?

Fixes the issue by adding a patch file where any control like ix-input incorrectly removed a user-provided ix-invalid class on load when the invalidText prop wasn't set. The class is now only auto-removed if it was previously added by the component itself, so manually-applied validation classes are preserved as before.

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Summary by CodeRabbit

  • Bug Fixes

    • Fixed reactive class bindings so classes removed from component attributes are also removed from the rendered element.
    • Improved class synchronization to accurately reflect the latest attribute values during updates.
  • Documentation

    • Added documentation for the Vue output target patch and its class-binding fix.

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8ced62d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@netlify

netlify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploy Preview for ix-storybook canceled.

Name Link
🔨 Latest commit 8ced62d
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a6988877d91aa000817727b

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR patches Stencil Vue runtime class synchronization in ESM and CommonJS builds, registers the patch through the pnpm workspace, and documents the patched dependency and its purpose.

Changes

Stencil Vue class synchronization

Layer / File(s) Summary
Runtime class reconciliation
patches/@stencil__vue-output-target.patch
Both runtime builds filter empty class tokens and reconcile DOM classes by removing tokens no longer present and rebuilding the tracked class set.
Patch registration and documentation
pnpm-workspace.yaml, patches/README.md
The workspace applies the Vue output target patch, and the README documents its scope and affected bundles.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 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 matches the main change: adding a patch to handle reactive or dynamic class syncing in Vue output target.
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 bug/4443-invalid-state-input-patch

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.

@sonarqubecloud

Copy link
Copy Markdown

@khathija-ahamadi
khathija-ahamadi marked this pull request as ready for review July 30, 2026 04:46

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

Actionable comments posted: 3

🤖 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 `@patches/`@stencil__vue-output-target.patch:
- Around line 8-10: Add regression tests around getComponentClasses and the
affected runtime bundles covering reactive class removal, preservation of
externally or component-added ix-invalid, and empty class bindings. Verify
classes are correctly owned and removed without deleting unrelated classes,
while preserving existing behavior for valid class strings.

In `@patches/README.md`:
- Around line 1-3: Update the pull request title to follow the required
conventional format, using a type, optional scope, colon, and concise
description; for example, use a format like “fix(vue): patch reactive class
synchronization.”

In `@pnpm-workspace.yaml`:
- Line 28: Add a changeset for the package that ships the Vue wrappers,
describing the consumer-visible behavior fix and selecting the appropriate
release level. If this patch is genuinely internal-only, provide an explicit
justification instead of adding the changeset.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: fd1b8c0a-dcd2-489f-90c9-e090e542af40

📥 Commits

Reviewing files that changed from the base of the PR and between 60d38b5 and 8ced62d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • patches/@stencil__vue-output-target.patch
  • patches/README.md
  • pnpm-workspace.yaml

Comment on lines +8 to +10
const getComponentClasses = (classes) => {
- return classes?.split(' ') || [];
+ return (classes?.split(' ') || []).filter(Boolean);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add regression coverage for class ownership and removal.

This changes runtime behavior in both bundles, but no regression test is included. Cover reactive class removal, preservation of externally/component-added ix-invalid, and empty class bindings.

As per path instructions: “Prioritize correctness, regressions, accessibility, release impact, and missing validation.”

Also applies to: 20-27, 38-40, 50-57

🤖 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 `@patches/`@stencil__vue-output-target.patch around lines 8 - 10, Add
regression tests around getComponentClasses and the affected runtime bundles
covering reactive class removal, preservation of externally or component-added
ix-invalid, and empty class bindings. Verify classes are correctly owned and
removed without deleting unrelated classes, while preserving existing behavior
for valid class strings.

Source: Path instructions

@khathija-ahamadi khathija-ahamadi Jul 30, 2026

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.

@nuke-ellington
I will add tests once initial review is done and go ahead with the solution is given.

Manual tests in all frameworks is carried out and the solution is working as expected.

Comment thread patches/README.md
Comment on lines +1 to +3
# Stencil Patches

## Vue Output Target

Copy link
Copy Markdown

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

Use a conventional PR title.

The current title is a prose sentence rather than <type>[optional scope]: <description>; use a title such as fix(vue): patch reactive class synchronization. (github.com)

As per path instructions: “Expect title format: [optional ]: .”

🤖 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 `@patches/README.md` around lines 1 - 3, Update the pull request title to
follow the required conventional format, using a type, optional scope, colon,
and concise description; for example, use a format like “fix(vue): patch
reactive class synchronization.”

Sources: Path instructions, MCP tools

Comment thread pnpm-workspace.yaml

patchedDependencies:
'@stencil/core': "patches/@stencil__core.patch"
'@stencil/vue-output-target': "patches/@stencil__vue-output-target.patch"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add the required changeset for this consumer-visible fix.

This patch changes shipped Vue behavior, but no changeset is included. Add one for the package that ships the Vue wrappers, or explicitly justify why this is internal-only.

As per path instructions: “Changesets are required for public API updates, behavior changes, styling/theming changes, accessibility changes, and bug fixes with user impact; if no changeset is included, require the author to explicitly justify why the change is internal-only.”

🤖 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 `@pnpm-workspace.yaml` at line 28, Add a changeset for the package that ships
the Vue wrappers, describing the consumer-visible behavior fix and selecting the
appropriate release level. If this patch is genuinely internal-only, provide an
explicit justification instead of adding the changeset.

Source: Path instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant