Skip to content

chore: UI Module instances support broken references in widgets entity explorer #40390

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

Merged
merged 1 commit into from
Apr 26, 2025

Conversation

ashit-rath
Copy link
Contributor

@ashit-rath ashit-rath commented Apr 25, 2025

Description

  • Create orphan UI Module instances component for displaying UI modules not present on canvas
  • Add error indication for widgets in the tree view
  • Update widget tree data structure to support error state

Changes for https://github.com/appsmithorg/appsmith-ee/pull/7274

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14682236408
Commit: b65ec15
Cypress dashboard.
Tags: @tag.All
Spec:


Sat, 26 Apr 2025 15:49:15 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced display of orphan module instances in the entity list tree, allowing users to view modules not currently present on the canvas.
  • Enhancements

    • Entity list items now indicate error status, improving visibility of issues within widgets.

@ashit-rath ashit-rath self-assigned this Apr 25, 2025
Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

Walkthrough

This change introduces a new React component, OrphanUIModuleInstancesEntityList, designed to display orphaned UI module instances within the entity list tree, with its base implementation in the community edition and a proxy export in the enterprise edition. The UIEntityListTree component is updated to render this new component and to pass a new hasError property through the widget tree, originating from an updated CanvasStructure interface that now includes an optional hasError boolean. The WidgetTreeItem is also modified to forward the hasError property to its child component.

Changes

File(s) Change Summary
app/client/src/ce/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList.tsx Added new React component for displaying orphan UI module instances; currently returns null as a base implementation
app/client/src/ee/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList.tsx Added EE file that re-exports the CE component without modification
app/client/src/pages/AppIDE/components/UIEntityListTree/UIEntityListTree.tsx Imports and renders OrphanUIModuleInstancesEntityList; adds hasError property to widget items
app/client/src/pages/AppIDE/components/UIEntityListTree/WidgetTreeItem.tsx Passes new hasError prop to EntityItem
app/client/src/reducers/uiReducers/pageCanvasStructureReducer.ts Adds optional hasError property to CanvasStructure interface

Sequence Diagram(s)

sequenceDiagram
    participant UIEntityListTree
    participant OrphanUIModuleInstancesEntityList
    participant EntityListTree
    participant WidgetTreeItem
    participant EntityItem

    UIEntityListTree->>OrphanUIModuleInstancesEntityList: Render (returns null in CE)
    UIEntityListTree->>EntityListTree: Render with widget items (including hasError)
    EntityListTree->>WidgetTreeItem: Render each widget (with hasError)
    WidgetTreeItem->>EntityItem: Pass hasError prop
Loading

Suggested labels

Frontend, Task, skip-changelog, ok-to-test

Suggested reviewers

  • brayn003

Poem

In the forest of widgets, a new path appears,
Orphaned modules gather—no need for tears!
A sprinkle of errors, a property anew,
The tree now whispers, "I see what you do."
With fragments and props, the code marches on,
The UI grows stronger with each new dawn.
🌳✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

@ashit-rath ashit-rath requested a review from ankitakinger April 25, 2025 09:53
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Apr 25, 2025
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)
app/client/src/ce/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList.tsx (1)

1-15: Well-documented placeholder for orphan UI module instances

The component is well-documented with clear JSDoc comments explaining its purpose. The current implementation returns null, which is appropriate for a base CE implementation that will be extended in EE.

Consider adding PropTypes or TypeScript interface for future props this component might accept, even though it currently doesn't use any.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 25979c8 and b65ec15.

📒 Files selected for processing (5)
  • app/client/src/ce/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList.tsx (1 hunks)
  • app/client/src/ee/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList.tsx (1 hunks)
  • app/client/src/pages/AppIDE/components/UIEntityListTree/UIEntityListTree.tsx (2 hunks)
  • app/client/src/pages/AppIDE/components/UIEntityListTree/WidgetTreeItem.tsx (1 hunks)
  • app/client/src/reducers/uiReducers/pageCanvasStructureReducer.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (6)
app/client/src/reducers/uiReducers/pageCanvasStructureReducer.ts (1)

16-16: Addition of hasError property is appropriate for error tracking

This optional boolean property aligns with the PR objective to support error indication for widgets in the tree view. The change is minimal and maintains backward compatibility by making it optional.

app/client/src/pages/AppIDE/components/UIEntityListTree/WidgetTreeItem.tsx (1)

96-96: Correctly propagates hasError to EntityItem

The component now properly forwards the error state to the EntityItem component, enabling visual error indication in the UI tree.

app/client/src/ee/pages/AppIDE/components/UIEntityListTree/OrphanUIModuleInstancesEntityList.tsx (1)

1-2: Standard re-export pattern for EE extension

This follows the established pattern for CE/EE code separation, allowing for potential EE-specific extensions of this component.

app/client/src/pages/AppIDE/components/UIEntityListTree/UIEntityListTree.tsx (3)

9-9: Import added for orphaned UI module instances component.

The new import includes the OrphanUIModuleInstancesEntityList component from the enterprise edition, which will be used to display UI module instances not present on the canvas.


22-22: Added hasError property to widget tree items.

This property will be used to indicate error states in the widget tree, allowing visual error indication for widgets with broken references or other issues.


26-33: Updated component rendering to include orphaned UI modules.

The return statement now wraps content in a React fragment and renders both the original EntityListTree component and the new OrphanUIModuleInstancesEntityList component. This structure maintains the existing widget tree functionality while adding support for displaying orphaned UI module instances.

@ashit-rath ashit-rath added the ok-to-test Required label for CI label Apr 26, 2025
@ashit-rath ashit-rath merged commit b1ec758 into release Apr 26, 2025
90 checks passed
@ashit-rath ashit-rath deleted the chore/ui-module-error-states-ce branch April 26, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants