Skip to content

Conversation

@subrata71
Copy link
Collaborator

@subrata71 subrata71 commented May 25, 2025

Description

EE Counterpart PR: https://github.com/appsmithorg/appsmith-ee/pull/7559

Fixes #Issue Number
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/15253633122
Commit: dd70a1c
Cypress dashboard.
Tags: @tag.All
Spec:


Mon, 26 May 2025 13:55:15 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Refactor
    • Enhanced layout update processing by modularizing synthetic widget handling, enabling future UI-specific widget injection and removal. No direct impact on user-facing features.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 25, 2025

Walkthrough

The updateLayoutDsl method in UpdateLayoutServiceCEImpl was refactored to introduce a modular extension point for handling UI module-specific synthetic widgets. Two new methods were added: one for processing the DSL and creating synthetic widgets, and another for removing these synthetic widgets from the DSL before further processing.

Changes

File(s) Change Summary
app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java Refactored updateLayoutDsl to add extension point for synthetic widget handling; added processDslAndCreateSyntheticWidgets (protected) and stripSyntheticWidgets (private) methods.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant UpdateLayoutServiceCEImpl

    Caller->>UpdateLayoutServiceCEImpl: updateLayoutDsl(creatorId, creatorType, dsl)
    UpdateLayoutServiceCEImpl->>UpdateLayoutServiceCEImpl: processDslAndCreateSyntheticWidgets(...)
    UpdateLayoutServiceCEImpl-->>UpdateLayoutServiceCEImpl: (processedDsl, syntheticWidgetNames)
    UpdateLayoutServiceCEImpl->>UpdateLayoutServiceCEImpl: stripSyntheticWidgets(processedDsl, syntheticWidgetNames)
    UpdateLayoutServiceCEImpl->>UpdateLayoutServiceCEImpl: Extract widget names, handle dynamic bindings
    UpdateLayoutServiceCEImpl->>UpdateLayoutServiceCEImpl: Update on-load executables, run behavior
    UpdateLayoutServiceCEImpl-->>Caller: Final processed DSL
Loading

Suggested labels

skip-changelog, ok-to-test

Suggested reviewers

  • sondermanish

Poem

Refactored flows and widgets anew,
Synthetic children, now just a few.
DSLs processed, with care and with might,
Extension points shining, modular and bright.
Widgets now filtered, the code feels so neat—
Another small victory, a modular feat!
🧩✨

✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

@subrata71 subrata71 self-assigned this May 25, 2025
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label May 25, 2025
@subrata71 subrata71 added ok-to-test Required label for CI and removed skip-changelog Adding this label to a PR prevents it from being listed in the changelog labels May 25, 2025
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label May 25, 2025
sondermanish
sondermanish previously approved these changes May 26, 2025
@ashit-rath
Copy link
Contributor

/build-deploy-preview skip-tests=true

@github-actions
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/15248942088.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 40749.
recreate: .

@subrata71 subrata71 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 26, 2025
@github-actions
Copy link

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

@subrata71 subrata71 removed the ok-to-test Required label for CI label May 26, 2025
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

🧹 Nitpick comments (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (2)

114-118: Document the extension point clearly.

This method serves as an extension point for UI module handling but currently returns no synthetic widgets. Consider adding comprehensive JavaDoc to clarify its purpose and expected behavior in subclasses.

+    /**
+     * Extension point for UI module implementations to process DSL and inject synthetic widgets.
+     * 
+     * @param creatorId The creator ID
+     * @param creatorType The creator context type  
+     * @param dsl The DSL to process
+     * @param mainChildren The main children array from the DSL
+     * @return A Mono containing a Map.Entry with the processed DSL and optional synthetic widget names
+     */
     protected Mono<Map.Entry<JSONObject, Optional<Set<String>>>> processDslAndCreateSyntheticWidgets(
             String creatorId, CreatorContextType creatorType, JSONObject dsl, ArrayList<Object> mainChildren) {
         return Mono.just(Map.entry(dsl, Optional.empty()));
     }

286-288: Add documentation for the placeholder method.

This method currently serves as a placeholder for synthetic widget removal logic. Consider documenting its intended behavior for future implementations.

+    /**
+     * Placeholder method for removing synthetic widgets from the DSL.
+     * Override in subclasses to implement specific synthetic widget removal logic.
+     * 
+     * @param dsl The DSL to process
+     * @param syntheticNamesOpt Optional set of synthetic widget names to remove
+     * @return The processed DSL with synthetic widgets removed
+     */
     protected JSONObject stripSyntheticWidgets(JSONObject dsl, Optional<Set<String>> syntheticNamesOpt) {
         return dsl;
     }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8576ebe and dd70a1c.

📒 Files selected for processing (1)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: perform-test / ci-test-result
  • GitHub Check: server-spotless / spotless-check
  • GitHub Check: server-unit-tests / server-unit-tests
🔇 Additional comments (4)
app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java (4)

27-27: LGTM! New imports are appropriate for the functionality.

The added imports for Sets utility and Optional type are correctly used in the synthetic widget processing logic.

Also applies to: 47-47


132-141: Well-designed setup for synthetic widget processing.

The logic correctly preserves the original DSL structure when no UI module instances are present, which maintains backward compatibility for existing tests.


168-182: Synthetic widget filtering logic is correctly implemented.

The use of Sets.difference to filter out synthetic widgets from the main widget names is appropriate, and the conditional logic properly handles both cases (with and without synthetic widgets).


138-283: Excellent refactoring that maintains existing functionality while adding extension points.

The refactored logic correctly:

  • Processes DSL through the new extension point
  • Handles synthetic widget filtering when present
  • Preserves all existing error handling and reactive patterns
  • Maintains the same observable spans and analytics events

The architecture provides clean extension points for UI module implementations while ensuring backward compatibility.

@subrata71 subrata71 added the ok-to-test Required label for CI label May 26, 2025
@subrata71 subrata71 requested a review from sondermanish May 26, 2025 12:22
@subrata71 subrata71 merged commit 56d296a into release May 26, 2025
92 of 99 checks passed
@subrata71 subrata71 deleted the chore/code-split-for-opl-ui-mi branch May 26, 2025 17:53
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.

3 participants