Skip to content

feat: auto select parent of the removed component#36282

Merged
znamenskii-ilia merged 2 commits intoreleasefrom
feat/36281-select-parent-of-removed-component
Sep 13, 2024
Merged

feat: auto select parent of the removed component#36282
znamenskii-ilia merged 2 commits intoreleasefrom
feat/36281-select-parent-of-removed-component

Conversation

@znamenskii-ilia
Copy link
Contributor

@znamenskii-ilia znamenskii-ilia commented Sep 12, 2024

Description

parentselection.mov

Fixes #36281
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/10845273743
Commit: 88d0b70
Cypress dashboard.
Tags: @tag.All
Spec:


Fri, 13 Sep 2024 09:32:43 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a new optional parentId property for enhanced widget selection, allowing for hierarchical management.
    • Updated widget selection and deletion processes to utilize the parentId for improved contextual handling based on layout type.
  • Bug Fixes

    • Enhanced logic in widget selection to ensure the correct parent ID is used, improving overall selection accuracy.
  • Documentation

    • Updated documentation to reflect changes in widget selection and deletion functionalities.

@znamenskii-ilia znamenskii-ilia requested review from a team and riodeuno September 12, 2024 10:25
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

The changes introduce a new optional property, parentId, to the WidgetSelectionRequestPayload interface, enhancing widget selection functionality. The selectWidgetInitAction function is updated to accept this property, and modifications are made in the deleteSaga and selectWidgetSaga functions to incorporate parentId in their logic. This allows for improved handling of widget selections and deletions, ensuring that the appropriate parent widget context is maintained throughout the processes.

Changes

Files Change Summary
app/client/src/actions/widgetSelectionActions.ts Added parentId property to WidgetSelectionRequestPayload, modified related function signatures and payloads.
app/client/src/sagas/WidgetDeletionSagas.ts Updated deleteSaga to call selectWidgetInitAction with additional parameters, including parentId, based on isAnvilLayout.
app/client/src/sagas/WidgetSelectionSagas.ts Modified selectWidgetSaga to utilize parentId from the action payload, adjusting logic for widget selection.

Possibly related PRs

  • fix: IDE Header Height usage #36297: The changes in the selectWidgetSaga function in the main PR enhance widget selection management, which may relate to the overall user experience improvements addressed in this PR regarding the IDE Header Height, although the connection is more indirect.

Suggested labels

Bug, High, Production, Needs Triaging, IDE Product, IDE Pod, ok-to-test

Poem

In the realm of widgets bright,
A parent ID takes its flight.
Selections dance with newfound grace,
Deletions now find their place.
Hierarchies bloom, control refined,
In this code, new paths we find! 🌟

Tip

OpenAI O1 model for chat
  • We have deployed OpenAI's latest O1 model for chat.
  • OpenAI claims that this model has superior reasoning capabilities than their GPT-4o model.
  • Please share any feedback with us in the discussions post.

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2cce912 and 88d0b70.

Files selected for processing (1)
  • app/client/src/sagas/WidgetDeletionSagas.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/src/sagas/WidgetDeletionSagas.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>.
    • 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 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 Anvil Pod Issue related to Anvil project Task A simple Todo Enhancement New feature or request labels Sep 12, 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: 1

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7ba06c8 and 2cce912.

Files selected for processing (3)
  • app/client/src/actions/widgetSelectionActions.ts (2 hunks)
  • app/client/src/sagas/WidgetDeletionSagas.ts (1 hunks)
  • app/client/src/sagas/WidgetSelectionSagas.ts (6 hunks)
Additional comments not posted (5)
app/client/src/actions/widgetSelectionActions.ts (4)

11-11: Great work on adding the parentId property! 👍

The new optional parentId property in the WidgetSelectionRequestPayload interface is a valuable addition. It allows for associating selected widgets with a specific parent widget, which can improve the organization and hierarchy of widget selections within the application.

Keep up the good work! 🌟


19-19: Excellent update to the WidgetSelectionRequest type signature! 🙌

The inclusion of the optional parentId parameter in the WidgetSelectionRequest type signature aligns perfectly with the addition of the parentId property in the WidgetSelectionRequestPayload interface.

This change ensures that the parentId can be provided when making a widget selection request, enabling the association of selected widgets with their parent widgets.

Well done! 🎉


28-28: Nice update to the selectWidgetInitAction function signature! 👌

The addition of the optional parentId parameter to the selectWidgetInitAction function signature is in line with the changes made to the WidgetSelectionRequest type signature and the WidgetSelectionRequestPayload interface.

This modification enables the parentId to be provided when initiating a widget selection action, allowing for the proper association of selected widgets with their parent widgets.

Great job maintaining consistency across the changes! 🚀


31-31: Fantastic update to the action payload in selectWidgetInitAction! 🎯

Including the parentId property in the action payload of the selectWidgetInitAction function is a logical and consistent change, considering the modifications made to the function signature and the related type definitions.

This ensures that the parentId is properly included in the payload when dispatching the widget selection action, enabling the correct association of selected widgets with their parent widgets.

Your attention to detail and consistency throughout the changes is commendable! 🌟

app/client/src/sagas/WidgetSelectionSagas.ts (1)

69-69: Great work on enhancing the widget selection process! The changes look good to me.

The introduction of the parentId parameter and the determination of finalParentId provide more flexibility in handling parent-child relationships among widgets. The updates to the logic for asserting the parent ID in various selection request types are consistent and handle the different scenarios correctly.

To ensure the changes are thoroughly tested and integrated correctly, please verify the usage of parentId in the codebase by running the following script:

This script will help identify any potential inconsistencies or missing updates related to the usage of parentId in the codebase.

Also applies to: 97-99, 120-120, 129-129, 132-132, 143-143, 146-146, 156-165

@riodeuno
Copy link
Contributor

@znamenskii-ilia The sagas edited in this PR might effect Fixed mode and Auto Layout as well. Please test this once to make sure it works the same way or doesn't break anything in Fixed mode and Auto Layout.

Other than that the changes look good to me.

@appsmithorg appsmithorg deleted a comment from coderabbitai bot Sep 13, 2024
@znamenskii-ilia
Copy link
Contributor Author

@riodeuno I've added and extra isAnvilLayout check, pls review again

@znamenskii-ilia znamenskii-ilia added the ok-to-test Required label for CI label Sep 13, 2024
@znamenskii-ilia znamenskii-ilia merged commit ce02d3c into release Sep 13, 2024
@znamenskii-ilia znamenskii-ilia deleted the feat/36281-select-parent-of-removed-component branch September 13, 2024 09:33
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
## Description

https://github.com/user-attachments/assets/764917aa-74ea-4c1b-8361-6441344227fd

Fixes appsmithorg#36281 
_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
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10845273743>
> Commit: 88d0b70
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10845273743&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Fri, 13 Sep 2024 09:32:43 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**
- Introduced a new optional `parentId` property for enhanced widget
selection, allowing for hierarchical management.
- Updated widget selection and deletion processes to utilize the
`parentId` for improved contextual handling based on layout type.

- **Bug Fixes**
- Enhanced logic in widget selection to ensure the correct parent ID is
used, improving overall selection accuracy.

- **Documentation**
- Updated documentation to reflect changes in widget selection and
deletion functionalities.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Anvil Pod Issue related to Anvil project Enhancement New feature or request ok-to-test Required label for CI Task A simple Todo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto select the parent of the removed component

2 participants