-
Notifications
You must be signed in to change notification settings - Fork 59
[BI Data Mapper] Fix crash when clear all mappings while in inside a focused view #1020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BI Data Mapper] Fix crash when clear all mappings while in inside a focused view #1020
Conversation
WalkthroughThis change relocates reset handling from external prop control to internal component logic. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
workspaces/ballerina/ballerina-visualizer/src/views/DataMapper/DataMapperView.tsx(0 hunks)workspaces/ballerina/data-mapper/src/components/DataMapper/DataMapperEditor.tsx(2 hunks)workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsx(2 hunks)workspaces/ballerina/data-mapper/src/index.tsx(0 hunks)
💤 Files with no reviewable changes (2)
- workspaces/ballerina/data-mapper/src/index.tsx
- workspaces/ballerina/ballerina-visualizer/src/views/DataMapper/DataMapperView.tsx
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-11-25T06:34:10.812Z
Learnt from: CR
Repo: wso2/vscode-extensions PR: 0
File: workspaces/ballerina/component-diagram/AGENTS.md:0-0
Timestamp: 2025-11-25T06:34:10.812Z
Learning: Applies to workspaces/ballerina/component-diagram/src/components/**/*.tsx : Use React 18.2.0 features including concurrent rendering and automatic batching; avoid class components in favor of functional components with hooks
Applied to files:
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsxworkspaces/ballerina/data-mapper/src/components/DataMapper/DataMapperEditor.tsx
📚 Learning: 2025-11-26T07:49:56.428Z
Learnt from: KCSAbeywickrama
Repo: wso2/vscode-extensions PR: 653
File: workspaces/bi/bi-extension/src/test/e2e-playwright-tests/data-mapper/DataMapperUtils.ts:136-141
Timestamp: 2025-11-26T07:49:56.428Z
Learning: In workspaces/bi/bi-extension/src/test/e2e-playwright-tests/data-mapper/DataMapperUtils.ts, the goPrevViewBackButton() method is only called when in a focused view, ensuring breadcrumbs are always present. No guard for empty breadcrumbs is needed.
Applied to files:
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsxworkspaces/ballerina/data-mapper/src/components/DataMapper/DataMapperEditor.tsx
📚 Learning: 2025-11-25T06:34:10.812Z
Learnt from: CR
Repo: wso2/vscode-extensions PR: 0
File: workspaces/ballerina/component-diagram/AGENTS.md:0-0
Timestamp: 2025-11-25T06:34:10.812Z
Learning: Applies to workspaces/ballerina/component-diagram/src/resources/icons/**/*.tsx : Create separate SVG icon components in src/resources/icons/ for all diagram icons and import them as React components
Applied to files:
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsx
📚 Learning: 2025-11-27T07:58:16.698Z
Learnt from: KCSAbeywickrama
Repo: wso2/vscode-extensions PR: 897
File: workspaces/ballerina/data-mapper/src/components/Diagram/Label/MappingOptionsWidget.tsx:102-107
Timestamp: 2025-11-27T07:58:16.698Z
Learning: In workspaces/ballerina/data-mapper/src/components/Diagram/Label/MappingOptionsWidget.tsx, the `inProgress` state in `wrapWithProgress` intentionally doesn't reset to `false`. The component unmounts when the onClick operation finishes, and resetting the state would cause the mapping options menu to briefly reappear while the data mapper loads new content from file changes.
Applied to files:
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsxworkspaces/ballerina/data-mapper/src/components/DataMapper/DataMapperEditor.tsx
📚 Learning: 2025-11-26T06:34:09.752Z
Learnt from: KCSAbeywickrama
Repo: wso2/vscode-extensions PR: 653
File: workspaces/bi/bi-extension/src/test/e2e-playwright-tests/data-mapper/DataMapperUtils.ts:128-134
Timestamp: 2025-11-26T06:34:09.752Z
Learning: In workspaces/bi/bi-extension/src/test/e2e-playwright-tests/data-mapper/DataMapperUtils.ts, the goPrevViewBreadcrumb() method is only called when in a focused view, ensuring breadcrumbs are always present. No guard for empty breadcrumbs is needed.
Applied to files:
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsx
📚 Learning: 2025-11-24T14:51:49.267Z
Learnt from: KCSAbeywickrama
Repo: wso2/vscode-extensions PR: 998
File: workspaces/ballerina/data-mapper/src/components/DataMapper/Header/ExpressionBar.tsx:113-132
Timestamp: 2025-11-24T14:51:49.267Z
Learning: In workspaces/ballerina/data-mapper/src/components/DataMapper/Header/ExpressionBar.tsx, if `textFieldRef.current` is not undefined, `textFieldRef.current.inputElement` is guaranteed to exist. If `inputElement` doesn't exist when `current` exists, it's a fatal error that should reach the error boundary rather than being handled with defensive null checks.
Applied to files:
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsxworkspaces/ballerina/data-mapper/src/components/DataMapper/DataMapperEditor.tsx
🧬 Code graph analysis (2)
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsx (1)
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/ActionIconButton.tsx (1)
ActionIconButton(28-48)
workspaces/ballerina/data-mapper/src/components/DataMapper/DataMapperEditor.tsx (2)
workspaces/ballerina/ballerina-extension/src/rpc-managers/data-mapper/rpc-manager.ts (1)
deleteMapping(259-279)workspaces/ballerina/ballerina-extension/src/core/extended-language-client.ts (1)
deleteMapping(825-827)
🔇 Additional comments (1)
workspaces/ballerina/data-mapper/src/components/DataMapper/Header/DataMapperHeader.tsx (1)
69-81: Refresh button wiring and spacing look solidThe new
ActionIconButtonfor “Refresh all mappings” is correctly typed againstonRefresh: () => Promise<void>and fits the existing async/spinner pattern. The smallgap: 2pxinActionGroupContanercleanly separates reset vs refresh without behavioral side effects. No changes requested.Also applies to: 138-141
workspaces/ballerina/data-mapper/src/components/DataMapper/DataMapperEditor.tsx
Show resolved
Hide resolved
The merge-base changed after approval.
Purpose
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.