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

fix: Release blocker - ads migration #35285

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Conversation

albinAppsmith
Copy link
Collaborator

@albinAppsmith albinAppsmith commented Jul 30, 2024

Description

This PR addresses below release blockers

  1. Toast UI seems broken

Fixes #35274

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


Tue, 30 Jul 2024 09:45:47 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Improved notification handling for file size errors in the FilePicker component.
    • Enhanced messaging functionality in the OneClickBinding saga for error and success notifications.
    • Updated event handling in the AppIcon component to accept a broader range of event types.
  • Bug Fixes

    • Updated notification method to ensure consistent user messaging across components.
  • Chores

    • Removed outdated Toast component from module exports to streamline imports.
    • Updated CSS import path for the current design system to improve styling consistency.

@albinAppsmith albinAppsmith requested a review from KelvinOm July 30, 2024 08:32
Copy link
Contributor

coderabbitai bot commented Jul 30, 2024

Walkthrough

The recent changes significantly improve the notification system across various components in the application. The shift from the Toaster component to the toast function enhances clarity and consistency in user alerts, especially for error scenarios related to file size limits. Additionally, the removal of the Toast component from exports simplifies the interface, ensuring a more streamlined experience.

Changes

Files Change Summary
app/client/packages/design-system/ads-old/src/FilePickerV2/index.tsx
app/client/src/sagas/OneClickBindingSaga.ts
Updated notification handling from Toaster to toast, simplifying message display logic and modifying parameters from variant to kind, and duration to autoClose.
app/client/packages/design-system/ads-old/src/index.ts
app/client/packages/design-system/widgets-old/src/index.ts
Removed export of the Toast component from the module, reducing complexity in available exports.
app/client/src/index.tsx Updated import path for the default theme CSS file, pointing to the current design system.
app/client/packages/design-system/ads-old/src/AppIcon/index.tsx Changed onClick type from unknown to any and simplified the useMemo logic for determining appSizeHandler.

Assessment against linked issues

Objective Addressed Explanation
Correct colors for toast messages (##35274) The changes focus on notification handling but do not explicitly address color issues in toast messages. It's unclear if the new implementation resolves the color discrepancies.

🎉 In the code's garden, new blooms arise,
Notifications shine, with clearer skies.
From Toaster to toast, a path so bright,
Alerting users, bringing joy and light!
With exports trimmed, the code flows anew,
Celebrate the changes, for they bring value too! 🌟


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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 ADS Components All issues related ADS components ADS Grayscale Support grayscale color changes Bug Something isn't working DailyPromotionBlocker DailyPromotionBlocker Design System Product Appsmith design system related issues Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage Release labels Jul 30, 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: 0

Outside diff range, codebase verification and nitpick comments (1)
app/client/packages/design-system/ads-old/src/index.ts (1)

Verify the impact of removing the Toast component.

The Toast component is still being imported in the following files and needs to be updated to use the new notification system to avoid broken imports:

  • app/client/src/index.tsx
  • app/client/src/pages/Editor/GlobalHotKeys/GlobalHotKeys.test.tsx

Please update these imports accordingly.

Analysis chain

Line range hint 1-1:
Verify the impact of removing the Toast component.

Ensure that all imports of the Toast component are updated to use the new notification system to avoid broken imports.


Let's correct the regex pattern and include TypeScript files in our search to ensure we capture all potential imports of the Toast component.


Let's update our script to correctly search for the Toast component imports in .ts, .tsx, and .js files.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that no other parts of the codebase import the removed `Toast` component.

# Test: Search for imports of the `Toast` component. Expect: No occurrences.
rg --type js 'import { Toast }'

Length of output: 141


Script:

#!/bin/bash
# Description: Verify that no other parts of the codebase import the removed `Toast` component.

# Test: Search for imports of the `Toast` component in both JavaScript and TypeScript files. Expect: No occurrences.
rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' --type-add 'js:*.js' --type ts,tsx,js 'import\s+\{\s+Toast\s+\}'

Length of output: 147


Script:

#!/bin/bash
# Description: Verify that no other parts of the codebase import the removed `Toast` component.

# Test: Search for imports of the `Toast` component in .ts, .tsx, and .js files. Expect: No occurrences.
rg 'import\s+\{\s+Toast\s+\}' --glob '*.ts' --glob '*.tsx' --glob '*.js'

Length of output: 242

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a30adfa and 92c2ae3.

Files selected for processing (5)
  • app/client/packages/design-system/ads-old/src/FilePickerV2/index.tsx (3 hunks)
  • app/client/packages/design-system/ads-old/src/index.ts (1 hunks)
  • app/client/packages/design-system/widgets-old/src/index.ts (1 hunks)
  • app/client/src/index.tsx (1 hunks)
  • app/client/src/sagas/OneClickBindingSaga.ts (2 hunks)
Files skipped from review due to trivial changes (2)
  • app/client/packages/design-system/widgets-old/src/index.ts
  • app/client/src/index.tsx
Additional comments not posted (5)
app/client/src/sagas/OneClickBindingSaga.ts (3)

51-51: Good job importing the new toast function.

This import aligns with the new notification system.


378-380: Excellent update to error notifications.

The change from Toaster.show to toast.show with the updated parameters improves consistency and clarity.


388-397: Well done updating success notifications.

The use of toast.show with the new parameters (hideProgressBar, kind, autoClose) aligns with the updated notification system and simplifies the code.

app/client/packages/design-system/ads-old/src/FilePickerV2/index.tsx (2)

10-10: Great update to import the toast function.

This import aligns with the new notification system.


353-354: Nice work updating the file size error notification.

The change from Toaster.show to toast.show with the updated parameters improves consistency and clarity.

@albinAppsmith albinAppsmith added the ok-to-test Required label for CI label Jul 30, 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: 0

Outside diff range, codebase verification and nitpick comments (1)
app/client/packages/design-system/ads-old/src/AppIcon/index.tsx (1)

429-429: Avoid using any type for onClick property.

Changing the type from unknown to any can lead to loss of type safety. Consider using a more specific type such as React.MouseEvent or React.SyntheticEvent to maintain type safety and clarity.

-  onClick?: (e: any) => void;
+  onClick?: (e: React.MouseEvent<HTMLAnchorElement> | React.SyntheticEvent) => void;
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 92c2ae3 and b772f12.

Files selected for processing (1)
  • app/client/packages/design-system/ads-old/src/AppIcon/index.tsx (1 hunks)
Additional comments not posted (1)
app/client/packages/design-system/ads-old/src/AppIcon/index.tsx (1)

434-435: Verify the impact of the simplified useMemo logic.

The new logic simplifies the condition but may affect size interpretation if props.size can be falsy values. Ensure that this change does not introduce unintended behavior.

@KelvinOm KelvinOm merged commit 38b1462 into release Jul 30, 2024
91 of 92 checks passed
@KelvinOm KelvinOm deleted the release-blocker-ads-migrate branch July 30, 2024 09:56
@coderabbitai coderabbitai bot mentioned this pull request Oct 29, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADS Components All issues related ADS components ADS Grayscale Support grayscale color changes Bug Something isn't working DailyPromotionBlocker DailyPromotionBlocker Design System Product Appsmith design system related issues Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: incorrect colors for all toast messages
2 participants