Skip to content

chore: Replacing entity item component in schema tables with the new List item component in ADS#38987

Merged
ankitakinger merged 5 commits intoreleasefrom
chore/replace-list-items-schema-tables
Feb 4, 2025
Merged

chore: Replacing entity item component in schema tables with the new List item component in ADS#38987
ankitakinger merged 5 commits intoreleasefrom
chore/replace-list-items-schema-tables

Conversation

@ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented Feb 3, 2025

Description

Replacing entity item component in schema tables with the new List item component in ADS

Fixes #38292

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/13130548638
Commit: a280e47
Cypress dashboard.
Tags: @tag.All
Spec:


Tue, 04 Feb 2025 09:17:45 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Improved API action selection with refined filtering to ensure accurate plugin association.
  • Refactor

    • Updated the datasource structure view for a streamlined and simplified list presentation.
  • Style

    • Modernized styling across the datasource tab and schema view, including adjusted spacing.
    • Enhanced icon appearance for more consistent visual cues.
    • Added testability attributes to list items for improved automated testing support.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2025

Walkthrough

This pull request introduces several targeted changes across the UI components. The styling of Datasource tabs has been updated with modified CSS selectors and spacing adjustments. The plugin filtering logic in GlobalSearchHooks has been refined by leveraging a new type. Additionally, the Datasource structure rendering has been revamped by replacing the Entity component with a ListItem from the ADS library and removing virtualization, and a minor change was made to the datasource icon export.

Changes

File(s) Changed Summary of Changes
app/client/src/PluginActionEditor/.../DatasourceTab/styles.ts
app/client/src/pages/Editor/DatasourceInfo/SchemaViewModeCSS.tsx
Updated styling selectors and properties: switched from .t--entity-item to .ads-v2-listitem, adjusted/hid icon display, altered padding and removed hover effects.
app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx
app/client/src/pages/Editor/Explorer/ExplorerIcons.tsx
Replaced the Entity component with the ADS ListItem component (and added a new styled list), removed Virtuoso virtualization, and added a specific CSS class to the datasource icon for refined styling.
app/client/src/components/editorComponents/GlobalSearch/GlobalSearchHooks.tsx Enhanced plugin filtering in updateActionOperations by importing UIComponentTypes and checking for both plugin type and uiComponent before assigning the pluginId.

Sequence Diagram(s)

sequenceDiagram
    participant UI as GlobalSearch UI
    participant Handler as updateActionOperations
    participant PluginList as Plugin Collection
    UI->>Handler: Initiate update of action operations
    Handler->>PluginList: Filter plugins (type: API & uiComponent: ApiEditorForm)
    PluginList-->>Handler: Return matching plugin (if exists)
    Handler->>UI: Update action operation with pluginId
Loading

Assessment against linked issues

Objective Addressed Explanation
Replace Entity List Tree Item with EntityGroupedList and retain test ids [#38292] Replaced Entity with ListItem instead of EntityGroupedList; no explicit handling of test IDs.

Possibly related PRs

Suggested labels

Bug, User Testing, Design System Product

Suggested reviewers

  • sagar-qa007
  • ApekshaBhosale
  • albinAppsmith

Poem

Code refactors dance in the light,
Styling refinements take flight.
A new look for lists and icons gleams,
With logic tuned to meet fresh dreams.
Cheers to the change—our code redeems!
🚀🎉

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.

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.

@ankitakinger ankitakinger added the ok-to-test Required label for CI label Feb 3, 2025
@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 Low An issue that is neither critical nor breaks a user flow Task A simple Todo skip-changelog Adding this label to a PR prevents it from being listed in the changelog labels Feb 3, 2025
@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

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

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

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

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/13121666939.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 38987.
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

🔭 Outside diff range comments (1)
app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (1)

92-94: Address TODO and type safety concerns.

The TODO comment with eslint-disable for explicit any type should be addressed. Consider typing the event parameter properly.

-  // TODO: Fix this the next time the file is edited
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
-  const onEntityClick = (entity: any) => {
+  const onEntityClick = (entity: React.MouseEvent<HTMLDivElement>) => {
🧹 Nitpick comments (1)
app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (1)

175-184: Consider performance implications of removing virtualization.

Replacing virtualization with direct mapping could impact performance when rendering large datasets. Consider keeping virtualization for better performance or document the maximum expected number of items.

If the number of tables can be large, consider using a virtualized list library like react-window or react-virtualized.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 37a1ebb and 517d590.

📒 Files selected for processing (1)
  • app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-unit-tests / client-unit-tests
  • 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 (3)
app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (3)

13-21: LGTM! Import changes align with PR objectives.

The imports from @appsmith/ads are appropriate for the new List item component implementation.


150-158: LGTM! ListItem implementation is clean.

The ListItem props are well-mapped and maintain the required functionality from the previous Entity component.


57-59: Verify the visual impact of padding removal.

The removal of padding might affect the visual spacing of list items. Please ensure this doesn't create any alignment or spacing issues with the new List component.

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

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

@appsmithorg appsmithorg deleted a comment from github-actions bot Feb 3, 2025
@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/13122482196.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 38987.
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

🔭 Outside diff range comments (1)
app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (1)

92-94: Fix TODO and improve type safety.

The TODO comment and any type should be addressed.

-  // TODO: Fix this the next time the file is edited
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
-  const onEntityClick = (entity: any) => {
+  const onEntityClick = (event: React.MouseEvent<HTMLDivElement>) => {
🧹 Nitpick comments (1)
app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (1)

1-2: Consider removing unnecessary EntityClassNames import.

The EntityClassNames import is only used for a CSS class name string. Consider defining this locally since we're moving away from the Entity component.

-import { EntityClassNames } from "../Explorer/Entity";
+const CONTEXT_MENU_CLASS = "t--template-menu-trigger";
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 517d590 and 273b7fd.

📒 Files selected for processing (3)
  • app/client/packages/design-system/ads/src/List/List.tsx (1 hunks)
  • app/client/packages/design-system/ads/src/List/List.types.tsx (1 hunks)
  • app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: chromatic-deployment
  • GitHub Check: chromatic-deployment
  • GitHub Check: storybook-tests
🔇 Additional comments (5)
app/client/packages/design-system/ads/src/List/List.types.tsx (1)

39-40: LGTM! Well-documented test ID property.

The addition of the optional dataTestId property follows the existing pattern and is properly documented.

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

127-127: LGTM! Proper implementation of test ID attribute.

The data-testid attribute is correctly implemented using the new prop.

app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (3)

57-59: LGTM!

The StyledList component is appropriately styled for the list container.


150-158: LGTM! Clean transition to ListItem component.

The ListItem implementation maintains feature parity with the previous Entity component while providing a cleaner interface.


175-184: Consider performance impact of removing virtualization.

Removing the Virtuoso component means all items will be rendered at once. This could impact performance for large datasets.

Let's check if there are any datasources with large numbers of tables:

✅ Verification successful

Performance Impact Consideration: Removal of Virtuoso vs. Real-World Data Sizes

Based on our search, the "tables" arrays in the codebase appear mainly in unit test data (e.g., the references in unitTestUtils.ts and HideGeneratePageButton.test.tsx) and do not reveal evidence of production datasources with a large number of tables. While we acknowledge that rendering all items at once could impact performance if a datasource were to include many tables, current usage seems limited to small datasets. Still, keep an eye on performance if you anticipate datasources growing significantly.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for table array definitions or assignments
rg -A 5 "tables:\s*\[|tables\s*=\s*\[" --type typescript

Length of output: 93


Script:

#!/bin/bash
# Re-run search for table array definitions or assignments in TS/TSX files using glob patterns instead of file type
rg -A 5 "tables:\s*\[|tables\s*=\s*\[" --glob "*.ts" --glob "*.tsx"

Length of output: 2775

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

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

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link

github-actions bot commented Feb 4, 2025

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/13130579582.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 38987.
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 (2)
app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (2)

2-2: Consider removing unused EntityClassNames import.

The EntityClassNames import is only used for a CSS class name. Consider moving this class name to a constants file or updating it to match the new ListItem component naming convention.


146-154: Update className to match new component.

The className still references the old entity component (t--entity-item). Consider updating it to match the new ListItem component convention for consistency.

-      className={`datasourceStructure-${props.context} t--entity-item`}
+      className={`datasourceStructure-${props.context} t--list-item`}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 273b7fd and a280e47.

📒 Files selected for processing (1)
  • app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: storybook-tests
  • GitHub Check: chromatic-deployment
  • GitHub Check: chromatic-deployment
🔇 Additional comments (1)
app/client/src/pages/Editor/DatasourceInfo/DatasourceStructure.tsx (1)

184-188: LGTM! Virtualization correctly maintained.

Good job maintaining the Virtuoso implementation for performance optimization, as highlighted in previous reviews.

@github-actions
Copy link

github-actions bot commented Feb 4, 2025

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

@ankitakinger ankitakinger merged commit 71cab98 into release Feb 4, 2025
91 checks passed
@ankitakinger ankitakinger deleted the chore/replace-list-items-schema-tables branch February 4, 2025 09:22
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
…List item component in ADS (appsmithorg#38987)

## Description

Replacing entity item component in schema tables with the new List item
component in ADS

Fixes [appsmithorg#38292](appsmithorg#38292)

## Automation

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

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13130548638>
> Commit: a280e47
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13130548638&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Tue, 04 Feb 2025 09:17:45 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Improved API action selection with refined filtering to ensure
accurate plugin association.

- **Refactor**
- Updated the datasource structure view for a streamlined and simplified
list presentation.

- **Style**
- Modernized styling across the datasource tab and schema view,
including adjusted spacing.
  - Enhanced icon appearance for more consistent visual cues.
- Added testability attributes to list items for improved automated
testing support.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai bot mentioned this pull request Mar 12, 2025
2 tasks
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 Low An issue that is neither critical nor breaks a user flow 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.

Replace Entity List Tree Item in Schema tables

2 participants