Skip to content

fix: Handling erroneous state in Entity item ADS template #40363

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 2 commits into from
Apr 24, 2025

Conversation

ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented Apr 24, 2025

Description

Handling erroneous state in Entity item ADS template

Fixes #40362

Automation

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

🔍 Cypress test results

Tip

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


Thu, 24 Apr 2025 11:32:13 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Entity names now visually indicate errors by displaying in a distinct color when an error state is present.
  • Style
    • Enhanced visual feedback for entities with errors, improving clarity when issues occur.

@ankitakinger ankitakinger requested a review from a team as a code owner April 24, 2025 10:50
@ankitakinger ankitakinger added the ok-to-test Required label for CI label Apr 24, 2025
Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

Walkthrough

The changes introduce an error state visual indicator for entities in the Entity Explorer. This is achieved by adding an optional hasError boolean property to relevant type definitions and component props. The EditableEntityName component now conditionally styles its text color to indicate an error when hasError is true. The EntityItem component is updated to pass this prop to EditableEntityName, and the EntityListTreeItem type now supports the hasError property, enabling error state propagation throughout the entity explorer hierarchy.

Changes

Files / Groups Change Summary
EditableEntityName.tsx, EditableEntityName.types.ts Added hasError prop to component and its props interface; conditionally renders error color.
EntityItem.tsx Passes hasError prop from parent to EditableEntityName for error state rendering.
EntityListTree.types.ts Added optional hasError property to EntityListTreeItem interface.

Sequence Diagram(s)

sequenceDiagram
    participant EntityListTree as EntityListTreeItem
    participant EntityItem
    participant EditableEntityName

    EntityListTree->>EntityItem: Passes hasError property
    EntityItem->>EditableEntityName: Passes hasError property
    EditableEntityName->>EditableEntityName: Renders text with error color if hasError is true
Loading

Assessment against linked issues

Objective Addressed Explanation
Display error state for broken JS and query module instances in entity explorer (#40362)

Suggested reviewers

  • hetunandu

Poem

In the explorer’s tree, a bug once crept,
Error states hidden, while users wept.
Now with a color—crimson and bright—
Broken modules come into sight.
With hasError in tow,
The warnings now show,
Making debugging a little more light!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 08f5050 and c9b2437.

📒 Files selected for processing (1)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityItem/EntityItem.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityItem/EntityItem.tsx

🪧 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 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.

@ankitakinger ankitakinger requested review from hetunandu and ashit-rath and removed request for a team April 24, 2025 10:50
@github-actions github-actions bot added Bug Something isn't working IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE labels Apr 24, 2025
hetunandu
hetunandu previously approved these changes Apr 24, 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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4dbd235 and 08f5050.

📒 Files selected for processing (4)
  • app/client/packages/design-system/ads/src/Templates/EditableEntityName/EditableEntityName.tsx (2 hunks)
  • app/client/packages/design-system/ads/src/Templates/EditableEntityName/EditableEntityName.types.ts (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityItem/EntityItem.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.types.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-build / client-build
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: storybook-tests
  • GitHub Check: chromatic-deployment
  • GitHub Check: chromatic-deployment
🔇 Additional comments (3)
app/client/packages/design-system/ads/src/Templates/EntityExplorer/EntityListTree/EntityListTree.types.ts (1)

9-9: LGTM: Good addition to support error state indication

This is a clean addition that allows tree items to represent their error state, which aligns with the PR objective.

app/client/packages/design-system/ads/src/Templates/EditableEntityName/EditableEntityName.types.ts (1)

30-31: LGTM: Well-documented property addition

Good documentation with a proper JSDoc comment. The optional property allows for backward compatibility.

app/client/packages/design-system/ads/src/Templates/EditableEntityName/EditableEntityName.tsx (1)

19-19: LGTM: Clean implementation of error state visualization

Good implementation that properly visualizes the error state by conditionally applying the appropriate color from the design system. The use of CSS variables maintains consistency with the design system's color palette.

Also applies to: 110-110

@ankitakinger ankitakinger merged commit 49a926e into release Apr 24, 2025
52 checks passed
@ankitakinger ankitakinger deleted the fix/error-state-entity-item branch April 24, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Production Query Widgets & IDE Pod All issues related to Query, JS, Eval, Widgets & IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Broken JS and query module instances error state is missing in entity explorer
2 participants