rusackas opened a new pull request, #41532:
URL: https://github.com/apache/superset/pull/41532

   ### SUMMARY
   
   When a dashboard's serialized layout exceeds 
`SUPERSET_DASHBOARD_POSITION_DATA_LIMIT` (default `65535` bytes), saving layout 
edits is blocked in the UI with a generic toast:
   
   > Your dashboard is too large. Please reduce its size before saving it.
   
   This gives the user no indication of *how* large the layout is, what the 
limit is, or how to change it — leading to lengthy debugging (see #41528, where 
a programmatically-imported 120-chart dashboard hit the wall after importing 
fine).
   
   This PR:
   
   1. **Improves the error message** to include the actual layout size, the 
configured limit, and the name of the config setting to raise — the values are 
already in scope at the check site (`positionJSONLength` and `limit`), so this 
is a small, self-contained change:
   
      > Your dashboard is too large to save: the layout is 74,960 bytes but the 
limit is 65,535 bytes. Reduce the dashboard size (for example, split it into 
multiple dashboards) or raise the SUPERSET_DASHBOARD_POSITION_DATA_LIMIT config 
setting.
   
   2. **Documents `SUPERSET_DASHBOARD_POSITION_DATA_LIMIT`** in the 
configuration reference — it was previously undocumented. The note covers the 
default, the historical MySQL `TEXT` rationale, when/how to raise it, and the 
fact that an imported oversized dashboard renders but can't be re-saved until 
the limit is raised.
   
   The reporter (@Hamidcha-Mosaab) offered to take the error-message change; 
this folds it together with the docs gap they also identified, and credit goes 
to them for the thorough write-up.
   
   ### BEFORE/AFTER
   
   **Before:** `Your dashboard is too large. Please reduce its size before 
saving it.`
   
   **After:** `Your dashboard is too large to save: the layout is 74,960 bytes 
but the limit is 65,535 bytes. Reduce the dashboard size (for example, split it 
into multiple dashboards) or raise the SUPERSET_DASHBOARD_POSITION_DATA_LIMIT 
config setting.`
   
   ### TESTING INSTRUCTIONS
   
   1. Set a small `SUPERSET_DASHBOARD_POSITION_DATA_LIMIT` (e.g. `1`) in 
`superset_config.py`, or build a dashboard whose layout exceeds the default.
   2. Open the dashboard in Edit mode, move/resize a chart, and click **Save**.
   3. The error toast now reports the actual size, the limit, and the config 
key.
   
   Unit test added in `Header.test.tsx` covering the oversized-layout path 
(blocks save, surfaces size/limit/config key).
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: #41528
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to