rusackas opened a new pull request, #41285: URL: https://github.com/apache/superset/pull/41285
### SUMMARY Lets extensions contribute first-class SQL Lab experiences: a full-pane replacement for the default editor/SouthPane split, and their own tab types in the `+` new-tab dropdown. - Adds two view locations in `SqlLab/contributions.ts`: `sqllab.northPane` (full-pane replacement) and `sqllab.newTab` (tab types in the `+` dropdown). - `PENDING_NORTH_PANE_VIEW_KEY`: an extension sets this `localStorage` key before calling `sqlLab.createTab()` to declare which northPane view the new tab opens with. `SqlEditor` consumes/removes it on init, then persists the choice per-tab so the mode survives reloads. - Exposes `Tab.backendId` on the public `superset-core` `Tab` interface so extensions can correlate UI tabs with their `tabstateview` row. - `TabbedSqlEditors`: the `+` button becomes a `Dropdown` when extensions contribute `newTab` items, listing the built-in **SQL Editor** plus any contributed tab types. - `ExtensionsStartup`: surfaces extension load errors as warning toasts instead of only logging. This is a clean re-target of #774 onto `apache:master`. That PR was opened against a fork branch and stacked on the unmerged Tier 1/2 storage work, which inflated the diff and caused conflicts. The feature itself doesn't depend on the storage code, so this drops the storage stack and rebases just the contribution-surfaces commit (original authorship preserved). Adapted to `master`'s evolution since the branch forked: - `SqlEditor` consumes `master`'s reactive `useViews()` hook (added in #40915) instead of a custom `onViewsChange()` subscription, so a northPane view appears when an extension registers it asynchronously, without blocking initial render. - `ExtensionsStartup` keeps `master`'s non-blocking async extension load (#40915) and adds the error-toast surfacing (dropping the original `initialized`-gate, which is no longer needed now that views are reactive). - The `+` icon is wrapped in `master`'s `AddTabIconWrapper` for styling consistency. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A (extension contribution surfaces; visible only with an extension registering `sqllab.northPane` / `sqllab.newTab` views). ### TESTING INSTRUCTIONS `cd superset-frontend && npx jest src/extensions/ExtensionsStartup.test.tsx src/SqlLab/components/SqlEditor/SqlEditor.test.tsx src/SqlLab/components/TabbedSqlEditors/TabbedSqlEditors.test.tsx` With `EnableExtensions` on, an extension that registers a `sqllab.northPane` view (and sets `PENDING_NORTH_PANE_VIEW_KEY` before `createTab()`) opens a tab rendering that view in place of the default editor; registering a `sqllab.newTab` command turns the `+` button into a dropdown. ### ADDITIONAL INFORMATION <!-- Supersedes michael-s-molina/superset#774 --> - [ ] Has associated issue: - [x] Required feature flags: `EnableExtensions` - [x] Changes UI - [ ] Includes DB Migration - [x] 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]
