Fix issues in the MI Extension#2376
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR applies multiple targeted fixes and UI improvements across the MI workspace: view remounting via computed keys in ChangesMI Extension Fixes and UI Improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (14)
workspaces/mi/mi-core/src/rpc-types/mi-diagram/types.tsworkspaces/mi/mi-diagram/src/components/Form/Keylookup/Keylookup.tsxworkspaces/mi/mi-diagram/src/components/nodes/BaseNodeModel.tsworkspaces/mi/mi-diagram/src/components/sidePanel/dataServices/query.tsxworkspaces/mi/mi-extension/package.jsonworkspaces/mi/mi-extension/src/debugger/debugHelper.tsworkspaces/mi/mi-extension/src/rpc-managers/mi-diagram/rpc-manager.tsworkspaces/mi/mi-extension/src/rpc-managers/mi-visualizer/rpc-manager.tsworkspaces/mi/mi-visualizer/src/MainPanel.tsxworkspaces/mi/mi-visualizer/src/PopupPanel.tsxworkspaces/mi/mi-visualizer/src/views/Forms/ConnectionForm/index.tsxworkspaces/mi/mi-visualizer/src/views/Forms/DataServiceForm/MainPanelForms/index.tsxworkspaces/mi/mi-visualizer/src/views/Forms/InboundEPform/inboundConnectorForm.tsxworkspaces/mi/mi-visualizer/src/views/Forms/Tests/TestSuiteForm.tsx
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ArtifactTest/Automation.ts (1)
79-79: ⚡ Quick winMake 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
⛔ Files ignored due to path filters (1)
common/config/rush/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
common/config/rush/.pnpmfile.cjsworkspaces/mi/mi-diagram/src/components/nodes/BaseNodeModel.tsworkspaces/mi/mi-extension/package.jsonworkspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ArtifactTest/Automation.tsworkspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.tsworkspaces/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
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
common/config/rush/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
common/config/rush/.pnpmfile.cjspackage.jsonworkspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/ProjectExplorer.tsworkspaces/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
53526da to
4c6a1e3
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts (1)
495-495: Remove the fixed 2-second sleep afterwaitFor().The
waitForTimeout(2000)is redundant—the button is already waited for withwaitFor()on line 494. Fixed sleeps reduce test speed and can still be flaky. Instead, remove the sleep and rely on the element being ready afterwaitFor(), or add a reasonable timeout to theclick()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
📒 Files selected for processing (1)
workspaces/mi/mi-extension/src/test/e2e-playwright-tests/components/UnitTest.ts
0590532 to
d5e17d5
Compare
d5e17d5 to
89a7f1a
Compare
This PR will fix the below mentioned issues.
generateConnectorconnector call fails in MI LS mi-vscode#1149Summary by CodeRabbit
New Features
Bug Fixes
UI Improvements