msyavuz opened a new pull request, #45022:
URL: https://github.com/apache/superset/pull/45022
### SUMMARY
Prototype for the Canvas SIP (#44989), the companion to SIP-231 (#44875): a
new `Canvas` entity whose definition places widget instances, edited through
atomic, validated operations by people and agents alike. Built on the SIP-231
prototype's widget framework (ported from `dashboard-v2`), all behind the
`CANVAS` flag.
- **Document:** placements keyed by readable ids (`revenue-trend`), holding
an inline instance (`widgetType`, `schemaVersion`, `props`) or a persisted
widget (`widgetId`); filter scope per placement; canvas settings.
- **Editing:** `PATCH /api/v1/canvas/{id_or_uuid}/definition` with `add`,
`set_props`, `place`, `move`, `remove`, `set_scope`, `set_settings` against a
base revision; non-overlapping concurrent edits merge, overlapping ones get 409.
- **Widgets:** `WidgetBehavior` / `WidgetUi` declare nesting, child layout
and filter roles; core adds `tabs`, `tab`, `group`.
- **Agents:** MCP `get_canvas` and `apply_canvas_ops`.
- **Page:** read-only `/canvas/<id or slug>/`, rendering containers and
markdown, kept current over the realtime channel.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A: new, flag-gated page; charts don't render until SIP-231's data path
lands, so the page shows containers, markdown and placeholders.
### TESTING INSTRUCTIONS
1. Set `FEATURE_FLAGS = {"CANVAS": True}`, run `superset db upgrade` and
`superset init`.
2. `POST /api/v1/canvas/` with a title, then `PATCH .../definition` with
`{"base_revision": 1, "ops": [{"op": "add", "widgetType": "markdown", "props":
{"content": "Hello"}}]}`.
3. Open `/canvas/<id>/`; the markdown renders. With the flag off, the canvas
routes and APIs answer 404.
4. `pytest tests/unit_tests/canvas tests/unit_tests/widgets
tests/unit_tests/mcp_service/canvas`
### ADDITIONAL INFORMATION
- [x] Has associated issue: #44989 (Canvas SIP), #44875 (SIP-231)
- [x] Required feature flags: `CANVAS`
- [x] Changes UI: new list and view pages behind the flag
- [x] Includes DB Migration: adds `canvases`, `canvas_ops`,
`canvas_editors`, `canvas_viewers`
- [x] Migration is atomic, supports rollback & is backwards-compatible:
new tables only
- [x] Confirm DB migration upgrade and downgrade tested: on SQLite
- [x] Runtime estimates and downtime expectations provided: new empty
tables, no downtime
- [x] Introduces new feature or API
- [ ] Removes existing feature or API: no
--
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]