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

chore: Move smaller Entity Explorer components into ADS #38321

Merged
merged 8 commits into from
Dec 24, 2024

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Dec 23, 2024

Description

Moves the following Entity Explorer components into ADS/Templates/EntityExplorer

  • EmptyState
  • NoSearchResults
  • ExplorerContainer

Fixes #38281
Fixes #37609

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/12477432425
Commit: 41d4904
Cypress dashboard.
Tags: @tag.IDE
Spec:


Tue, 24 Dec 2024 06:00:54 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced EmptyState component as a placeholder for scenarios with no data.
    • Added NoSearchResults component for improved user feedback when searches yield no results.
    • Implemented ExplorerContainer for enhanced layout management in the Explorer section.
  • Bug Fixes

    • Updated rendering logic in various components to replace deprecated elements with new ones.
  • Documentation

    • Created Markdown files for EmptyState and NoSearchResults components, providing usage guidelines.
  • Chores

    • Removed outdated components (EmptySearchResult and EmptyState) to streamline the codebase.

Copy link
Contributor

coderabbitai bot commented Dec 23, 2024

Walkthrough

This pull request introduces several new components and utilities in the design system and editor pane, focusing on enhancing the user interface for empty states and explorer containers. The changes include creating reusable components like EmptyState, NoSearchResults, and ExplorerContainer, which provide standardized ways to handle scenarios with no data or search results. These components are designed to be flexible, customizable, and consistent across different segments of the application.

Changes

File Change Summary
ads/src/Templates/EntityExplorer/EmptyState/* New component for rendering empty states with configurable icons, descriptions, and buttons
ads/src/Templates/EntityExplorer/NoSearchResults/* New component for displaying messages when no search results are found
ads/src/Templates/EntityExplorer/ExplorerContainer/* New common container component with configurable border and styling
src/pages/Editor/IDE/* Updated to use new ADS components, replacing existing implementations

Assessment against linked issues

Objective Addressed Explanation
Create Empty State component [#38281]
Customizable title, icon, button
Support primary/secondary buttons
Add onClick prop for Button
Create common Explorer container [#37609]

Possibly related PRs

Suggested reviewers

  • albinAppsmith
  • ankitakinger
  • sagar-qa007

Poem

🌟 Empty states no more so bland,
Components crafted by a skilled hand
Containers flex, buttons shine bright
Code refactored with pure delight! 🎉
Modularity wins the day! 🚀


📜 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 e8b9521 and 41d4904.

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

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 IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Task A simple Todo labels Dec 23, 2024
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Dec 23, 2024
@hetunandu hetunandu added the ok-to-test Required label for CI label Dec 23, 2024
@hetunandu
Copy link
Member Author

/build-deploy-preview

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12466731548.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 38321.
recreate: .

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 (9)
app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.types.ts (1)

1-13: Consider Optional Fields for a More Flexible API
The current design is solid. If future requirements arise, consider making fields like “icon” optional and defaulting to a generic icon.

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

7-13: Encourage translatable string usage
For future internationalization, consider using a translation hook or utility for the displayed text.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/NoSearchResults.stories.tsx (1)

1-1: Console warnings disabled
Disabling console warnings is fine for Storybook demos, but remember to keep them enabled in production.

app/client/src/pages/Editor/IDE/EditorPane/index.tsx (1)

27-27: Clarity in width attribute
Switching from brace syntax to a direct string for width is a minor but clean improvement.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.stories.tsx (1)

35-44: Consider using safe logging or a Storybook addon.
Currently, console logs are acceptable but can be replaced with an action logger in Storybook for better traceability.

-    onClick: () => console.log("Add clicked"),
+    onClick: () => console.log("Add clicked"), // or actions('Add clicked') from '@storybook/addon-actions'
app/client/src/pages/Editor/IDE/EditorPane/JS/BlankState.tsx (1)

21-29: Using useMemo for button props is a neat optimization if re-render performance is a concern.
However, if there's no heavy logic involved, you can safely remove it to minimize complexity, unless you expect frequent re-renders.

-  const buttonProps = useMemo(
-    () => ({
-      className: "t--add-item",
-      testId: "t--add-item",
-      text: createMessage(EDITOR_PANE_TEXTS.js_add_button),
-      onClick: canCreateActions ? openAddJS : undefined,
-    }),
-    [canCreateActions, openAddJS],
-  );
+  const buttonProps = {
+    className: "t--add-item",
+    testId: "t--add-item",
+    text: createMessage(EDITOR_PANE_TEXTS.js_add_button),
+    onClick: canCreateActions ? openAddJS : undefined,
+  };
app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.tsx (1)

33-33: Use optional chaining for concise checks.
Static analysis suggests using an optional chain. Adjusting code to rely on optional chaining can make it more elegant.

-      {button && button.onClick ? (
+      {button?.onClick ? (
         <Button
           ...
         >
           {button.text}
         </Button>
       ) : null}
🧰 Tools
🪛 Biome (1.9.4)

[error] 33-33: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

app/client/src/pages/Editor/IDE/EditorPane/Explorer.tsx (1)

29-33: Minor note on border prop usage.
Using string values ("NONE", "STANDARD") helps maintain code clarity, but consider extracting them into a shared Typescript Enum for better discoverability and type safety in the future.

app/client/src/pages/Editor/IDE/LeftPane/DataSidePane.tsx (1)

97-97: Minor whitespace observation.
Ensure consistent spacing around function blocks for readability.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8a16903 and 1473bf7.

📒 Files selected for processing (28)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.mdx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.stories.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.types.ts (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/index.ts (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/ExplorerContainer.constants.ts (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/ExplorerContainer.stories.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/ExplorerContainer.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/ExplorerContainer.types.ts (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/index.ts (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/NoSearchResults.mdx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/NoSearchResults.stories.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/NoSearchResults.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/NoSearchResults.types.ts (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/index.ts (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/index.ts (1 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/Explorer.tsx (3 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/JS/Add.tsx (2 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/JS/BlankState.tsx (3 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/JS/List.tsx (2 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/Query/Add.tsx (2 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/Query/BlankState.tsx (2 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/Query/List.tsx (2 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/UI/List.tsx (4 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/components/EmptySearchResult.tsx (0 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/components/EmptyState.tsx (0 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/index.tsx (3 hunks)
  • app/client/src/pages/Editor/IDE/LeftPane/DataSidePane.tsx (4 hunks)
💤 Files with no reviewable changes (2)
  • app/client/src/pages/Editor/IDE/EditorPane/components/EmptyState.tsx
  • app/client/src/pages/Editor/IDE/EditorPane/components/EmptySearchResult.tsx
✅ Files skipped from review due to trivial changes (5)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/ExplorerContainer.constants.ts
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/index.ts
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/index.ts
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/NoSearchResults.mdx
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/index.ts
🧰 Additional context used
🪛 Biome (1.9.4)
app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.tsx

[error] 33-33: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

app/client/src/pages/Editor/IDE/EditorPane/UI/List.tsx

[error] 50-50: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (65)
app/client/src/pages/Editor/IDE/EditorPane/Query/BlankState.tsx (4)

1-1: Nice usage of useMemo for performance optimization
By selectively importing and using React hooks, we reduce unnecessary re-renders.


9-9: Correct import path alignment
Referencing EmptyState from @appsmith/ads correctly centralizes and standardizes design components.


21-29: Good approach for encapsulating button properties
Using useMemo to define buttonProps helps avoid recreating object literals on every render, enhancing performance and maintainability.


33-33: Appropriate usage of the button prop
Passing the computed buttonProps object to the EmptyState component keeps the code clean and consistent.

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

1-3: Straightforward Interface Definition
This interface is minimal and sufficiently clear for usage.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/index.ts (1)

5-7: All Exports are Appropriately Located
Export statements are concise and organized. No issues found.

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

1-10: Well-Structured Props
The interface is clearly defined, ensuring type safety for border style usage. Looks good.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/NoSearchResults.tsx (3)

2-2: Imported component usage is clear and consistent
The import from "../../.." for the Text component is good practice within a shared design system.


5-6: Minimal and effective functional component
The component signature is succinct and properly types its props.


17-17: Export statement
Exporting the component at the end is a straightforward approach that promotes clarity.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/ExplorerContainer.tsx (2)

2-2: Centralized constants
Importing ExplorerContainerBorder ensures consistent styling across the application. Nicely done.


5-18: Well-structured container component
The use of Flex for layout and the typed props for border, width, and height make the component highly reusable.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/NoSearchResults/NoSearchResults.stories.tsx (3)

5-5: Component import is consistent
The import statement follows a clear, predictable structure for design system components.


14-18: Simple and effective Storybook template
This is straightforward, allowing testers to validate different text content easily.


20-24: Basic story with sensible default
Providing a default text prop value helps others quickly grasp the component's purpose.

app/client/src/pages/Editor/IDE/EditorPane/index.tsx (2)

2-2: Border constants usage
Using ExplorerContainerBorder here increases maintainability and consistency across the IDE.


17-18: Semantic condition for border
Defining the standard vs. none border in a conditional expression is clear, avoiding magic strings.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.stories.tsx (2)

1-1: Good use of ESLint disable for console logs in Storybook.
This is acceptable for a Storybook environment where console output helps demonstrate interactions.


14-26: General structure and usage look solid.
The props interface is clearly used, and the minimal code in the template ensures readability. Good job!

app/client/packages/design-system/ads/src/Templates/EntityExplorer/ExplorerContainer/ExplorerContainer.stories.tsx (4)

1-1: ESLint rule disable for console logs is acceptable for stories.
No issues here.


14-19: Good approach to managing borderRight with a select control.
This ensures an intuitive demonstration in Storybook for different layouts.


23-37: Template is concise and reusable.
The destructuring approach for props keeps it clear. Nothing further to address here.


39-54: Smart usage of children for better composition.
No immediate refactoring suggestions. Nicely done.

app/client/src/pages/Editor/IDE/EditorPane/JS/BlankState.tsx (1)

33-33: Good usage of the new button prop in EmptyState.
This is consistent with the new approach across the codebase; no additional suggestions here.

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

5-46: Overall structure is well-organized.
The component properly handles optional props and gracefully renders a button when available.

🧰 Tools
🪛 Biome (1.9.4)

[error] 33-33: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

app/client/src/pages/Editor/IDE/EditorPane/Explorer.tsx (2)

2-2: Good adoption of the new container.
Switching from a standard layout component to the specialized ExplorerContainer is a neat step towards consistency.


60-60: ExplorerContainer usage looks good.
No issues noted in the container’s closing tag or children structure.

app/client/src/pages/Editor/IDE/EditorPane/Query/Add.tsx (2)

2-7: Import statements for new UI components.
These imports look correct for the new design system items. No conflicts or mistakes noted here.


72-76: Enhanced user feedback for empty results.
Replacing the old component with NoSearchResults is a good step to unify the design pattern. The dynamic text prop usage correctly supplies relevant messages.

app/client/src/pages/Editor/IDE/EditorPane/JS/Add.tsx (2)

5-5: Import statements correctly updated.
Switching to NoSearchResults aligns with the new design approach.


100-104: Meaningful error message for empty search results.
The new component helps provide better feedback when a user can’t find a JS object. The code is clear and matches the usage pattern seen elsewhere.

app/client/src/pages/Editor/IDE/EditorPane/UI/List.tsx (6)

15-15: Updated import for EmptyState.
Adopting the new design system component for blank states is consistent with the PR’s objective.


29-29: Destructuring props.
Directly destructuring setFocusSearchInput is a stylistic improvement for readability.


45-47: Function call referencing up-to-date prop.
setFocusSearchInput is invoked before redirecting, ensuring the search input is focused after navigation.


52-58: Clear effect to reset the focus flag.
The inline named function resetFocusOnSearch is more readable and explicit. Good call.


59-67: Memoization for button props.
Extracting blankStateButtonProps ensures stable references and avoids unnecessary re-renders.


79-79: Consistent styling for EmptyState.
Providing a custom description and icon with the cohesive design system button makes the empty state more engaging.

app/client/src/pages/Editor/IDE/EditorPane/Query/List.tsx (2)

2-2: Good addition of NoSearchResults component.
Imports look consistent with the new ADS library usage.


97-101: Clear usage of NoSearchResults for handling empty states.
The updated component seamlessly replaces the old one, matching the existing design patterns.

app/client/src/pages/Editor/IDE/EditorPane/JS/List.tsx (2)

3-3: Consistent import of NoSearchResults.
This keeps the UI aligned with other modules.


113-117: Appropriate conditional rendering for search results.
The newly employed NoSearchResults component is well integrated here.

app/client/src/pages/Editor/IDE/LeftPane/DataSidePane.tsx (6)

1-1: Smart usage of hooks.
Adding useMemo and useCallback enhances performance on re-renders.


30-30: Migration to the EmptyState from ADS.
Good step towards consistent design across the application.


89-89: Well-defined callback.
This is straightforward, improving clarity on how datasources are handled.


96-96: Economic reliance on basePageId in dependency array.
Good practice to avoid re-creating the callback unnecessarily.


98-106: Structured props for the EmptyState button.
Use of useMemo ensures stable references and prevents excessive re-renders.


126-126: Seamless integration of the button props into EmptyState.
Enhances user engagement by guiding them to add new datasources.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.mdx (18)

1-1: Proper Storybook imports.
This ensures consistent component documentation.


3-3: Adherence to single source of truth for stories.
Promotes centralized and reusable story definitions.


5-5: Meta usage is correct.
It binds the documentation to the relevant stories.


7-7: Clear top-level heading.
A concise title helps maintain the documentation’s structure.


9-9: Straightforward description.
Users gain immediate clarity on Empty State usage.


11-11: Logical organization with sub-headings.
Easy to navigate for developers.


13-13: Relevant mention of the icon element.
Helps define critical UI elements succinctly.


15-15: Short descriptor of message usage.
Keeps interactions minimal yet informative.


17-17: Optional button note.
Clear mention that the button is not mandatory.


19-19: Subheading for default usage.
Effectively separates different component states.


21-21: Docs referencing default usage example.
Good demonstration for new adopters.


23-23: Canvas usage for Basic story.
Ensures the actual component is previewed.


25-25: Heading for variations with button.
Organized approach to highlight advanced usage.


27-27: Explanation of button props.
Integrates seamlessly with component usage details.


29-29: Canvas rendering for WithButton.
Exemplifies usage in real scenarios.


31-31: Subsection exploring button without onClick.
Addresses possible usage scenarios thoroughly.


33-33: Optional nature of onClick is clarified.
Misdirected usage is avoided by clarifying default hide.


35-35: Canvas demonstration for WithButtonWithoutOnClick.
Effective for crossover or partial usage.

Copy link

Deploy-Preview-URL: https://ce-38321.dp.appsmith.com

@hetunandu
Copy link
Member Author

/build-deploy-preview

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12477172807.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 38321.
recreate: .

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 (3)
app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.types.ts (1)

1-1: Consider using more specific imports

The relative import path ../../.. is not very maintainable. Consider using a more specific path or setting up path aliases.

app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.tsx (2)

5-46: Component structure looks good with a suggestion for improvement

The component is well-structured and follows design system patterns. However, the button rendering condition can be simplified using optional chaining.

Consider this improvement:

-      {button && button.onClick ? (
+      {button?.onClick ? (
🧰 Tools
🪛 Biome (1.9.4)

[error] 33-33: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


34-42: Consider adding aria-label for accessibility

The button implementation looks good, but consider adding an aria-label for better accessibility.

 <Button
   className={button.className}
   data-testid={button.testId}
   kind={button.kind || "secondary"}
   onClick={button.onClick}
   size="sm"
+  aria-label={`${description} action button`}
 >
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1473bf7 and e8b9521.

📒 Files selected for processing (2)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.types.ts (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.tsx

[error] 33-33: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (2)
app/client/packages/design-system/ads/src/Templates/EntityExplorer/EmptyState/EmptyState.types.ts (1)

3-13: LGTM! Well-structured interface definition

The interface is well-defined with proper types and optional properties. Good job on restricting the ButtonKind to specific variants.

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

7-25: Excellent use of design system tokens

Good job using design system variables for spacing, colors, and border radius. The icon container's styling is consistent with the design system.

Copy link

Deploy-Preview-URL: https://ce-38321.dp.appsmith.com

@hetunandu hetunandu enabled auto-merge (squash) December 24, 2024 05:51
@hetunandu hetunandu merged commit ddb83c0 into release Dec 24, 2024
49 of 50 checks passed
@hetunandu hetunandu deleted the chore/add-list-empty-state-ads branch December 24, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a component for Empty State in List View Create a common container component with styles
2 participants