Skip to content

chore: Remove ask ai feature#37111

Closed
dvj1988 wants to merge 5 commits intoreleasefrom
chore/remove-ask-ai
Closed

chore: Remove ask ai feature#37111
dvj1988 wants to merge 5 commits intoreleasefrom
chore/remove-ask-ai

Conversation

@dvj1988
Copy link

@dvj1988 dvj1988 commented Oct 28, 2024

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

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/11548719285
Commit: 38e88ca
Cypress dashboard.
Tags: @tag.All
Spec:


Mon, 28 Oct 2024 08:46:32 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new ASK_AI command to the existing slash commands for enhanced functionality.
  • Bug Fixes

    • Removed AI-related properties and functionalities across multiple components, streamlining the user interface and improving performance.
  • Chores

    • Deleted deprecated AI-related storage keys and methods to simplify data management and reduce potential confusion.

These changes collectively enhance the application's focus by removing non-functional AI features, ensuring a cleaner and more efficient user experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2024

Walkthrough

The changes in this pull request involve the removal of multiple components and functionalities related to AI features across various files in the codebase. The deletions include TypeScript interfaces, props, constants, and functions that previously supported AI interactions. This comprehensive removal indicates a significant shift in the application’s architecture, particularly concerning how AI functionalities were integrated and utilized.

Changes

File Path Change Summary
app/client/src/ce/components/editorComponents/GPT/AskAIButton.tsx Removed AskAIButtonProps interface and AskAIButton functional component.
app/client/src/ce/components/editorComponents/GPT/index.tsx Deleted AIEditorContext type, TAIWrapperProps interface, and AIWindow function component.
app/client/src/ce/components/editorComponents/GPT/trigger.tsx Removed APPSMITH_AI constant, isAIEnabled, isAISlashCommand, and getAIContext functions.
app/client/src/ce/constants/ReduxActionConstants.tsx Deleted AIActionTypes constant, affecting Redux action types.
app/client/src/components/editorComponents/ActionCreator/viewComponents/TextView/index.tsx Removed enableAI prop from InputText component.
app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts Removed enableAIAssistance parameter from showHint method in slashCommandHintHelper.
app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx Deleted ASK_AI enum value and related AI command generation logic.
app/client/src/components/editorComponents/CodeEditor/hintHelpers.ts Simplified bindingHintHelper logic by removing AI-related checks.
app/client/src/components/editorComponents/CodeEditor/index.tsx Removed references to AIWindow, AskAIButton, and AI-related state management.
app/client/src/components/editorComponents/CodeEditor/styledComponents.ts Deleted AIEnabled property from EditorWrapper styled component.
app/client/src/components/editorComponents/form/fields/DynamicTextField.tsx Removed import for editorSQLModes and AIAssisted property setting.
app/client/src/components/propertyControls/ChartDataControl.tsx Removed AIAssisted prop from LazyCodeEditor instances.
app/client/src/components/propertyControls/CodeEditorControl.tsx Added AIAssisted prop to LazyCodeEditor.
app/client/src/components/propertyControls/ComputeTablePropertyControl.tsx Added AIAssisted prop to LazyCodeEditor.
app/client/src/components/propertyControls/InputTextControl.tsx Removed enableAI prop from InputText.
app/client/src/components/propertyControls/JSONFormComputeControl.tsx Removed AIAssisted prop from LazyCodeEditor and updated processSchemaItemAutocomplete function.
app/client/src/components/propertyControls/ListComputeControl.tsx Added AIAssisted prop to CodeEditor.
app/client/src/components/propertyControls/MenuButtonDynamicItemsControl.tsx Removed AIAssisted prop from LazyCodeEditor.
app/client/src/components/propertyControls/SelectDefaultValueControl.tsx Removed AIAssisted prop from LazyCodeEditor.
app/client/src/components/propertyControls/TableComputeValue.tsx Added AIAssisted prop to LazyCodeEditor.
app/client/src/components/propertyControls/TableInlineEditValidationControl.tsx Added AIAssisted prop to LazyCodeEditor.
app/client/src/components/propertyControls/WrappedCodeEditorControl.tsx Removed AIAssisted prop from LazyCodeEditor.
app/client/src/ee/components/editorComponents/GPT/AskAIButton.tsx Deleted file, removing all exports from AskAIButton.
app/client/src/ee/components/editorComponents/GPT/index.tsx Deleted file, removing re-exports from ce/components/editorComponents/GPT.
app/client/src/ee/components/editorComponents/GPT/trigger.tsx Deleted file, removing all exports from trigger.
app/client/src/entities/Action/index.ts Added ASK_AI value to SlashCommand enum.
app/client/src/entities/Engine/AppEditorEngine.ts Removed AI prompt tracking logic from completeChore method.
app/client/src/pages/Editor/JSEditor/JSEditorForm/JSEditorForm.tsx Removed AIAssisted prop from LazyCodeEditor.
app/client/src/pages/Editor/JSEditor/JSEditorForm/old/JSEditorForm.tsx Removed AIAssisted prop from LazyCodeEditor.
app/client/src/sagas/ActionSagas.ts Removed case handling for SlashCommand.ASK_AI in executeCommandSaga.
app/client/src/utils/storage.ts Removed AI-related storage keys and methods.

Possibly related PRs

  • chore: remove an extra eval cycle caused by the FETCH_FORM_CONFIG_SUCCESS action #37013: The changes in this PR involve modifications to the AppEditorEngine class, which may relate to the overall architecture and functionality of the application, similar to the removal of the AskAIButton component in the main PR. Both PRs indicate a shift in how certain functionalities are managed within the codebase, particularly regarding the handling of components and their interactions.

Suggested labels

Bug

Suggested reviewers

  • sharat87
  • rahulbarwal

"In code we trust, with changes so bold,
AI features removed, a new tale unfolds.
Components once vibrant, now gone from the scene,
A cleaner codebase, fresh and serene.
Let’s celebrate clarity, a simpler way,
As we code our future, bright as the day!" 🎉


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.

@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 28, 2024
@dvj1988 dvj1988 added ok-to-test Required label for CI and removed skip-changelog Adding this label to a PR prevents it from being listed in the changelog labels Oct 28, 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 Oct 28, 2024
@dvj1988 dvj1988 removed the ok-to-test Required label for CI label Oct 28, 2024
@dvj1988 dvj1988 added the ok-to-test Required label for CI label Oct 28, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Oct 28, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Oct 28, 2024
@github-actions
Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 36, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

@dvj1988
Copy link
Author

dvj1988 commented Oct 28, 2024

/build-deploy-preview skip-tests=true

@github-actions
Copy link

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

@github-actions
Copy link

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

@dvj1988 dvj1988 requested a review from vsvamsi1 October 29, 2024 05:03
@dvj1988 dvj1988 marked this pull request as ready for review October 29, 2024 05:03
@dvj1988 dvj1988 requested a review from ayushpahwa as a code owner October 29, 2024 05:03
@dvj1988 dvj1988 requested a review from a team October 29, 2024 05:03
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 and nitpick comments (1)
app/client/src/entities/Engine/AppEditorEngine.ts (1)

Line range hint 419-429: Consider enhancing error handling for Git branch persistence

The error logging could benefit from proper error handling to prevent potential issues in the production environment.

Consider wrapping the Git branch persistence logic in a try-catch block:

-      if (currentUser?.email && currentApplication?.baseId && currentBranch) {
-        yield setLatestGitBranchInLocal(
-          currentUser.email,
-          currentApplication.baseId,
-          currentBranch,
-        );
-      } else {
-        log.error(
-          `There was an error setting the latest git branch in local - userEmail: ${!!currentUser?.email}, applicationId: ${currentApplication?.baseId}, branch: ${currentBranch}`,
-        );
-      }
+      try {
+        if (currentUser?.email && currentApplication?.baseId && currentBranch) {
+          yield setLatestGitBranchInLocal(
+            currentUser.email,
+            currentApplication.baseId,
+            currentBranch,
+          );
+        } else {
+          throw new Error('Missing required parameters for Git branch persistence');
+        }
+      } catch (error) {
+        log.error(
+          `Error setting the latest git branch in local - userEmail: ${!!currentUser?.email}, applicationId: ${currentApplication?.baseId}, branch: ${currentBranch}`,
+          error
+        );
+      }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 437f689 and 38e88ca.

📒 Files selected for processing (32)
  • app/client/src/ce/components/editorComponents/GPT/AskAIButton.tsx (0 hunks)
  • app/client/src/ce/components/editorComponents/GPT/index.tsx (0 hunks)
  • app/client/src/ce/components/editorComponents/GPT/trigger.tsx (0 hunks)
  • app/client/src/ce/constants/ReduxActionConstants.tsx (0 hunks)
  • app/client/src/components/editorComponents/ActionCreator/viewComponents/TextView/index.tsx (0 hunks)
  • app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts (0 hunks)
  • app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx (0 hunks)
  • app/client/src/components/editorComponents/CodeEditor/hintHelpers.ts (1 hunks)
  • app/client/src/components/editorComponents/CodeEditor/index.tsx (4 hunks)
  • app/client/src/components/editorComponents/CodeEditor/styledComponents.ts (0 hunks)
  • app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts (0 hunks)
  • app/client/src/components/editorComponents/form/fields/DynamicTextField.tsx (0 hunks)
  • app/client/src/components/propertyControls/ChartDataControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/CodeEditorControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/ComputeTablePropertyControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/InputTextControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/JSONFormComputeControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/ListComputeControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/MenuButtonDynamicItemsControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/SelectDefaultValueControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/TableComputeValue.tsx (0 hunks)
  • app/client/src/components/propertyControls/TableInlineEditValidationControl.tsx (0 hunks)
  • app/client/src/components/propertyControls/WrappedCodeEditorControl.tsx (0 hunks)
  • app/client/src/ee/components/editorComponents/GPT/AskAIButton.tsx (0 hunks)
  • app/client/src/ee/components/editorComponents/GPT/index.tsx (0 hunks)
  • app/client/src/ee/components/editorComponents/GPT/trigger.tsx (0 hunks)
  • app/client/src/entities/Action/index.ts (0 hunks)
  • app/client/src/entities/Engine/AppEditorEngine.ts (1 hunks)
  • app/client/src/pages/Editor/JSEditor/JSEditorForm/JSEditorForm.tsx (0 hunks)
  • app/client/src/pages/Editor/JSEditor/JSEditorForm/old/JSEditorForm.tsx (0 hunks)
  • app/client/src/sagas/ActionSagas.ts (0 hunks)
  • app/client/src/utils/storage.ts (0 hunks)
🔥 Files not summarized due to errors (1)
  • app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts: Error: Server error: no LLM provider could handle the message
💤 Files with no reviewable changes (29)
  • app/client/src/ce/components/editorComponents/GPT/AskAIButton.tsx
  • app/client/src/ce/components/editorComponents/GPT/index.tsx
  • app/client/src/ce/components/editorComponents/GPT/trigger.tsx
  • app/client/src/ce/constants/ReduxActionConstants.tsx
  • app/client/src/components/editorComponents/ActionCreator/viewComponents/TextView/index.tsx
  • app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts
  • app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx
  • app/client/src/components/editorComponents/CodeEditor/styledComponents.ts
  • app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts
  • app/client/src/components/editorComponents/form/fields/DynamicTextField.tsx
  • app/client/src/components/propertyControls/ChartDataControl.tsx
  • app/client/src/components/propertyControls/CodeEditorControl.tsx
  • app/client/src/components/propertyControls/ComputeTablePropertyControl.tsx
  • app/client/src/components/propertyControls/InputTextControl.tsx
  • app/client/src/components/propertyControls/JSONFormComputeControl.tsx
  • app/client/src/components/propertyControls/ListComputeControl.tsx
  • app/client/src/components/propertyControls/MenuButtonDynamicItemsControl.tsx
  • app/client/src/components/propertyControls/SelectDefaultValueControl.tsx
  • app/client/src/components/propertyControls/TableComputeValue.tsx
  • app/client/src/components/propertyControls/TableInlineEditValidationControl.tsx
  • app/client/src/components/propertyControls/WrappedCodeEditorControl.tsx
  • app/client/src/ee/components/editorComponents/GPT/AskAIButton.tsx
  • app/client/src/ee/components/editorComponents/GPT/index.tsx
  • app/client/src/ee/components/editorComponents/GPT/trigger.tsx
  • app/client/src/entities/Action/index.ts
  • app/client/src/pages/Editor/JSEditor/JSEditorForm/JSEditorForm.tsx
  • app/client/src/pages/Editor/JSEditor/JSEditorForm/old/JSEditorForm.tsx
  • app/client/src/sagas/ActionSagas.ts
  • app/client/src/utils/storage.ts
✅ Files skipped from review due to trivial changes (1)
  • app/client/src/components/editorComponents/CodeEditor/index.tsx
🔇 Additional comments (4)
app/client/src/components/editorComponents/CodeEditor/hintHelpers.ts (1)

50-50: LGTM: Simplified hint display logic

The removal of AI assistance check aligns with the PR objective of removing AI features while maintaining core hint functionality.

Let's verify there are no remaining AI-related dependencies:

✅ Verification successful

Let me verify if there are any remaining AI-related logic in the hint helpers by searching for specific hint-related code:


Based on the previous search results showing the context around shouldShow = true, I can see that the hint logic has been simplified to a clean conditional flow without any AI-related dependencies. The hint display now depends only on the cursor position inside bindings and uses the standard CodeMirror Tern service for completions.

✓ Hint display logic correctly simplified

The removal of AI assistance check is clean and maintains the core hint functionality through standard CodeMirror features.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining AI-related code in the hint helpers
rg -i "ai|artificial intelligence" "app/client/src/components/editorComponents/CodeEditor/"

Length of output: 15589


Script:

#!/bin/bash
# Search for hint-related logic in hintHelpers.ts
ast-grep --pattern 'function bindingHintHelper($_) {
  $$$
}'

Length of output: 63


Script:

#!/bin/bash
# Search for hint-related logic in hintHelpers.ts with ripgrep for better context
rg -A 10 "shouldShow = true" app/client/src/components/editorComponents/CodeEditor/hintHelpers.ts

Length of output: 310


Script:

#!/bin/bash
# Get more context around the hint helper function to understand the complete logic
rg -B 10 -A 20 "function bindingHintHelper" app/client/src/components/editorComponents/CodeEditor/hintHelpers.ts

Length of output: 114


Script:

#!/bin/bash
# Search for the export of bindingHintHelper and its implementation
rg -U "export.*bindingHintHelper.*?\{.*?\}" -A 30 app/client/src/components/editorComponents/CodeEditor/hintHelpers.ts

Length of output: 120

app/client/src/entities/Engine/AppEditorEngine.ts (3)

56-56: LGTM: Git-related import addition

The new import aligns with the Git branch persistence functionality implemented in the completeChore method.


Line range hint 1-500: LGTM: Clean removal of AI feature

The AI-related functionality has been cleanly removed without leaving any dangling references or unused code. This aligns with the PR objective of removing the "ask ai" feature.


Line range hint 1-500: Verify complete removal of AI-related code

Let's ensure no AI-related code remains in the codebase.

@github-actions
Copy link

github-actions bot commented Nov 5, 2024

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Nov 5, 2024
@github-actions
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Nov 12, 2024
@dvj1988 dvj1988 reopened this Dec 5, 2024
@github-actions
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Dec 14, 2024
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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants