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: On delete of last item, redirect user to blank screen #32418

Merged
merged 8 commits into from
Apr 5, 2024

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Apr 4, 2024

Description

When the last item is deleted in JS, Query Or UI, we will take the user to the to the list view where the blank state is shown. This way the user will not be confused about the add state they were dropped into

Fixes #30612

Automation

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

🔍 Cypress test results

Important

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8569313532
Commit: 6408a9af3dee52fe66501afc6b4e6ded49993fee
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

Summary by CodeRabbit

  • Refactor
    • Improved focus management across the application by centralizing focus history handling.
    • Updated redirection logic after entity deletion to enhance user navigation experience.
  • Chores
    • Removed unused removeFocusHistoryRequest function and associated action constant to streamline codebase.

@github-actions github-actions bot added the Bug Something isn't working label Apr 4, 2024
@hetunandu hetunandu added the ok-to-test Required label for CI label Apr 4, 2024
@github-actions github-actions bot added IDE Issues related to the IDE IDE Navigation Issues/feature requests related to IDE navigation, and context switching Needs Triaging Needs attention from maintainers to triage New Developers Pod Issues that new developers face while exploring the IDE PR blocker Critical issues raised during feature testing & need to be fixed before PR is pushed to master Production labels Apr 4, 2024
@hetunandu hetunandu added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 5, 2024
@hetunandu hetunandu marked this pull request as ready for review April 5, 2024 06:17
@hetunandu hetunandu requested review from ayushpahwa and a team as code owners April 5, 2024 06:17
@hetunandu hetunandu requested review from marks0351 and removed request for a team April 5, 2024 06:17
Copy link
Contributor

coderabbitai bot commented Apr 5, 2024

Warning

Rate Limit Exceeded

@hetunandu has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 44 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between f82cc0b and 6408a9a.

Walkthrough

The changes involve refactoring and enhancing focus management across the application by removing the outdated removeFocusHistoryRequest function and integrating a more centralized FocusRetention mechanism. This update includes modifications across various sagas and components to ensure consistent focus history management, particularly in scenarios involving deletion or movement of entities like JS Collections, datasources, and widgets. Additionally, the update improves navigation by redirecting users to list views instead of creation views post-deletion, enhancing the overall user experience.

Changes

File Path Change Summary
app/client/src/actions/focusHistoryActions.ts
app/client/src/ce/constants/ReduxActionConstants.tsx
Removed removeFocusHistoryRequest function and action constant.
app/client/src/.../AppIDEFocusStrategy.ts
app/client/src/sagas/FocusRetentionSaga.ts
Updated focus management logic and method signatures.
app/client/src/ce/sagas/JSActionSagas.ts
app/client/src/sagas/ActionSagas.ts
app/client/src/sagas/DatasourcesSagas.ts
app/client/src/sagas/WidgetDeletionSagas.ts
Integrated FocusRetention for entity deletion and movement.
app/client/src/ee/sagas/NavigationSagas.ts Removed outdated focus history handler.
app/client/src/sagas/IDESaga.tsx Updated redirection logic and URL declarations.

Assessment against linked issues

Objective Addressed Explanation
Resolve the issue of a blank JS object appearing after deletion [#30612]
Address inconsistent popup behavior and resource not found message after deletion [#30696] The changes suggest improvements in focus and navigation that might indirectly impact the behavior of popups and deletion feedback, but it's unclear without specific mention of popup management.
Fix blank states for JavaScript and Query components and add tooltips [#31330] The changes do not directly address UI issues or the addition of tooltips.
Eliminate duplicate events and redundant API calls [#16650] The provided changes focus on focus history and navigation, not on event management or API call optimization.

Possibly related issues

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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/coderabbit-overrides.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.

@hetunandu hetunandu added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 5, 2024
@hetunandu hetunandu enabled auto-merge (squash) April 5, 2024 12:21
@hetunandu hetunandu merged commit 159399d into release Apr 5, 2024
42 checks passed
@hetunandu hetunandu deleted the fix/entity-delete-logic branch April 5, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Issues related to the IDE Needs Triaging Needs attention from maintainers to triage New Developers Pod Issues that new developers face while exploring the IDE ok-to-test Required label for CI PR blocker Critical issues raised during feature testing & need to be fixed before PR is pushed to master Production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Blank JS object appears in the UI tab after deleting a JS Object
2 participants