Skip to content
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

fix: State inspector shows canvas widgets #39023

Open
wants to merge 2 commits into
base: release
Choose a base branch
from

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Feb 5, 2025

Description

Filter out the canvas widgets from the ui segment list

Fixes #38876

Automation

/ok-to-test tags="@tag.IDE"

🔍 Cypress test results

Warning

Tests have not run on the HEAD d95d92c yet


Wed, 05 Feb 2025 06:54:45 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Improved the logic for filtering UI components, ensuring a more consistent and accurate categorization based on widget type.

Copy link
Contributor

coderabbitai bot commented Feb 5, 2025

Walkthrough

The changes update the way UI widgets are filtered in the selector. An existing import for a widget name constant was removed and replaced with an import of a widget factory. A constant (WidgetTypes) was initialized from the factory, and the filtering logic in the getUISegmentItems function was modified to exclude widgets whose type is CANVAS_WIDGET rather than excluding them based on a specific widget name.

Changes

File(s) Change Summary
app/.../entitiesSelector.ts (Imports & Constants) Removed the import for MAIN_CONTAINER_WIDGET_NAME; added the import for WidgetFactory and initialized WidgetTypes from it.
app/.../entitiesSelector.ts (Filtering Logic) Updated getUISegmentItems to filter out widgets with type equal to WidgetTypes.CANVAS_WIDGET, replacing the previous name-based filtering.

Sequence Diagram(s)

sequenceDiagram
    participant C as Client
    participant S as Selector
    participant W as Widget List
    C->>S: Invoke getUISegmentItems()
    S->>W: Retrieve widget items
    loop For each widget
        alt widget.type equals CANVAS_WIDGET
            S-->>W: Skip widget
        else widget.type != CANVAS_WIDGET
            S->>S: Include widget in results
        end
    end
    S->>C: Return filtered widget list
Loading

Assessment against linked issues

Objective Addressed Explanation
Remove Canvas entries from list (#38876)

Suggested labels

Bug, Production, Regressed, IDE Product, Needs Triaging, IDE Pod, ok-to-test

Suggested reviewers

  • alex-golovanov
  • ApekshaBhosale
  • sagar-qa007

Poem

In code’s deep maze, a new light shines,
Filtering the canvas with smart designs.
Imports refined, logic anew,
A cleaner state, precise and true.
Cheers to change and bug-free views! 🎉
Keep on coding with spark and muse!

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1de2408 and a7d398a.

📒 Files selected for processing (1)
  • app/client/src/ce/selectors/entitiesSelector.ts (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
🔇 Additional comments (2)
app/client/src/ce/selectors/entitiesSelector.ts (2)

76-78: LGTM! Good refactor to use widget types.

The change to use WidgetFactory and its types is a more maintainable approach than using specific widget names.


993-994: LGTM! Clear and well-documented filter logic.

The filter logic is now more maintainable by checking the widget type instead of specific widget names. The comment clearly explains the purpose of the filter.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Bug Something isn't working Debugger Product Issues related to the debugger High This issue blocks a user from building or impacts a lot of users IDE Pod Issues that new developers face while exploring the IDE Low An issue that is neither critical nor breaks a user flow labels Feb 5, 2025
Copy link

github-actions bot commented Feb 5, 2025

🔴🔴🔴 Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

Copy link

github-actions bot commented Feb 5, 2025

🔴🔴🔴 Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 1, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Debugger Product Issues related to the debugger High This issue blocks a user from building or impacts a lot of users IDE Pod Issues that new developers face while exploring the IDE Low An issue that is neither critical nor breaks a user flow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: [State Inspector] Remove Canvas entries from list
2 participants