Skip to content

chore: move chat widget to EE repo#36845

Merged
KelvinOm merged 1 commit intoreleasefrom
chore/ai-chat-ee
Oct 14, 2024
Merged

chore: move chat widget to EE repo#36845
KelvinOm merged 1 commit intoreleasefrom
chore/ai-chat-ee

Conversation

@KelvinOm
Copy link
Collaborator

@KelvinOm KelvinOm commented Oct 11, 2024

Description

I deleted all the code associated with the AI chat widget from CE and moved it to EE. In order for the code splitting to work correctly, I created two empty files:

Related EE PR — https://github.com/appsmithorg/appsmith-ee/pull/5333

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/11324026199
Commit: 2e41096
Cypress dashboard.
Tags: @tag.All
Spec:


Mon, 14 Oct 2024 10:04:39 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced new constants and variables for enhanced widget mapping and configuration.
  • Bug Fixes

    • Removed outdated components and exports from the AIChat and ChatInput modules to streamline functionality.
  • Chores

    • Cleaned up unused files and exports to improve codebase maintainability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2024

Walkthrough

This pull request involves the removal of several components and their associated exports from the AIChat and ChatInput widgets within the design system. Key components such as AIChat, AssistantSuggestionButton, ChatDescriptionModal, ChatTitle, ThreadMessage, and UserAvatar have been eliminated, along with their respective types and styles. Additionally, the exports related to these components have been removed from the main index files. Some constants and variables have been added or updated in other parts of the codebase.

Changes

File Path Change Summary
app/client/packages/design-system/widgets/src/components/AIChat/index.ts Export removed: export * from "./src";
app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx Component removed: export const AIChat = forwardRef(_AIChat);
app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/* Component and exports removed for AssistantSuggestionButton and related types.
app/client/packages/design-system/widgets/src/components/AIChat/src/ChatDescriptionModal/* Component and exports removed for ChatDescriptionModal and related types.
app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/* Component and exports removed for ChatTitle and related types.
app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/* Component and exports removed for ThreadMessage and related types.
app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/* Component and exports removed for UserAvatar and related types, including CSS class .root.
app/client/packages/design-system/widgets/src/components/AIChat/src/types.ts Interfaces removed: ChatMessage, AIChatProps.
app/client/packages/design-system/widgets/src/components/AIChat/stories/AIChat.stories.tsx File deleted: AIChat.stories.tsx.
app/client/packages/design-system/widgets/src/components/ChatInput/* Component and exports removed for ChatInput and related types.
app/client/packages/design-system/widgets/src/index.ts Exports removed for AIChat and ChatInput.
app/client/src/ee/modules/ui-builder/ui/wds/constants.ts Constant added: WDS_EE_WIDGET_MAP.
app/client/src/ee/modules/ui-builder/ui/wds/index.ts Variable added: export const EEWDSWidgets = [];.
app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/* Exports and configurations removed for WDSAIChatWidget.
app/client/src/modules/ui-builder/ui/wds/constants.ts Variable updated: WDS_V2_WIDGET_MAP.
app/client/src/widgets/index.ts Variable updated: const Widgets.

Possibly related PRs

Suggested reviewers

  • subrata71
  • mohanarpit
  • AnaghHegde

🎉 In the land of code, where widgets once thrived,
Components were dancing, but now they've all dived.
AIChat and friends, they’ve taken their leave,
A cleaner design, we shall now believe!
With exports all tidied, the codebase feels light,
Onward we march, to new features in sight! 🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c88a739 and 2e41096.

📒 Files selected for processing (26)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/AssistantSuggestionButton.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/styles.module.css (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/styles.module.css (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/stories/AIChat.stories.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/ChatInput/src/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/ChatInput/stories/ChatInput.stories.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/index.ts (0 hunks)
  • app/client/src/ee/modules/ui-builder/ui/wds/constants.ts (1 hunks)
  • app/client/src/ee/modules/ui-builder/ui/wds/index.ts (1 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/index.tsx (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/anvilConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/autocompleteConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/defaultConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/index.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/metaConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/methodsConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneContent.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneStyle.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/constants.ts (2 hunks)
  • app/client/src/widgets/index.ts (2 hunks)
💤 Files with no reviewable changes (22)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/AssistantSuggestionButton.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/styles.module.css
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/types.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/styles.module.css
  • app/client/packages/design-system/widgets/src/components/AIChat/src/types.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/stories/AIChat.stories.tsx
  • app/client/packages/design-system/widgets/src/components/ChatInput/src/index.ts
  • app/client/packages/design-system/widgets/src/components/ChatInput/stories/ChatInput.stories.tsx
  • app/client/packages/design-system/widgets/src/index.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/index.tsx
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/anvilConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/autocompleteConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/defaultConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/index.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/metaConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/methodsConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneContent.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneStyle.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • app/client/src/ee/modules/ui-builder/ui/wds/constants.ts
  • app/client/src/ee/modules/ui-builder/ui/wds/index.ts
  • app/client/src/modules/ui-builder/ui/wds/constants.ts
  • app/client/src/widgets/index.ts

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

@KelvinOm KelvinOm added the ok-to-test Required label for CI label Oct 11, 2024
@KelvinOm KelvinOm requested review from jsartisan, riodeuno and znamenskii-ilia and removed request for jsartisan, riodeuno and znamenskii-ilia October 11, 2024 14:08
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Oct 11, 2024
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: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ef5a253 and 9a1ab29.

📒 Files selected for processing (46)
  • app/client/packages/design-system/widgets/src/components/AIChat/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/AssistantSuggestionButton.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/styles.module.css (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatDescriptionModal/ChatDescriptionModal.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatDescriptionModal/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatDescriptionModal/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/ChatTitle.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/styles.module.css (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/ThreadMessage.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/styles.module.css (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/UserAvatar.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/styles.module.css (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/styles.module.css (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/src/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/stories/AIChat.stories.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/AIChat/tests/AIChat.test.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/ChatInput/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/ChatInput/src/ChatInput.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/components/ChatInput/src/index.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/ChatInput/src/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/ChatInput/stories/ChatInput.stories.tsx (0 hunks)
  • app/client/packages/design-system/widgets/src/index.ts (0 hunks)
  • app/client/src/ee/modules/ui-builder/ui/wds/constants.ts (1 hunks)
  • app/client/src/ee/modules/ui-builder/ui/wds/index.ts (1 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/index.tsx (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/anvilConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/autocompleteConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/defaultConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/index.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/metaConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/methodsConfig.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneContent.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneStyle.ts (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx (0 hunks)
  • app/client/src/modules/ui-builder/ui/wds/constants.ts (2 hunks)
  • app/client/src/widgets/index.ts (2 hunks)
💤 Files with no reviewable changes (42)
  • app/client/packages/design-system/widgets/src/components/AIChat/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AIChat.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/AssistantSuggestionButton.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/styles.module.css
  • app/client/packages/design-system/widgets/src/components/AIChat/src/AssistantSuggestionButton/types.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatDescriptionModal/ChatDescriptionModal.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatDescriptionModal/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatDescriptionModal/types.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/ChatTitle.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/styles.module.css
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ChatTitle/types.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/ThreadMessage.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/styles.module.css
  • app/client/packages/design-system/widgets/src/components/AIChat/src/ThreadMessage/types.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/UserAvatar.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/styles.module.css
  • app/client/packages/design-system/widgets/src/components/AIChat/src/UserAvatar/types.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/index.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/src/styles.module.css
  • app/client/packages/design-system/widgets/src/components/AIChat/src/types.ts
  • app/client/packages/design-system/widgets/src/components/AIChat/stories/AIChat.stories.tsx
  • app/client/packages/design-system/widgets/src/components/AIChat/tests/AIChat.test.tsx
  • app/client/packages/design-system/widgets/src/components/ChatInput/index.ts
  • app/client/packages/design-system/widgets/src/components/ChatInput/src/ChatInput.tsx
  • app/client/packages/design-system/widgets/src/components/ChatInput/src/index.ts
  • app/client/packages/design-system/widgets/src/components/ChatInput/src/types.ts
  • app/client/packages/design-system/widgets/src/components/ChatInput/stories/ChatInput.stories.tsx
  • app/client/packages/design-system/widgets/src/index.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/index.tsx
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/anvilConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/autocompleteConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/defaultConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/index.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/metaConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/methodsConfig.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneContent.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/config/propertyPaneStyle.ts
  • app/client/src/modules/ui-builder/ui/wds/WDSAIChatWidget/widget/index.tsx
✅ Files skipped from review due to trivial changes (1)
  • app/client/src/ee/modules/ui-builder/ui/wds/index.ts
🧰 Additional context used
🔇 Additional comments (3)
app/client/src/ee/modules/ui-builder/ui/wds/constants.ts (1)

1-1: Class, let's examine this new addition to our codebase!

Alright, students, gather 'round! Today, we're looking at a fresh piece of code that's just joined our project. Can anyone tell me what we see here?

That's right! We have a new constant called WDS_EE_WIDGET_MAP. Now, who can tell me what's special about this constant? Yes, you in the back! Exactly, it's currently an empty object.

But don't be fooled by its emptiness, class. This little constant is like a blank canvas, ready for future masterpieces. It's been exported, which means it's eager to be used in other parts of our application when the time comes.

Remember, in programming, sometimes we prepare the ground before we plant the seeds. That's exactly what we're doing here!

Any questions? No? Then let's give this code a gold star and move on to our next lesson!

app/client/src/modules/ui-builder/ui/wds/constants.ts (1)

66-67: Now, let's turn our attention to the changes in our WDS_V2_WIDGET_MAP, class.

Can anyone spot the differences in our widget map? Yes, that's right! We've made two important changes:

  1. We've removed the WDS_AI_CHAT_WIDGET. Can anyone tell me why we might have done this? That's correct! It's part of our plan to move the chat widget to the Enterprise Edition repository.

  2. We've added a spread operator to include all entries from WDS_EE_WIDGET_MAP. This is a very clever way to combine our widget mappings, isn't it?

These changes show good modular design. We're keeping our code organized and making it easier to manage different editions of our software. Well done!

However, we must be careful. Can anyone think of any potential issues this might cause? That's right - we need to ensure that there are no naming conflicts between the Community Edition and Enterprise Edition widgets.

Let's run a quick check to make sure everything is in order:

#!/bin/bash
# Verify the contents of WDS_EE_WIDGET_MAP and check for potential conflicts

# Check the contents of WDS_EE_WIDGET_MAP
echo "Contents of WDS_EE_WIDGET_MAP:"
rg --type typescript "WDS_EE_WIDGET_MAP\s*=\s*{" -A 20 "ee/modules/ui-builder/ui/wds/constants"

# Check for any duplicate keys between WDS_V2_WIDGET_MAP and WDS_EE_WIDGET_MAP
echo "Checking for potential naming conflicts:"
rg --type typescript "WDS_V2_WIDGET_MAP\s*=\s*{" -A 50 "app/client/src/modules/ui-builder/ui/wds/constants.ts" | rg ":\s*" | cut -d ":" -f 1 | sort > ce_widgets.txt
rg --type typescript "WDS_EE_WIDGET_MAP\s*=\s*{" -A 20 "ee/modules/ui-builder/ui/wds/constants" | rg ":\s*" | cut -d ":" -f 1 | sort > ee_widgets.txt
echo "Duplicate widget names (if any):"
comm -12 ce_widgets.txt ee_widgets.txt
rm ce_widgets.txt ee_widgets.txt
app/client/src/widgets/index.ts (1)

Line range hint 1-194: Class dismissed, but here's your homework!

Excellent work today, students. We've learned about an important change in our widget management system. To recap:

  1. We've imported new Enterprise Edition widgets.
  2. These widgets have been integrated into our main Widgets array.

For your homework, I want you to consider the following:

  1. How might this change affect our application's performance?
  2. What additional tests should we implement to ensure these new widgets work correctly with our existing ones?
  3. Are there any potential naming conflicts we should be aware of?

Remember, in software development, every change, no matter how small, can have far-reaching consequences. Always think critically and test thoroughly!

As an extra credit assignment, run this command to check for any potential naming conflicts:

This will help us identify any widget names that might be duplicated between our Community Edition and Enterprise Edition. Good luck, and see you next class!

Comment on lines +1 to +3
import { getCanvasClassName } from "utils/generators";
import { WDS_EE_WIDGET_MAP } from "ee/modules/ui-builder/ui/wds/constants";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Class, it appears we've encountered some issues with our import statements.

After running our verification scripts, we found that the modules we're trying to import do not exist at the specified paths:

  1. utils/generators: The module for getCanvasClassName wasn't found.
  2. ee/modules/ui-builder/ui/wds/constants.ts: The WDS_EE_WIDGET_MAP export is missing.

These missing modules can lead to errors and hinder the functionality of our UI builder. Let's make sure to:

  • Verify the correct paths for these imports.
  • Ensure that the modules are present in the repository.
  • Update the import statements accordingly to reflect any changes in the directory structure.

Keep up the good work, and let's address these issues to maintain the integrity of our codebase!

🔗 Analysis chain

Class, let's examine the changes in our import statements.

I see that we've made some adjustments to our module imports. Can anyone tell me what's different?

  1. We've simplified the import for getCanvasClassName. This is good practice, children. It makes our code cleaner and easier to maintain.

  2. We've added a new import WDS_EE_WIDGET_MAP from an Enterprise Edition module. This is interesting! It suggests we're incorporating some advanced features.

Now, can anyone think of any potential issues we should be aware of with these changes?

Let's double-check that these imports are working correctly:


Alright, class, let's address the issues we've encountered with our previous script.

It looks like our regex patterns were a bit off, causing those pesky parse errors. Additionally, since the comm command isn't available, we'll need to find another way to check for duplicate widget names. Let's correct our approach and try again!


Alright, class, let's tackle the issues we've encountered with our shell scripts.

It seems our previous attempts weren't successful because rg didn't recognize the file type typescript. No worries! In the world of coding, these little hiccups are great learning opportunities. The correct identifier for TypeScript files in rg is ts. Let's update our script accordingly and give it another go!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the new imports are correctly resolved

# Check if the utils/generators module exists and contains getCanvasClassName
echo "Checking for getCanvasClassName in utils/generators:"
rg --type typescript "export.*getCanvasClassName" "utils/generators"

# Check if the EE module exists and exports WDS_EE_WIDGET_MAP
echo "Checking for WDS_EE_WIDGET_MAP in EE module:"
rg --type typescript "export.*WDS_EE_WIDGET_MAP" "ee/modules/ui-builder/ui/wds/constants"

Length of output: 1100


Script:

#!/bin/bash
# Verify the new imports are correctly resolved

# Check if the utils/generators module exports getCanvasClassName
echo "Checking for getCanvasClassName in utils/generators:"
rg --type typescript "export\s+.*getCanvasClassName" "utils/generators"

# Check if the EE module exports WDS_EE_WIDGET_MAP
echo "Checking for WDS_EE_WIDGET_MAP in EE module:"
rg --type typescript "export\s+.*WDS_EE_WIDGET_MAP" "ee/modules/ui-builder/ui/wds/constants.ts"

# Check for duplicate widget names in both widget maps
echo "Checking for duplicate widget names in WDS_V2_WIDGET_MAP and WDS_EE_WIDGET_MAP:"

# Extract widget names from WDS_V2_WIDGET_MAP
rg --type typescript "WDS_V2_WIDGET_MAP\s*=\s*\{" -A 50 "app/client/src/modules/ui-builder/ui/wds/constants.ts" | grep ":" | awk '{print $1}' | tr -d ':' | sort > ce_widgets.txt

# Extract widget names from WDS_EE_WIDGET_MAP
rg --type typescript "WDS_EE_WIDGET_MAP\s*=\s*\{" -A 50 "ee/modules/ui-builder/ui/wds/constants.ts" | grep ":" | awk '{print $1}' | tr -d ':' | sort > ee_widgets.txt

# Find duplicates without using comm
echo "Duplicate widget names (if any):"
grep -Fxf ce_widgets.txt ee_widgets.txt

# Clean up
rm ce_widgets.txt ee_widgets.txt

Length of output: 1144


Script:

#!/bin/bash
# Verify the new imports are correctly resolved

# Check if the utils/generators module exports getCanvasClassName
echo "Checking for getCanvasClassName in utils/generators:"
rg --type ts "export\s+.*getCanvasClassName" "utils/generators"

# Check if the EE module exports WDS_EE_WIDGET_MAP
echo "Checking for WDS_EE_WIDGET_MAP in EE module:"
rg --type ts "export\s+.*WDS_EE_WIDGET_MAP" "ee/modules/ui-builder/ui/wds/constants.ts"

# Check for duplicate widget names in both widget maps
echo "Checking for duplicate widget names in WDS_V2_WIDGET_MAP and WDS_EE_WIDGET_MAP:"

# Extract widget names from WDS_V2_WIDGET_MAP
rg --type ts "WDS_V2_WIDGET_MAP\s*=\s*\{" -A 50 "app/client/src/modules/ui-builder/ui/wds/constants.ts" | grep ":" | awk '{print $1}' | tr -d ':' | sort > ce_widgets.txt

# Extract widget names from WDS_EE_WIDGET_MAP
rg --type ts "WDS_EE_WIDGET_MAP\s*=\s*\{" -A 50 "ee/modules/ui-builder/ui/wds/constants.ts" | grep ":" | awk '{print $1}' | tr -d ':' | sort > ee_widgets.txt

# Find duplicates without using comm
echo "Duplicate widget names (if any):"
grep -Fxf ce_widgets.txt ee_widgets.txt

# Clean up
rm ce_widgets.txt ee_widgets.txt

Length of output: 1193

import { WDSNumberInputWidget } from "modules/ui-builder/ui/wds/WDSNumberInputWidget";
import { WDSMultilineInputWidget } from "modules/ui-builder/ui/wds/WDSMultilineInputWidget";
import { WDSSelectWidget } from "modules/ui-builder/ui/wds/WDSSelectWidget";
import { EEWDSWidgets } from "ee/modules/ui-builder/ui/wds";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Attention: Remaining References to Chat Widgets Found

Great work so far! However, our latest search uncovered some lingering references to the chat widgets:

  • app/client/packages/icons/src/index.ts:
    • export { AIChatThumbnail } from "./components/Thumbnails/AIChatThumbnail";
    • export { AIChatIcon } from "./components/Icons/AIChatIcon";

These exports indicate that the chat widgets are still being referenced in the icons package. Please review these instances to ensure that the chat widgets have been fully relocated or removed as intended.

🔗 Analysis chain

Class, let's examine this code modification carefully.

Now, students, observe the changes made to our widget collection. We've introduced a new import statement:

import { EEWDSWidgets } from "ee/modules/ui-builder/ui/wds";

And we've expanded our Widgets array to include these new Enterprise Edition widgets:

const Widgets = [
  // ... existing widgets ...
  ...EEWDSWidgets,
] as (typeof BaseWidget)[];

Can anyone tell me what this means for our application? That's right! We're incorporating additional widgets from our Enterprise Edition module. This is an excellent example of code modularization and separation of concerns.

Remember, class, when we make changes like this, we need to consider:

  1. Are all necessary dependencies properly imported?
  2. Will this affect the behavior of existing widgets?
  3. Is this change consistent with our project's architecture?

Let's verify if there are any unintended side effects. Run this command to check for any references to the removed chat widget:

Good job, class! Any questions before we move on?

Also applies to: 194-194


Alright, class, it looks like our previous search didn't quite work because rg didn't recognize the typescript file type. No worries! Let's adjust our approach to specify the file extensions directly. Here's a new script to help us find any lingering references to the chat widgets:

Let's run this updated script to ensure we've thoroughly cleaned up all chat widget references. Great job, everyone!


Alright, class, we've encountered a small hiccup with our previous search command. But no worries! Let's correct our approach to properly define a custom type for both TypeScript and JavaScript files. Here's the updated script:

Please run this revised script to ensure we accurately identify any lingering references to the chat widgets. Great effort, everyone!


Alright, class, it seems our previous search didn't find any files because the custom type wasn't recognized correctly. No worries! Let's adjust our approach by directly specifying the file extensions using the --glob option. This way, ripgrep will search through all .ts and .js files without any confusion. Here's the updated script:

Please run this revised script to ensure we accurately identify any lingering references to the chat widgets. Great effort, everyone!

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the chat widget

# Test: Search for references to the chat widget
rg --type typescript --type javascript 'AIChat|ChatInput|AssistantSuggestionButton|ChatDescriptionModal|UserAvatar'

Length of output: 152


Script:

#!/bin/bash
# Description: Check for any remaining references to the chat widget in .ts and .js files

# Test: Search for references to the chat widget in TypeScript and JavaScript files
rg 'AIChat|ChatInput|AssistantSuggestionButton|ChatDescriptionModal|UserAvatar' --type-add 'custom_types:(ts|js)' --type custom_types

Length of output: 195


Script:

#!/bin/bash
# Description: Check for any remaining references to the chat widget in .ts and .js files

# Define a custom type for TypeScript and JavaScript files
rg 'AIChat|ChatInput|AssistantSuggestionButton|ChatDescriptionModal|UserAvatar' --type-add 'tsjs:*.ts;*.js' --type tsjs

Length of output: 270


Script:

#!/bin/bash
# Description: Check for any remaining references to the chat widget in .ts and .js files

# Search for references to the chat widget in TypeScript and JavaScript files using glob patterns
rg 'AIChat|ChatInput|AssistantSuggestionButton|ChatDescriptionModal|UserAvatar' --glob '*.ts' --glob '*.js'

Length of output: 322

@KelvinOm KelvinOm merged commit 97f2560 into release Oct 14, 2024
@KelvinOm KelvinOm deleted the chore/ai-chat-ee branch October 14, 2024 10:10
@coderabbitai coderabbitai bot mentioned this pull request Oct 14, 2024
2 tasks
@KelvinOm KelvinOm mentioned this pull request Oct 14, 2024
2 tasks
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.

3 participants