In anvil, when widgets are dropped on canvas, we create a zone which has
`visual separation` marked as true by default.
Now, There is a usecase for the chat widget in which we want to modify
the zone`s `Visual separation` to false on creation of zone.
The code for bleuprint operation for chat widget would like this:
```js
blueprint: {
operations: [
{
type: BlueprintOperationTypes.MODIFY_PROPS,
fn: (
widget: FlattenedWidgetProps,
widgets: CanvasWidgetsReduxState,
parent: FlattenedWidgetProps,
layoutSystemType: LayoutSystemTypes,
) => {
if (layoutSystemType !== LayoutSystemTypes.ANVIL) return [];
const updates: UpdatePropertyArgs[] = [];
const parentId = widget.parentId;
if (!parentId) return updates;
const parentWidget = widgets[parentId];
// we want to proceed only if the parent is a zone widget and has no children
if (
parentWidget.children?.length === 0 &&
parentWidget.type === "ZONE_WIDGET"
) {
updates.push({
widgetId: parentId,
propertyName: "elevatedBackground",
propertyValue: false,
});
}
return updates;
},
},
],
},
```
This should work fine, but in the code where we create zone and attaching widgets to it, after running the blueprint operations, we were not using the correct updated zone that returned from blueprint operations of the child widgets. This PR uses the correct zone.
Also there is a case where blueprint operation is not able to update the existing widgets because all properties of existing widgets were readonly. So cloned the widgets from redux before passing to widget addition saga functions.
/ok-to-test tags="@tag.All"
## Summary by CodeRabbit
- **New Features**
- Improved clarity in widget handling by renaming parameters related to dragged widgets.
- Streamlined the process of adding widgets to zones by simplifying parameter structures.
- **Bug Fixes**
- Enhanced immutability in widget property updates within the state management process.
- **Style**
- Updated CSS styles for the `.markdown` class, removing unnecessary pseudo-elements for improved formatting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: Cypress test results -->
> [!TIP]
> 🟢🟢🟢 All cypress tests have passed! 🎉🎉🎉
> Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11474751370>
> Commit: 8a385eec313142b40f848eed20310d3774c0705c
> <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11474751370&attempt=3" target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 23 Oct 2024 09:47:24 UTC
<!-- end of auto-generated comment: Cypress test results -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Improved clarity in widget handling by renaming parameters related to dragged widgets.
- Enhanced functionality for adding widgets to zones by simplifying the data structure used.
- Implemented safer state manipulation for widget addition using a deep copy approach.
- **Bug Fixes**
- Addressed potential issues with direct state mutation during widget addition.
- **Style**
- Updated CSS styles for the Markdown component by removing unnecessary pseudo-elements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->