bito-code-review[bot] commented on code in PR #37970:
URL: https://github.com/apache/superset/pull/37970#discussion_r2835447425


##########
superset/mcp_service/dashboard/tool/generate_dashboard.py:
##########
@@ -55,23 +60,26 @@ def _create_dashboard_layout(chart_objects: List[Any]) -> 
Dict[str, Any]:
     # Grid configuration based on real Superset dashboard patterns
     # Use 2-chart rows with medium-sized charts (like existing dashboards)
     charts_per_row = 2
-    chart_width = 5  # Balanced width for good proportions
+    chart_width = GRID_DEFAULT_CHART_WIDTH
     chart_height = 50  # Good height for most chart types
 
-    # Create rows with charts
+    # Create rows with charts wrapped in columns
     row_ids = []
     for i in range(0, len(chart_objects), charts_per_row):
-        row_index = i // charts_per_row
-        row_id = f"ROW-{row_index}"
+        row_id = generate_id("ROW")
         row_ids.append(row_id)
 
         # Get charts for this row (up to 2 charts like real dashboards)
         row_charts = chart_objects[i : i + charts_per_row]
-        chart_keys = []
+        column_keys = []
+
+        # Calculate column width: divide grid evenly among charts in this row
+        col_width = GRID_COLUMN_COUNT // len(row_charts)

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Uneven grid width distribution</b></div>
   <div id="fix">
   
   The column width calculation uses simple integer division, which fails to 
fill the entire 12-column grid when the chart count doesn't divide evenly. For 
instance, 5 charts each get width 2 (total 10), leaving 2 columns unused. This 
could cause layout gaps or misalignment. Consider distributing widths more 
evenly, e.g., base width + remainder allocation.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #8eab35</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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