rusackas commented on code in PR #44101:
URL: https://github.com/apache/superset/pull/44101#discussion_r4316301581
##########
superset-frontend/packages/superset-core/src/extensions/index.ts:
##########
@@ -65,6 +100,12 @@ export interface ExtensionContext {
* All keys are automatically namespaced to prevent collisions.
*/
storage: ExtensionStorage;
+
+ /**
+ * Global, host-level UI surfaces (e.g. toast notifications) not scoped to
+ * any single view or panel.
+ */
+ window: ExtensionWindow;
Review Comment:
Agreed, moved it. The toast functions are now a top-level `window` namespace
(`window.showInformationMessage` etc.) in
`packages/superset-core/src/window/index.ts`, host impl in `src/core/window`,
and `ctx.window` is gone from `ExtensionContext`. Pushed in 010e2548cac6. I
could not run jest/tsc in this worktree, so CI is the first real check.
##########
superset-frontend/packages/superset-core/src/extensions/index.ts:
##########
@@ -48,6 +48,41 @@
import { Extension } from '../common';
import { ExtensionStorage } from '../storage';
+/**
+ * Options for a toast shown via `ExtensionWindow`.
+ */
+export interface ExtensionMessageOptions {
+ /**
+ * How long the toast stays visible, in milliseconds. Falls back to the
+ * host's per-severity default (see `MessageToasts/actions`) when omitted.
+ */
+ duration?: number;
+}
+
+/**
+ * Global, host-level UI surfaces available to an extension, independent of
+ * any specific view or panel it has registered.
+ */
+export interface ExtensionWindow {
Review Comment:
Done, `window` is now its own namespace (`window.showInformationMessage`
etc.) instead of hanging off the context. Pushed in 010e2548cac6.
##########
superset-frontend/packages/superset-core/src/extensions/index.ts:
##########
@@ -65,6 +100,12 @@ export interface ExtensionContext {
* All keys are automatically namespaced to prevent collisions.
*/
storage: ExtensionStorage;
+
+ /**
+ * Global, host-level UI surfaces (e.g. toast notifications) not scoped to
+ * any single view or panel.
+ */
+ window: ExtensionWindow;
Review Comment:
No good reason, it was just where I put it. Removed from `ExtensionContext`
and exposed as a top-level `window` namespace in 010e2548cac6.
--
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]