Skip to content

Conversation

@KCSAbeywickrama
Copy link
Contributor

@KCSAbeywickrama KCSAbeywickrama commented Dec 1, 2025

Purpose

$subject

Summary by CodeRabbit

  • Bug Fixes
    • Removed the "Group by" clause option from the query clause selector in the data mapper, narrowing the available clause types users can select.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

Removed the "Group by" clause option from a dropdown menu in the ClauseEditor component, leaving only "Join" as an additional clause option after "From". The GROUP_BY logic branch remains in the codebase but is no longer accessible through the UI.

Changes

Cohort / File(s) Change Summary
UI Clause Selection
workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClauseEditor.tsx
Removed "Group by" clause type option from the clauseTypeItems dropdown selector

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Verify that removing the dropdown option aligns with current product requirements
  • Confirm whether the GROUP_BY logic branch should be removed from generateFields or kept for future use

Suggested reviewers

  • hevayo
  • gigara

Poem

🐰 A clause disappears with a flick of the pen,
Group by takes its leave, JOIN takes reign.
The dropdown grows lean, the UI stays clean,
One less option, but code runs serene!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete, containing only a partial Purpose section with a placeholder value instead of a complete description following the required template. Fill in the Purpose section with actual context (not '$subject'), and complete other required sections like Goals, Approach, Documentation, and Release notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: removing the 'Group by' option from the ClauseEditor component.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClauseEditor.tsx (1)

44-51: "Group by" option correctly removed; please verify behavior for any existing GROUP_BY clauses

The updated clauseTypeItems list now excludes IntermediateClauseType.GROUP_BY and adds only JOIN after FROM, which aligns with the PR objective of removing the "Group by" option from the ClauseEditor.

However, the component still:

  • Initializes clauseType from clause?.type / clauseToAdd?.type, and
  • Handles IntermediateClauseType.GROUP_BY in expressionField and generateFields().

If a clause with type === IntermediateClauseType.GROUP_BY is ever passed in (e.g., from previously created or parsed queries), the Dropdown will receive value={clauseType} with no corresponding item in items={clauseTypeItems}. Depending on the Dropdown implementation, this may result in an empty label or other odd UX.

Consider either:

  • Ensuring GROUP_BY clauses can no longer be produced / loaded into this editor, or
  • Adding a non-selectable/display-only item for GROUP_BY (or a guard to coerce it to a supported type) if such clauses can still exist.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e726f14 and 482675e.

📒 Files selected for processing (1)
  • workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClauseEditor.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-11-27T07:59:33.534Z
Learnt from: KCSAbeywickrama
Repo: wso2/vscode-extensions PR: 897
File: workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClausesPanel.tsx:50-59
Timestamp: 2025-11-27T07:59:33.534Z
Learning: In workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClausesPanel.tsx, the `clause.properties.expression` property in the `fillDefaults` function does not require defensive null/undefined checks because it's a required property enforced by form validation in ClauseEditor.

Applied to files:

  • workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClauseEditor.tsx
📚 Learning: 2025-11-20T11:04:33.712Z
Learnt from: KCSAbeywickrama
Repo: wso2/vscode-extensions PR: 898
File: workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClausesPanel.tsx:38-38
Timestamp: 2025-11-20T11:04:33.712Z
Learning: In workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClausesPanel.tsx, the use of `useDMQueryClausesPanelStore.getState()` to access `clauseToAdd` and `setClauseToAdd` (instead of the hook subscription pattern) is intentional to prevent re-renders when these state values change.

Applied to files:

  • workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClauseEditor.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/components/nodes/EntryNode/components/GraphQLServiceWidget.tsx : For GraphQL services, group functions by type (Query, Subscription, Mutation) and allow independent expand/collapse of each group. Default state: Query group open, Subscription/Mutation groups collapsed

Applied to files:

  • workspaces/ballerina/data-mapper/src/components/DataMapper/SidePanel/QueryClauses/ClauseEditor.tsx

@KCSAbeywickrama KCSAbeywickrama merged commit dfcd6c4 into wso2:main Dec 1, 2025
5 checks passed
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.

2 participants