Skip to content

Fix issues in the MI Extension#2376

Merged
ChinthakaJ98 merged 8 commits into
wso2:release/mi-4.1.1from
ChinthakaJ98:mi-fixes-27
Jun 22, 2026
Merged

Fix issues in the MI Extension#2376
ChinthakaJ98 merged 8 commits into
wso2:release/mi-4.1.1from
ChinthakaJ98:mi-fixes-27

Conversation

@ChinthakaJ98

@ChinthakaJ98 ChinthakaJ98 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This PR will fix the below mentioned issues.

Summary by CodeRabbit

  • New Features

    • Added inline datasource validation with error messaging in Data Service forms.
    • Introduced collapsible Advanced Properties section for improved UI organization.
    • Enhanced loading indicator when fetching connectors.
  • Bug Fixes

    • Improved error messaging when generating connectors.
    • Fixed form state remounting for reliable view updates.
    • Corrected datasource validation timing during form submission.
  • UI Improvements

    • Upgraded SQL/Expression editor with auto-resizing text area.
    • Updated VS Code extension description to reflect WSO2 MI low-code toolkit positioning.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR applies multiple targeted fixes and UI improvements across the MI workspace: view remounting via computed keys in MainPanel/PopupPanel, MCP/connector tool node click handling in BaseNodeModel, connector error message propagation through GenerateConnectorResponse, datasource validation in the DataService form, inbound connector parameter normalization, data services query editor UI refresh, connection form fetch hardening, E2E test selector robustness, and minor styling/dependency version updates.

Changes

MI Extension Fixes and UI Improvements

Layer / File(s) Summary
Connector error propagation
mi-core/.../types.ts, mi-extension/.../mi-visualizer/rpc-manager.ts
GenerateConnectorResponse gains an optional errorMessage field; importOpenAPISpec destructures and displays it in the failure notification, falling back to a generic message.
View remount via computed keys
mi-visualizer/src/MainPanel.tsx, mi-visualizer/src/PopupPanel.tsx
Both panels add viewKey state and a getViewKey helper (with safe JSON.stringify) to clone the active viewComponent with a React key, forcing remounts on visualizer state changes.
MCP/connector tool node click handling
mi-diagram/.../nodes/BaseNodeModel.ts
onClicked now detects tool nodes, extracts toolMediator, classifies MCP vs. connector tools, and drives side-panel tag as 'ai.mcpTools' for MCP or mediatorTag otherwise.
DataService form datasource validation
mi-visualizer/.../DataServiceForm/MainPanelForms/index.tsx
Adds showDatasourceError state, an early submission guard when datasources is empty, a required DatasourceLabel, an inline ErrorText, dirty-marking on delete, and relaxes the submit button's disabled to only check isDirty.
Inbound connector parameter normalization
mi-visualizer/.../InboundEPform/inboundConnectorForm.tsx
Introduces getParameterValue(param) that normalizes param.content across null, string, array, and object shapes, and uses it when initializing form values and additionalParams.
Data services query editor UI
mi-diagram/.../sidePanel/dataServices/query.tsx
Replaces TextArea with AutoResizeTextArea for the SQL query field, adjusts cardStyle margin/padding, and wraps "Advanced Properties" in a collapsible FormGroup.
Connection form store connector fetch
mi-visualizer/.../ConnectionForm/index.tsx
Removes the navigator.onLine gate from fetchStoreConnectors, silences failure notifications (logs only), and adds a ProgressRing to the loading state.
Keylookup stable name fallback
mi-diagram/.../Form/Keylookup/Keylookup.tsx
Imports useId, derives fallbackId, and sets AutoComplete's name to props.name ?? fallbackId.
Backend RPC and debugger fixes
mi-extension/.../mi-diagram/rpc-manager.ts, mi-extension/.../debugHelper.ts
getMessageStore unconditionally sets response.providerClass = className; runBuildProcess moves the close handler outside the shouldCopyTarget branch so build messages always appear.
E2E test robustness
mi-extension/.../ArtifactTest/Automation.ts, mi-extension/.../UnitTest.ts
Switches combobox selector to a prefix-based id match; addMockServiceFromSidePanel scopes interaction to the resolved project tree item with an explicit hover and 2-second delay.
Minor styling and dependency updates
mi-visualizer/.../Tests/TestSuiteForm.tsx, mi-extension/package.json, common/config/rush/.pnpmfile.cjs, package.json
Adjusts TestSuiteForm card padding, updates the extension description, and bumps dompurify to 3.4.11, undici to 7.28.0, adding a http-proxy-middleware pin at 3.0.7.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • wso2/vscode-extensions#2358: Touches the same common/config/rush/.pnpmfile.cjs and package.json dependency override block, including the dompurify pin.
  • wso2/vscode-extensions#2372: Modifies the same applyOverrides logic in common/config/rush/.pnpmfile.cjs and overlapping package.json override versions.

Suggested reviewers

  • hevayo
  • gigara

Poem

🐇 Hop, hop — the views remount with glee,
A viewKey computed, fresh as can be!
MCP tools click with a mediator's grace,
Datasource errors shown right in their place.
Parameters normalized, connectors report their plight,
This rabbit tidied the code — everything feels right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lists 11 related GitHub issues but does not follow the provided template. It lacks critical sections like Purpose, Goals, Approach, Release notes, and other required documentation, making it impossible to understand the intent and scope of changes. Complete the pull request description using the provided template, including Purpose/Goals/Approach sections, test coverage, security checks, and other required sections to properly document the changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix issues in the MI Extension' is vague and generic. It does not specify which issues are being fixed or what the main technical focus of the changes is. Replace the generic title with a more specific one that highlights the primary technical change, such as 'Fix connector generation error handling and UI state management' or reference the most critical issues being addressed.
✅ Passed checks (2 passed)
Check name Status Explanation
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 unit tests (beta)
  • Create PR with unit tests

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.

@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: 2

🤖 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 `@workspaces/mi/mi-diagram/src/components/nodes/BaseNodeModel.ts`:
- Around line 133-135: The mediatorTag variable is initialized with stNode.tag
at line 133 but is never updated in the isConnectorTool branch (line 135),
causing it to remain as "tool" when published at line 180, which breaks the
side-panel routing contract that expects the actual mediator tag. Update the
mediatorTag variable within the isConnectorTool condition to extract and assign
the actual mediator tag value instead of allowing it to default to stNode.tag,
ensuring the correct mediator tag is sent to the side-panel regardless of
whether the connector tool is an MCP tool or not.

In
`@workspaces/mi/mi-visualizer/src/views/Forms/DataServiceForm/MainPanelForms/index.tsx`:
- Line 355: The submit button disable condition only checks the RHF isDirty
field, which does not track changes made to the local datasources state. When
users add, edit, or delete datasources, the submit button remains disabled
because those mutations are not reflected in the RHF form's dirty state. Fix
this by either using setValue with the shouldDirty option set to true whenever
datasources are updated (such as in child component callbacks that modify the
datasources), or by introducing a separate state flag to track datasource
mutations and including it in the disabled condition alongside isDirty. Ensure
all code paths that modify the local datasources state are covered by this
change.
🪄 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

Run ID: d5e47e3d-22a8-4308-bd84-c99bbb588e9e

📥 Commits

Reviewing files that changed from the base of the PR and between 3ee44ab and 99a3484.

📒 Files selected for processing (14)
  • workspaces/mi/mi-core/src/rpc-types/mi-diagram/types.ts
  • workspaces/mi/mi-diagram/src/components/Form/Keylookup/Keylookup.tsx
  • workspaces/mi/mi-diagram/src/components/nodes/BaseNodeModel.ts
  • workspaces/mi/mi-diagram/src/components/sidePanel/dataServices/query.tsx
  • workspaces/mi/mi-extension/package.json
  • workspaces/mi/mi-extension/src/debugger/debugHelper.ts
  • workspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.ts
  • workspaces/mi/mi-extension/src/rpc-managers/mi-visualizer/rpc-manager.ts
  • workspaces/mi/mi-visualizer/src/MainPanel.tsx
  • workspaces/mi/mi-visualizer/src/PopupPanel.tsx
  • workspaces/mi/mi-visualizer/src/views/Forms/ConnectionForm/index.tsx
  • workspaces/mi/mi-visualizer/src/views/Forms/DataServiceForm/MainPanelForms/index.tsx
  • workspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/inboundConnectorForm.tsx
  • workspaces/mi/mi-visualizer/src/views/Forms/Tests/TestSuiteForm.tsx

Comment thread workspaces/mi/mi-diagram/src/components/nodes/BaseNodeModel.ts

@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)
workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ArtifactTest/Automation.ts (1)

79-79: ⚡ Quick win

Make the combobox locator field-specific to avoid ambiguous matches.

[id^="headlessui-combobox-input-"] is less brittle than a fixed id, but it can still hit the wrong input if multiple headlessui comboboxes are rendered in this panel.

Suggested patch
-        await frame.locator('[id^="headlessui-combobox-input-"]').click();
+        await frame.getByLabel('Sequence').click();

(Use the actual accessible label/test-id for that field if it differs.)

🤖 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
`@workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ArtifactTest/Automation.ts`
at line 79, The combobox locator selector `[id^="headlessui-combobox-input-"]`
is too generic and may match the wrong input if multiple headlessui comboboxes
exist in the panel. Replace this with a more specific locator that targets the
exact field, either by using the actual accessible label associated with the
field, a test-id attribute, or by combining the combobox selector with a parent
container locator to narrow down the scope to the correct input element.
🤖 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
`@workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts`:
- Line 403: The switchToFormView() method call on mockServiceForm object is
using the default 30 second timeout while surrounding stabilization paths have
been upgraded to use a 60 second timeout, creating an inconsistency that can
cause flakiness under load. Add a 60 second timeout parameter to the
mockServiceForm.switchToFormView() call to match the timeout duration used in
the surrounding code for similar operations.

---

Nitpick comments:
In
`@workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ArtifactTest/Automation.ts`:
- Line 79: The combobox locator selector `[id^="headlessui-combobox-input-"]` is
too generic and may match the wrong input if multiple headlessui comboboxes
exist in the panel. Replace this with a more specific locator that targets the
exact field, either by using the actual accessible label associated with the
field, a test-id attribute, or by combining the combobox selector with a parent
container locator to narrow down the scope to the correct input element.
🪄 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

Run ID: e88aa345-4ecb-4c38-979e-ec0e2fe7c9d0

📥 Commits

Reviewing files that changed from the base of the PR and between c6788c1 and 30e6755.

⛔ Files ignored due to path filters (1)
  • common/config/rush/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • common/config/rush/.pnpmfile.cjs
  • workspaces/mi/mi-diagram/src/components/nodes/BaseNodeModel.ts
  • workspaces/mi/mi-extension/package.json
  • workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ArtifactTest/Automation.ts
  • workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts
  • workspaces/mi/mi-visualizer/src/views/Forms/DataServiceForm/MainPanelForms/index.tsx
✅ Files skipped from review due to trivial changes (1)
  • workspaces/mi/mi-extension/package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • workspaces/mi/mi-diagram/src/components/nodes/BaseNodeModel.ts
  • workspaces/mi/mi-visualizer/src/views/Forms/DataServiceForm/MainPanelForms/index.tsx

@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
`@workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ProjectExplorer.ts`:
- Line 58: The path traversal in the loop that processes each segment of the
path is not scoped to the previously matched parent node. Each iteration
performs the lookup from the entire explorer using this.explorer.locator instead
of from the currentItem that was matched in the previous iteration. This causes
duplicate labels in different tree branches to select the wrong node. Fix this
by scoping each path segment lookup to the currentItem so that the traversal
properly follows the parent-child hierarchy. Change from looking up in
this.explorer to looking up in currentItem, ensuring that each new segment is
found only within the context of its parent node.
🪄 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

Run ID: e6d70339-208a-44a1-a423-48543734a520

📥 Commits

Reviewing files that changed from the base of the PR and between 30e6755 and e5ae09d.

⛔ Files ignored due to path filters (1)
  • common/config/rush/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • common/config/rush/.pnpmfile.cjs
  • package.json
  • workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ProjectExplorer.ts
  • workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts
✅ Files skipped from review due to trivial changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts

@ChinthakaJ98 ChinthakaJ98 force-pushed the mi-fixes-27 branch 2 times, most recently from 53526da to 4c6a1e3 Compare June 19, 2026 19:21

@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)
workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts (1)

495-495: Remove the fixed 2-second sleep after waitFor().

The waitForTimeout(2000) is redundant—the button is already waited for with waitFor() on line 494. Fixed sleeps reduce test speed and can still be flaky. Instead, remove the sleep and rely on the element being ready after waitFor(), or add a reasonable timeout to the click() call if retry behavior is needed.

-        await this._page.waitForTimeout(2000);
         console.log('Clicking on Add Mock Service button');
-        await addMockServiceBtn.click();
+        await addMockServiceBtn.click();
🤖 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
`@workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts`
at line 495, Remove the redundant `await this._page.waitForTimeout(2000)` call
in the UnitTest.ts file, as the button element is already being waited for with
`waitFor()` on line 494. The fixed sleep is unnecessary and slows down the test.
If retry behavior is needed for the click operation, consider adding a timeout
parameter to the `click()` call instead of relying on a fixed sleep.
🤖 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
`@workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts`:
- Line 495: Remove the redundant `await this._page.waitForTimeout(2000)` call in
the UnitTest.ts file, as the button element is already being waited for with
`waitFor()` on line 494. The fixed sleep is unnecessary and slows down the test.
If retry behavior is needed for the click operation, consider adding a timeout
parameter to the `click()` call instead of relying on a fixed sleep.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 281cfea9-e2e6-409f-a332-ec8ffb8cb99a

📥 Commits

Reviewing files that changed from the base of the PR and between e5ae09d and 4c6a1e3.

📒 Files selected for processing (1)
  • workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts

@ChinthakaJ98 ChinthakaJ98 force-pushed the mi-fixes-27 branch 4 times, most recently from 0590532 to d5e17d5 Compare June 20, 2026 03:42
@ChinthakaJ98 ChinthakaJ98 merged commit 0ea19a4 into wso2:release/mi-4.1.1 Jun 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants