Skip to content

Conversation

@samithkavishke
Copy link
Contributor

@samithkavishke samithkavishke commented Nov 27, 2025

Purpose

Fixes: wso2/product-ballerina-integrator#1839

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 [email protected] 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

image

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 [email protected] 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

  • Refactor
    • Reorganized the side panel layout to improve component structure and centralize the positioning of the Show More Functions UI element.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

Walkthrough

The "Show More Functions" button is relocated from within the logging function group to the panel level in the NodeList component. The computation of the callable function node is refactored from local, in-situ extraction to global extraction from filteredCategories, with conditional rendering based on node existence and search state.

Changes

Cohort / File(s) Summary
Show More Functions Button Relocation
workspaces/ballerina/ballerina-side-panel/src/components/NodeList/index.tsx
Extracted function node computation to component level, moved "Show More Functions" UI from within logging category to panel-level rendering in PanelBody with conditional display logic based on callFunctionNode and search state

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Single-file change with localized refactoring
  • Button relocation preserves existing interaction and visuals
  • Straightforward state extraction and conditional rendering logic

Poem

🐰 A button once nested in logging's embrace,
Now sits proudly in its rightful place—
Outside the group, so clear and bright,
Hop on in, the functions feel right!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning PR description is incomplete; only Purpose section is filled with an issue link, while Goals, Approach, and other required sections lack concrete details. Complete Goals and Approach sections describing the solution, implementation details, and UI changes (with screenshot). Fill or mark N/A for remaining sections.
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 (3 passed)
Check name Status Explanation
Title check ✅ Passed Title correctly identifies the main change: moving the 'Show More Functions' button out of the logging container to panel level.
Linked Issues check ✅ Passed Code changes successfully implement issue #1839 requirement: the Show More Functions button is moved from logging category rendering to panel-level rendering.
Out of Scope Changes check ✅ Passed All changes in the PR are in-scope and directly address issue #1839; no unrelated modifications detected.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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/ballerina-side-panel/src/components/NodeList/index.tsx (1)

838-855: Improve type safety and consider icon choice.

The type assertion as Node on line 840 bypasses type checking. While the find condition on line 774 makes this likely safe, it's not guaranteed. Additionally, the chevron-right icon typically indicates navigation or expansion rather than an action that adds a node, which might confuse users.

Consider these improvements:

1. Improve type safety:

-                            <S.AdvancedSubcategoryHeader onClick={() => handleAddNode(callFunctionNode as Node)}>
+                            <S.AdvancedSubcategoryHeader onClick={() => {
+                                if (callFunctionNode && "id" in callFunctionNode && "label" in callFunctionNode) {
+                                    handleAddNode(callFunctionNode);
+                                }
+                            }}>

2. Use a more intuitive icon:

-                                    <Codicon name="chevron-right" />
+                                    <Codicon name="list-tree" />

The list-tree icon better represents viewing more functions, or alternatively use symbol-method to indicate functions.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 585575d and 5f17a14.

📒 Files selected for processing (1)
  • workspaces/ballerina/ballerina-side-panel/src/components/NodeList/index.tsx (3 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
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/GeneralWidget.tsx : For regular services with more than 3 functions, show only the first 2 functions with a 'View All' button; for services with 3 or fewer functions, show all functions
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/**/*.tsx : Implement lazy expansion of functions: only render function items when they are visible to improve performance for large function lists
📚 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/**/*.tsx : Implement lazy expansion of functions: only render function items when they are visible to improve performance for large function lists

Applied to files:

  • workspaces/ballerina/ballerina-side-panel/src/components/NodeList/index.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/GeneralWidget.tsx : For regular services with more than 3 functions, show only the first 2 functions with a 'View All' button; for services with 3 or fewer functions, show all functions

Applied to files:

  • workspaces/ballerina/ballerina-side-panel/src/components/NodeList/index.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/ballerina-side-panel/src/components/NodeList/index.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/**/*.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/ballerina-side-panel/src/components/NodeList/index.tsx
🔇 Additional comments (2)
workspaces/ballerina/ballerina-side-panel/src/components/NodeList/index.tsx (2)

835-856: Implementation successfully achieves PR objective.

The relocation of the "Show More Functions" button from within the Logging category to the panel level is well-executed. The conditional rendering preserves the expected behavior (hidden during search), and the interaction remains consistent with the previous implementation.


770-774: Based on the repository clone failure, I cannot directly verify the code. However, I can analyze the review comment against standard React patterns and the information provided. Let me assess what can be verified from the context:

Analysis of the Review Comment:

  1. Memoization Suggestion: The code snippet shows flatMap(...).filter(...).find(...) operations that would run on every render. The suggestion to use useMemo is a valid performance optimization for such patterns.

  2. Duplicate Rendering Concern: The review asks to verify the FUNCTION node isn't duplicated. Without access to the file, I cannot confirm:

    • Whether FUNCTION is removed from the original category items (likely Logging)
    • Whether filtering prevents dual rendering
    • The complete data flow
  3. Suggested Diff: The diff appears syntactically valid but I cannot confirm:

    • If useMemo is already imported
    • If filteredCategories is the correct dependency
    • If there are other dependencies that should trigger the memoization

Since I cannot verify the critical aspects of this review comment due to repository access failure, I must mark it for manual verification:


Memoize the callFunctionNode extraction and verify no duplicate rendering of FUNCTION node.

The flatMap + filter + find operations execute on every render, which impacts performance with large category lists. Ensure the FUNCTION node has been removed from the original category items (likely Logging) to prevent rendering it both within its category and at the panel level.

The suggested memoization with useMemo is appropriate, but cannot be verified without access to confirm: (1) current import statements, (2) whether FUNCTION is filtered from original categories, and (3) the correct dependency array for your data flow.

@kanushka kanushka changed the base branch from main to bi-1.6.x December 23, 2025 11:44
@kanushka kanushka merged commit fd1270e into wso2:bi-1.6.x Dec 24, 2025
6 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.

Move Show More Function button outside the logging function group

2 participants