Skip to content

Conversation

@vsvamsi1
Copy link
Contributor

@vsvamsi1 vsvamsi1 commented Jun 4, 2025

Description

Decoupled property registration code and lazily initialise it in the property pane component.

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/15461239247
Commit: 9c70387
Cypress dashboard.
Tags: @tag.All
Spec:


Thu, 05 Jun 2025 08:50:15 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Improved loading behavior in the property pane to ensure all controls are fully ready before display, resulting in a smoother user experience.
  • Bug Fixes

    • Prevented the property pane from rendering incomplete or missing controls during loading.

@vsvamsi1 vsvamsi1 self-assigned this Jun 4, 2025
@vsvamsi1 vsvamsi1 requested a review from a team as a code owner June 4, 2025 04:29
@vsvamsi1 vsvamsi1 added the ok-to-test Required label for CI label Jun 4, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 4, 2025

Walkthrough

This update shifts the registration of property control builders from a synchronous process during editor initialization to an asynchronous, dynamic import within the PropertyPane component. Rendering of the property pane is now deferred until control registration completes, ensuring controls are loaded before display.

Changes

File(s) Change Summary
app/client/src/pages/Editor/PropertyPane/index.tsx Added async dynamic import and registration of property control builders with state tracking.
app/client/src/utils/editor/EditorUtils.ts Removed import and registration call for PropertyControlRegistry from editor initialization.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PropertyPane
    participant PropertyControlRegistry

    User->>PropertyPane: Mounts component
    PropertyPane->>PropertyControlRegistry: Dynamically import with retry
    PropertyControlRegistry-->>PropertyPane: Module loaded
    PropertyPane->>PropertyControlRegistry: registerPropertyControlBuilders()
    PropertyControlRegistry-->>PropertyPane: Registration complete
    PropertyPane->>User: Render property pane
Loading

Poem

Controls once loaded at the start,
Now wait their turn, a clever art.
As PropertyPane prepares its stage,
It loads the builders, sets the page.
Async magic, less to block—
The editor’s flow now ticks like clock!
✨🛠️


📜 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 830464c and 9c70387.

📒 Files selected for processing (2)
  • app/client/src/pages/Editor/PropertyPane/index.tsx (2 hunks)
  • app/client/src/utils/editor/EditorUtils.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • app/client/src/utils/editor/EditorUtils.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/Editor/PropertyPane/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • 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
✨ 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.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jun 4, 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: 1

🧹 Nitpick comments (1)
app/client/src/pages/Editor/PropertyPane/index.tsx (1)

54-54: Consider adding loading indicator for better UX.

The early return logic correctly prevents rendering until registration completes. However, users might experience a blank state without feedback during the async loading process.

Consider showing a loading spinner or skeleton during the registration phase to improve user experience.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a98198d and 830464c.

📒 Files selected for processing (2)
  • app/client/src/pages/Editor/PropertyPane/index.tsx (2 hunks)
  • app/client/src/utils/editor/EditorUtils.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • app/client/src/utils/editor/EditorUtils.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • 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 (2)
app/client/src/pages/Editor/PropertyPane/index.tsx (2)

1-1: Good addition of useState import for the new state management.

The import change correctly adds useState to support the registration tracking state.


9-9: Appropriate utility import for retry mechanism.

Adding retryPromise import supports the resilient async loading pattern.

Comment on lines +32 to +50
// Track registration state
const [controlsRegistered, setControlsRegistered] = useState(false);

useEffect(() => {
const loadPropertyControlBuilders = async () => {
const module = await retryPromise(
async () =>
import(
/* webpackChunkName: "PropertyControlRegistry" */ "utils/PropertyControlRegistry"
),
);

module.default.registerPropertyControlBuilders();

setControlsRegistered(true);
};

loadPropertyControlBuilders();
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for failed property control registration.

The async loading implementation is well-structured with retry mechanism and webpack chunk naming. However, consider adding error handling for scenarios where registration fails completely.

  useEffect(() => {
    const loadPropertyControlBuilders = async () => {
-     const module = await retryPromise(
-       async () =>
-         import(
-           /* webpackChunkName: "PropertyControlRegistry" */ "utils/PropertyControlRegistry"
-         ),
-     );
-
-     module.default.registerPropertyControlBuilders();
-
-     setControlsRegistered(true);
+     try {
+       const module = await retryPromise(
+         async () =>
+           import(
+             /* webpackChunkName: "PropertyControlRegistry" */ "utils/PropertyControlRegistry"
+           ),
+       );
+
+       module.default.registerPropertyControlBuilders();
+       setControlsRegistered(true);
+     } catch (error) {
+       console.error("Failed to load property control builders:", error);
+       // Consider fallback behavior or user notification
+     }
    };

    loadPropertyControlBuilders();
  }, []);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Track registration state
const [controlsRegistered, setControlsRegistered] = useState(false);
useEffect(() => {
const loadPropertyControlBuilders = async () => {
const module = await retryPromise(
async () =>
import(
/* webpackChunkName: "PropertyControlRegistry" */ "utils/PropertyControlRegistry"
),
);
module.default.registerPropertyControlBuilders();
setControlsRegistered(true);
};
loadPropertyControlBuilders();
}, []);
// Track registration state
const [controlsRegistered, setControlsRegistered] = useState(false);
useEffect(() => {
const loadPropertyControlBuilders = async () => {
try {
const module = await retryPromise(
async () =>
import(
/* webpackChunkName: "PropertyControlRegistry" */ "utils/PropertyControlRegistry"
),
);
module.default.registerPropertyControlBuilders();
setControlsRegistered(true);
} catch (error) {
console.error("Failed to load property control builders:", error);
// Consider fallback behavior or user notification
}
};
loadPropertyControlBuilders();
}, []);
🤖 Prompt for AI Agents
In app/client/src/pages/Editor/PropertyPane/index.tsx around lines 32 to 50, the
async function loading and registering property control builders lacks error
handling for failure scenarios. Wrap the await import and registration calls in
a try-catch block, and in the catch block, log or handle the error appropriately
to ensure failures are detected and managed. This will improve robustness by
handling cases where the module fails to load or registration fails.

@vsvamsi1 vsvamsi1 requested a review from dvj1988 June 4, 2025 07:36
@vsvamsi1 vsvamsi1 enabled auto-merge (squash) June 5, 2025 10:55
@vsvamsi1 vsvamsi1 merged commit e6cebfd into release Jun 5, 2025
85 checks passed
@vsvamsi1 vsvamsi1 deleted the test78 branch June 5, 2025 10:55
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.

2 participants