bito-code-review[bot] commented on code in PR #38410:
URL: https://github.com/apache/superset/pull/38410#discussion_r2894942932
##########
superset/mcp_service/dashboard/tool/generate_dashboard.py:
##########
@@ -138,6 +138,40 @@ def _create_dashboard_layout(chart_objects: List[Any]) ->
Dict[str, Any]:
return layout
+_MAX_TITLE_LENGTH = 150
+
+
+def _generate_title_from_charts(chart_objects: List[Any]) -> str:
+ """
+ Build a descriptive dashboard title from the included chart names.
+
+ Joins up to three chart ``slice_name`` values with " & " (two charts)
+ or ", " (three charts). When there are more than three charts the
+ remaining count is appended as "+ N more". The result is capped at
+ ``_MAX_TITLE_LENGTH`` characters.
+
+ Returns ``"Dashboard"`` when *chart_objects* is empty or no chart has
+ a usable name.
+ """
+ names = [c.slice_name for c in chart_objects if getattr(c, "slice_name",
None)]
+ if not names:
+ return "Dashboard"
Review Comment:
<!-- Bito Reply -->
Your reasoning is sound. MCP API responses are in English for LLM
consumption, not UI rendering, so translation isn't needed. This aligns with
other MCP-specific strings in the codebase.
--
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]