Skip to content

Show commands on palette only on relevant profile in WI app#2196

Open
kaumini wants to merge 6 commits into
wso2:mainfrom
kaumini:hideCommandsFromPalette
Open

Show commands on palette only on relevant profile in WI app#2196
kaumini wants to merge 6 commits into
wso2:mainfrom
kaumini:hideCommandsFromPalette

Conversation

@kaumini

@kaumini kaumini commented May 7, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fixes wso2/product-integrator#1300
Fixes wso2/product-integrator#1087

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

UI Component Development

Specify the reason if following are not followed.

  • Added reusable UI components to the ui-toolkit. Follow the intructions when adding the componenent.
  • Use ui-toolkit components wherever possible. Run npm run storybook from the root directory to view current components.
  • Matches with the native VSCode look and feel.

Manage Icons

Specify the reason if following are not followed.

  • Added Icons to the font-wso2-vscode. Follow the instructions.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

Summary by CodeRabbit

  • Chores
    • Updated command palette visibility for the Ballerina extension: many commands now appear only when not running under Wi runtime or when Wi runtime is active and the "WSO2 Integrator: Default" profile is selected.
    • Updated command palette visibility for the MI extension: MI-related commands now appear only when not running under Wi runtime or when Wi runtime is active and the "WSO2 Integrator: MI" profile is selected, reducing irrelevant commands.

Review Change Stack

@kaumini kaumini requested review from gigara and hevayo as code owners May 7, 2026 09:03
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c07858d9-766d-4429-ae2a-6df9372c791c

📥 Commits

Reviewing files that changed from the base of the PR and between a5936f8 and 03f3c89.

📒 Files selected for processing (2)
  • workspaces/ballerina/ballerina-extension/package.json
  • workspaces/mi/mi-extension/package.json

📝 Walkthrough

Walkthrough

Two VS Code extensions update command palette visibility conditions to enforce profile-based gating. Ballerina commands now show only in the Default profile; MI commands show only in the MI profile when running under WI runtime, otherwise commands remain visible.

Changes

Profile-based Command Visibility Gating

Layer / File(s) Summary
Ballerina Commands Profile Gating
workspaces/ballerina/ballerina-extension/package.json
Command palette entries gain or replace when conditions with standardized `!WI.isWiRuntime
MI Commands Profile Gating
workspaces/mi/mi-extension/package.json
Command palette entries update when clauses to `!WI.isWiRuntime

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • hevayo
  • ChinthakaJ98
  • gigara

Poem

🐰
I hopped through JSON lines tonight,
Tucking commands to left and right,
Default for Ballerina, MI for its kind,
Now each profile finds what it should find. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides the Purpose section with linked issues (#1300, #1087) but leaves most other required sections as empty templates, including Goals, Approach, documentation, training, and testing details. Complete the Goals, Approach, Release note, Documentation, Automation tests, and Security checks sections with substantive content explaining the implementation and testing performed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: conditionally showing commands in the command palette based on the selected profile in the WI app.
Linked Issues check ✅ Passed The changes properly address both issues: #1300 is resolved by gating MI commands on the MI profile, and #1087 is resolved by gating Ballerina commands on the default profile, preventing inappropriate commands from appearing.
Out of Scope Changes check ✅ Passed All changes in both package.json files directly implement profile-based command visibility, which aligns with the objectives of hiding MI-specific and Ballerina-specific commands based on the active profile.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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: 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/ballerina/ballerina-extension/package.json`:
- Around line 1144-1146: The `when` expression for the command
"ballerina.view.entityDiagram" contains a stray backtick after the && which
breaks the expression; open the object for the "ballerina.view.entityDiagram"
entry and remove the stray backtick from the `when` string so the conditional
reads correctly (e.g., isPersistModelActive && ( ... )), ensuring the boolean
logic and quoted segments around WI.isWiRuntime and
config.integrator.selectedProfile remain unchanged.
🪄 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: 92d0692c-a82b-4271-ac96-5cc40bea7149

📥 Commits

Reviewing files that changed from the base of the PR and between e3d18d4 and a5936f8.

📒 Files selected for processing (2)
  • workspaces/ballerina/ballerina-extension/package.json
  • workspaces/mi/mi-extension/package.json

Comment thread workspaces/ballerina/ballerina-extension/package.json
@gigara

gigara commented May 7, 2026

Copy link
Copy Markdown
Contributor

Better to merge this after the GA release. Merging such a change in the beta state is not good.

@gigara gigara added Checks/Run MI UI Tests Force run MI UI tests Checks/Run Ballerina UI Tests Force run Ballerina UI tests labels May 25, 2026
@gigara gigara closed this May 25, 2026
@gigara gigara reopened this May 25, 2026
@kaumini kaumini closed this May 26, 2026
@kaumini kaumini reopened this May 26, 2026
@kaumini

kaumini commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

Added PR to mi and ballerina migrate branches
#2286
#2288

@kaumini kaumini added Checks/Run MI UI Tests Force run MI UI tests and removed Checks/Run MI UI Tests Force run MI UI tests labels May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Checks/Run Ballerina UI Tests Force run Ballerina UI tests Checks/Run MI UI Tests Force run MI UI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MI: Create New Project is shown in the default profile [MI] Run and debug gives ballerina options in the MI profile mode

3 participants