PromucFlow_constructor/app/client/cypress/e2e/Regression/ClientSide
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
..
ActionExecution ci: Fixing cypress tests that are failing due to the change from executeOnLoad to runBehavior (#40489) 2025-04-30 20:21:02 +05:30
AdminSettings feat: Updating admin settings page as per new designs (#40101) 2025-04-07 15:44:20 +05:30
AIAgents chore: add a dummy test for aiagents (#39816) 2025-03-20 12:52:14 +05:30
Anvil chore: Update Anvil border radius test (#40103) 2025-04-07 12:45:34 +05:30
AppNavigation chore: Addding dependent tags (#36965) 2024-10-18 18:19:08 +05:30
AuditLogs
Autocomplete chore: Removing the feature flag for using Entity Item component from ADS templates (#39093) 2025-03-14 17:40:02 +05:30
Binding chore: update select component (#38954) 2025-02-06 13:10:25 +05:30
Branding chore: Migrate Tenant to Organization (#38891) 2025-02-18 20:41:07 +05:30
BugTests chore: flaky tests fixed (#40931) 2025-06-12 14:49:00 +05:30
CodeComment chore: Addding dependent tags (#36965) 2024-10-18 18:19:08 +05:30
CommunityTemplate chore: Addding dependent tags (#36965) 2024-10-18 18:19:08 +05:30
Debugger feat: Trigger autocomplete even outside bindings (#39446) 2025-03-07 13:35:16 +05:30
DynamicHeight chore: removed old flags for airgap instances (#36609) 2024-10-07 15:26:25 +05:30
Editor
EmbedSettings feat: Updating admin settings page as per new designs (#40101) 2025-04-07 15:44:20 +05:30
ExplorerTests fix: Updating admin settings logic to fix issues on EE (#40135) 2025-04-08 00:41:02 +05:30
Fork test: analyse flaky fork test (#39531) 2025-03-24 10:56:42 +05:30
FormLogin fix: enable form login spec improvement (#40693) 2025-06-11 23:01:13 -07:00
FormNativeToRawTests
Git test: commenting tests with open bug for delete branch (#39369) 2025-03-24 10:56:05 +05:30
Github
Google fix: Blocking disconnection of the only connected auth method in admin settings (#40150) 2025-04-08 12:32:25 +05:30
Homepage chore: Addding dependent tags (#36965) 2024-10-18 18:19:08 +05:30
IDE chore: Removing the feature flag for using Entity Item component from ADS templates (#39093) 2025-03-14 17:40:02 +05:30
JSLibrary chore: Removing the feature flag for using Entity Item component from ADS templates (#39093) 2025-03-14 17:40:02 +05:30
JSObject fix: JSobject test fixed after generate crud issue fixes (#40954) 2025-06-17 12:42:54 +05:30
Linting feat: Enable new toolbar for cypress (#37148) 2024-12-03 09:21:43 +05:30
Login test: Sign in and Sign up cases (#39028) 2025-02-05 15:20:33 +05:30
MobileResponsiveTests chore: skipping cases for mockdb usage (#38888) 2025-01-30 11:47:38 +05:30
Onboarding chore: Addding dependent tags (#36965) 2024-10-18 18:19:08 +05:30
OneClickBinding chore: skipping cases for mockdb usage (#38888) 2025-01-30 11:47:38 +05:30
OtherUIFeatures chore: Removing the feature flag for using Entity Item component from ADS templates (#39093) 2025-03-14 17:40:02 +05:30
PartialImportExport ci: Fixing the page actions spec (#40328) 2025-04-22 11:35:14 +05:30
PeekOverlay feat: Inspect State CTA for discovery (#39100) 2025-02-14 21:57:08 +05:30
Performance chore: Addding dependent tags (#36965) 2024-10-18 18:19:08 +05:30
ProductRamps chore: rm dr ce (#34765) 2024-07-31 08:24:51 +05:30
PropertyPane fix: Revert "Revert "feat: Added focus ring for focus visible (#37700)" (#… (#38655) 2025-02-03 11:12:29 +05:30
PublishedApps ci: Fixing cypress tests that are failing due to the change from executeOnLoad to runBehavior (#40489) 2025-04-30 20:21:02 +05:30
Refactoring chore: Removing the feature flag for using Entity Item component from ADS templates (#39093) 2025-03-14 17:40:02 +05:30
SetProperty ci: Fixing cypress tests that are failing due to the change from executeOnLoad to runBehavior (#40489) 2025-04-30 20:21:02 +05:30
SettingsPane chore: Added sanity and tags for blank tag specs (#36421) 2024-09-19 18:21:58 +05:30
Templates chore: git mod - test fixes (#38357) 2025-01-07 12:30:42 +01:00
ThemingTests chore: Addding dependent tags (#36965) 2024-10-18 18:19:08 +05:30
UserProfile feat: Updating admin settings page as per new designs (#40101) 2025-04-07 15:44:20 +05:30
VisualTests fix: Checking fix working for js indent failure (#38382) 2024-12-27 08:43:46 +05:30
Widgets feat: Implement empty meta widget generation for handling empty data scenarios (#40886) 2025-06-20 09:39:51 +05:30
Workspace chore: Addding dependent tags (#36965) 2024-10-18 18:19:08 +05:30