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: Added back the pencil icon for editable text component #35855

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

albinAppsmith
Copy link
Collaborator

@albinAppsmith albinAppsmith commented Aug 23, 2024

Description

Editable text in application name and workspace name was removed by some of recent ads migrations. This PR adds those icons back.

Fixes #35853

Automation

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

🔍 Cypress test results

Caution

🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10553233212
Commit: 8a2adfe
Cypress dashboard.
Tags: @tag.All
Spec:
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
  2. cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js
  3. cypress/e2e/Regression/ClientSide/Git/GitWithAutoLayout/conversion_of_git_connected_apps_spec.js
  4. cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js
  5. cypress/e2e/Regression/ClientSide/MobileResponsiveTests/ConversionFlow_Corner_Cases_spec.ts
List of identified flaky tests.
Mon, 26 Aug 2024 04:55:56 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Enhanced the Editable Text component with dynamic icon display reflecting editing and saving states.
    • Introduced visual feedback through icons like "pencil-line," "success," and "error," improving user interaction.
  • Bug Fixes
    • Resolved issues with visual feedback during the editing process when saving states were displayed.

@albinAppsmith albinAppsmith requested a review from KelvinOm August 23, 2024 06:01
Copy link
Contributor

coderabbitai bot commented Aug 23, 2024

Walkthrough

The recent changes to the EditableTextSubComponent introduce conditional icon rendering based on the component's editing and saving states. A constant, iconName, determines the displayed icon, enhancing visual feedback during user interactions. The logic now includes distinct icons for different states, replacing a simpler approach that only featured a loading spinner during the saving process.

Changes

Files Change Summary
app/client/packages/design-system/ads-old/src/EditableTextSubComponent/index.tsx Added logic for dynamic icon rendering based on editing and saving states, improving user feedback.

Assessment against linked issues

Objective Addressed Explanation
Pencil icon for rename action of workspace is missing (#35853)

In a world where icons play,
A pencil marks the edit way. ✏️
From loading spinners we now part,
Visual cues that warm the heart.
A state of change, so clear and bright,
Enhancing user joy, a true delight! 🌟


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.

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 Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Home Page Issues related to the application home page Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Platform Administration Pod Issues related to platform administration & management Production Release Blocker This issue must be resolved before the release Workspace Product Issues related to workspaces labels Aug 23, 2024
@albinAppsmith albinAppsmith added the ok-to-test Required label for CI label Aug 23, 2024
@albinAppsmith
Copy link
Collaborator Author

/build-deploy-preview skip-test=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10520715879.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 35855.
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, codebase verification and nitpick comments (1)
app/client/packages/design-system/ads-old/src/EditableTextSubComponent/index.tsx (1)

220-230: Add comments to explain icon display logic.

The logic for determining iconName is well-structured, but adding comments to explain the conditions for each icon would enhance readability and maintainability.

Consider adding comments like this:

const iconName =
  // Show pencil icon when not editing and saving has not started
  !isEditing && savingState === SavingState.NOT_STARTED && !props.hideEditIcon
    ? "pencil-line"
  // Show success icon when saving is successful
  : !isEditing && savingState === SavingState.SUCCESS
    ? "success"
  // Show error icon when there is an error or invalid input while editing
  : savingState === SavingState.ERROR || (isEditing && !!isInvalid)
    ? "error"
  // No icon otherwise
  : undefined;
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 349ddb0 and 5c445dc.

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

254-258: LGTM! Verify the Icon component usage.

The rendering logic for displaying the spinner and icons is clear and aligns with the intended functionality.

Ensure that the Icon component is correctly imported and used throughout the codebase.

Run the following script to verify the Icon component usage:

Verification successful

Let's correct the approach and verify the usage of the Icon component by searching within .tsx files. We'll use fd to locate these files and then search for the Icon component within them.


The Icon component is correctly used throughout the codebase.

The extensive and consistent usage of the Icon component across various files confirms that it is properly integrated and utilized. There are no issues with its implementation.

  • The Icon component is used with various name and size attributes, indicating flexibility and correct usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `Icon` component in the codebase.

# Test: Search for the `Icon` component usage. Expect: Correct usage of the `Icon` component.
rg --type tsx -A 5 $'<Icon name='

Length of output: 62


Script:

#!/bin/bash
# Description: Verify the usage of the `Icon` component in the codebase.

# Find all .tsx files and search for the usage of the `Icon` component.
fd --extension tsx --exec rg '<Icon name='

Length of output: 9647

Copy link

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

@sagar-qa007 sagar-qa007 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Aug 23, 2024
@nidhi-nair nidhi-nair added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Aug 26, 2024
@abhvsn abhvsn merged commit 2af307f into release Aug 26, 2024
149 of 161 checks passed
@abhvsn abhvsn deleted the blocker/pencil-icon-editable-content branch August 26, 2024 07:24
albinAppsmith added a commit that referenced this pull request Aug 26, 2024
## Description

Editable text in application name and workspace name was removed by some
of recent ads migrations. This PR adds those icons back.

Fixes #35853

## Automation

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

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]
> 🔴 🔴 🔴 Some tests have failed.
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10553233212>
> Commit: 8a2adfe
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10553233212&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail"
target="_blank">Cypress dashboard</a>.
> Tags: @tag.All
> Spec:
> The following are new failures, please fix them before merging the PR:
<ol>
>
<li>cypress/e2e/Regression/ClientSide/Git/GitDiscardChange/DiscardChanges_spec.js
>
<li>cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js
>
<li>cypress/e2e/Regression/ClientSide/Git/GitWithAutoLayout/conversion_of_git_connected_apps_spec.js
>
<li>cypress/e2e/Regression/ClientSide/Git/GitWithJSLibrary/GitwithCustomJSLibrary_spec.js
>
<li>cypress/e2e/Regression/ClientSide/MobileResponsiveTests/ConversionFlow_Corner_Cases_spec.ts</ol>
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master"
target="_blank">List of identified flaky tests</a>.
> <hr>Mon, 26 Aug 2024 04:55:56 UTC
<!-- end of auto-generated comment: Cypress test results  -->

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

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

## Summary by CodeRabbit

- **New Features**
- Enhanced the Editable Text component with dynamic icon display
reflecting editing and saving states.
- Introduced visual feedback through icons like "pencil-line,"
"success," and "error," improving user interaction.
- **Bug Fixes**
- Resolved issues with visual feedback during the editing process when
saving states were displayed.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 2af307f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working High This issue blocks a user from building or impacts a lot of users Home Page Issues related to the application home page Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Platform Administration Pod Issues related to platform administration & management Production Release Blocker This issue must be resolved before the release Workspace Product Issues related to workspaces
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Pencil icon for rename action of workspace is missing
5 participants