rusackas commented on code in PR #41285:
URL: https://github.com/apache/superset/pull/41285#discussion_r3454400727
##########
superset-frontend/src/SqlLab/contributions.ts:
##########
@@ -46,5 +46,27 @@ export const ViewLocations = {
statusBar: 'sqllab.statusBar',
results: 'sqllab.results',
queryHistory: 'sqllab.queryHistory',
+ // Extensions can register a full-pane replacement here. SqlEditor renders
+ // the registered view instead of the default editor+SouthPane split when
+ // a tab was opened in that mode.
+ northPane: 'sqllab.northPane',
+ // Extensions register tab-type commands here. When any are present the
+ // "+" new-tab button becomes a dropdown listing all registered tab types
+ // plus the built-in SQL Editor option.
+ newTab: 'sqllab.newTab',
},
} as const;
+
+/**
+ * localStorage key an extension sets before calling createTab() to declare
+ * which northPane view the new tab should open with. The value must be the
+ * view ID passed to views.registerView() (e.g. "my-ext.northPane"). SqlEditor
+ * consumes and removes this key during initialization, then persists the
chosen
+ * view ID under a per-tab key so the mode survives page reloads.
+ *
+ * @example
+ * // In an extension's newTab command handler:
+ * localStorage.setItem(PENDING_NORTH_PANE_VIEW_KEY, 'my-ext.northPane');
+ * sqlLab.createTab({ title: 'My View' });
+ */
+export const PENDING_NORTH_PANE_VIEW_KEY = 'sqllab.pendingNorthPaneView';
Review Comment:
The pending key is written then consumed on the same synchronous `createTab`
handoff, so back-to-back creations don't actually interleave here. Tokenizing
it would mean threading the view id through the public `createTab` payload,
which feels like its own change rather than part of this wiring — leaving the
single-key handoff as-is.
--
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]