PromucFlow_constructor/app/client/src
Rahul Barwal a801a19581
feat: Implement empty meta widget generation for handling empty data scenarios (#40886)
## Description
<ins>Problem</ins>

Errors appeared in the console when the List widget in edit mode
received an empty array as data.

<ins>Root cause</ins>

In edit mode, the List widget uses template widgets to create meta
widgets. When the list becomes empty, meta widgets are not generated,
but template widgets with `currentItem` bindings remain. Since
`currentItem` requires meta widgets for evaluation, this results in
errors.

<ins>Solution</ins>

This PR handles the generation of empty meta widgets when the List
widget receives empty data, ensuring `currentItem` bindings don’t break.
It introduces a `generateEmptyMetaWidgets` method in
`MetaWidgetGenerator`, enhances the List widget to track and respond to
empty data states, and resets the meta widget cache when transitioning
between empty and non-empty states.

Fixes #`Issue Number`  
_or_  
Fixes https://github.com/appsmithorg/appsmith/issues/31925
> [!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.List"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/15756809644>
> Commit: 58818e09dd83faaa92ee0dad53aab93dcf5f55a5
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=15756809644&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.List`
> Spec:
> <hr>Thu, 19 Jun 2025 12:11:58 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved handling of empty list data on the first page, ensuring
widgets display correctly when no data is present.
- Enhanced consistency in detecting and rendering empty lists across the
List Widget.

- **New Features**
- Added a utility function to accurately identify fully empty lists,
enabling more predictable widget behavior.
- Introduced an option to handle empty list cases by injecting
placeholder data for consistent widget generation.

- **Tests**
- Added a test to verify the display of "No data to display" message
when the list is empty and confirm no errors occur.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-20 09:39:51 +05:30
..
actions chore: decouple formControl registry from the main chunk (#40939) 2025-06-17 17:20:23 +05:30
api chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
assets feat: add action resp viz (#39690) 2025-03-12 13:59:36 +01:00
ce chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
components chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
constants chore: decouple formControl registry from the main chunk (#40939) 2025-06-17 17:20:23 +05:30
Datasource/components
ee chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
enterprise
entities chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
git chore: re-instate status call for protected branches in git connected apps (#40880) 2025-06-06 13:53:37 +05:30
git-artifact-helpers/application chore: git pkg - package integration with git (#39342) 2025-02-19 13:42:58 +01:00
globalStyles
hooks chore: Updating google authentication config to support Multi Org flow on EE (#39985) 2025-03-31 18:33:11 +05:30
icons
IDE chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
instrumentation fix: Upgrade packages (#40935) 2025-06-16 12:12:55 +05:30
layoutSystems chore: decouple formControl registry from the main chunk (#40939) 2025-06-17 17:20:23 +05:30
mockResponses
mocks
navigation chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
pages chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
PluginActionEditor chore: added automatic option to run behaviour behind feature flag (#40608) 2025-05-16 16:29:31 +05:30
plugins/Linting fix: Reduce cycle deps by removing wrong exports (#39268) 2025-02-14 18:26:31 +05:30
polyfills
reducers chore: Changes for supporting input in UI modules property pane (#40546) 2025-05-07 19:21:09 +05:30
reflow
sagas chore: add workflows setting for agents CE (#40988) 2025-06-19 18:44:22 +05:30
selectors chore: decouple formControl registry from the main chunk (#40939) 2025-06-17 17:20:23 +05:30
templates
theme
usagePulse fix: Upgrade packages (#40935) 2025-06-16 12:12:55 +05:30
utils feat: improve recent domains section spacing and text truncation (#40970) 2025-06-18 17:25:30 -07:00
WidgetProvider chore: decouple formControl registry from the main chunk (#40939) 2025-06-17 17:20:23 +05:30
WidgetQueryGenerators fix: JSON form generate form flow broken for tables without primaryKey and READ_WRITE permissions (#40275) 2025-04-24 03:57:03 -07:00
widgets feat: Implement empty meta widget generation for handling empty data scenarios (#40886) 2025-06-20 09:39:51 +05:30
workers chore: decouple formControl registry from the main chunk (#40939) 2025-06-17 17:20:23 +05:30
App.css
AppErrorBoundry.tsx chore: refactor faro (CE) (#40350) 2025-04-29 10:32:36 +05:30
config.d.ts
Globals.d.ts
index.css fix: Revert "Revert "feat: Added focus ring for focus visible (#37700)" (#… (#38655) 2025-02-03 11:12:29 +05:30
index.tsx chore: update import of AppState to DefaultReduxState (#40494) 2025-05-01 15:53:37 +05:30
LandingScreen.tsx fix: handle undefined user object in LandingScreen for non-existent cloud billing domains (#40855) 2025-06-04 06:02:30 -07:00
preload-route-chunks.ts
react-app-env.d.ts chore: Eject CRA (#39264) 2025-02-14 14:24:41 +05:30
RouteChangeListener.tsx
serviceWorker.ts chore: add etag caching in consolidated api for application view mode (#38873) 2025-01-30 13:54:34 +05:30
store.ts chore: update import of AppState to DefaultReduxState (#40494) 2025-05-01 15:53:37 +05:30
wdyr.ts