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

chore: Added action to update metawidgets without triggering eval #39618

Open
wants to merge 1 commit into
base: release
Choose a base branch
from

Conversation

ashit-rath
Copy link
Contributor

@ashit-rath ashit-rath commented Mar 7, 2025

Description

PR adds a new action MODIFY_META_WIDGETS_WITHOUT_EVAL which does exactly same as MODIFY_META_WIDGETS in the metaWidgetsReducer expect the difference that MODIFY_META_WIDGETS_WITHOUT_EVAL is not part of evaluationActionsList which helps updating meta widgets without triggering eval.
This is required for UI module rendering in app

PR for https://github.com/appsmithorg/appsmith-ee/pull/6496

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.Sanity,@tag.Widget"

🔍 Cypress test results

Caution

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

  1. cypress/e2e/Regression/ClientSide/Widgets/Custom/CustomWidgetDefaultComponent_spec.ts
List of identified flaky tests.
Tue, 11 Mar 2025 13:37:26 UTC

Communication

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

  • Yes
  • No

@ashit-rath ashit-rath self-assigned this Mar 7, 2025
@ashit-rath ashit-rath requested a review from ayushpahwa as a code owner March 7, 2025 10:01
Copy link
Contributor

coderabbitai bot commented Mar 7, 2025

Walkthrough

This pull request introduces a new function, modifyMetaWidgetsWithoutEval, to handle meta widget modifications without evaluation. A corresponding action type, MODIFY_META_WIDGETS_WITHOUT_EVAL, is added in the constants file. Additionally, the meta widgets reducer is refactored: the repetitive logic is extracted into a new function (modifyMetaWidgets), which now processes both the existing and the new action types.

Changes

File(s) Change Summary
app/.../metaWidgetActions.ts
app/.../ReduxActionConstants.tsx
Added modifyMetaWidgetsWithoutEval function in actions, along with a new action type MODIFY_META_WIDGETS_WITHOUT_EVAL in the constants.
app/.../metaWidgetsReducer.ts Refactored reducer to extract logic into modifyMetaWidgets and updated it to handle both MODIFY_META_WIDGETS and MODIFY_META_WIDGETS_WITHOUT_EVAL actions.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant DA as Dispatch Action
    participant A as metaWidgetActions
    participant R as metaWidgetsReducer
    participant M as modifyMetaWidgets

    U->>DA: Dispatch modifyMetaWidgetsWithoutEval(payload)
    DA->>A: Call modifyMetaWidgetsWithoutEval(payload)
    A-->>DA: Returns action { type: MODIFY_META_WIDGETS_WITHOUT_EVAL, payload }
    DA->>R: Pass action to metaWidgetsReducer
    R->>M: Process action via modifyMetaWidgets
    M-->>R: Return updated meta widgets state
    R-->>DA: Updated state propagated
Loading

Possibly related PRs

Suggested labels

skip-changelog, ok-to-test, Task, IDE Product, Widgets Product, Widgets & Accelerators Pod

Suggested reviewers

  • ankitakinger

Poem

In code we weave our magic thread,
A new function blooms, finely spread.
Meta widgets now gracefully dance,
With tweaks that give evaluation a chance.
Cheers to changes – our code sings ahead!
🎉🚀


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3794dc and 1dfda48.

📒 Files selected for processing (3)
  • app/client/src/actions/metaWidgetActions.ts (1 hunks)
  • app/client/src/ce/constants/ReduxActionConstants.tsx (1 hunks)
  • app/client/src/reducers/entityReducers/metaWidgetsReducer.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (4)
app/client/src/actions/metaWidgetActions.ts (1)

14-19: New action creator for modifying meta widgets without triggering evaluation

This action creator follows the existing pattern for modifyMetaWidgets but with a different action type that won't be included in evaluation action list.

app/client/src/ce/constants/ReduxActionConstants.tsx (1)

524-524: New action type for modifying meta widgets without evaluation

Added a new action type to support updating meta widgets without triggering the evaluation process, which aligns with UI module rendering requirements mentioned in the PR objectives.

app/client/src/reducers/entityReducers/metaWidgetsReducer.ts (2)

54-82: Good refactoring of duplicate logic into a reusable function

Extracting the common logic for modifying meta widgets into a separate function improves code maintainability and reduces duplication. This function handles the modifications in the same way for both action types.


84-86: Efficient reuse of the same handler for both action types

Both action types now use the same handler function, which is a clean approach since they perform the same operations but with different evaluation behaviors.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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 generate docstrings to generate docstrings for this 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 Mar 7, 2025
@ashit-rath ashit-rath requested review from brayn003 and removed request for ayushpahwa March 7, 2025 10:03
@ashit-rath ashit-rath added the ok-to-test Required label for CI label Mar 11, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant