You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by en...@apache.org on 2026/06/12 12:59:32 UTC

(superset) branch enxdev/feat/adds-chat-cotribution-type created (now 79792bf26f3)

This is an automated email from the ASF dual-hosted git repository.

EnxDev pushed a change to branch enxdev/feat/adds-chat-cotribution-type
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 79792bf26f3 feat(extensions): add dedicated chat contribution type

This branch includes the following new commits:

     new 79792bf26f3 feat(extensions): add dedicated chat contribution type

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: feat(extensions): add dedicated chat contribution type

Posted by en...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

EnxDev pushed a commit to branch enxdev/feat/adds-chat-cotribution-type
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 79792bf26f3c59390f39cf407bacadde0cc301c9
Author: Enzo Martellucci <en...@gmail.com>
AuthorDate: Fri Jun 12 10:17:16 2026 +0200

    feat(extensions): add dedicated chat contribution type
    
    Replace the view-based chatbot registration (views.registerView at the
    core.chatbot location) with a first-class chat contribution type.
    
    - Add the public `chat` namespace to @apache-superset/core:
      registerChat(descriptor, trigger, panel), open/close/isOpen,
      floating/panel display modes, and registration/state events
    - Implement the host chat registry in src/core/chat with singleton
      resolution (last-registered wins, falls back on dispose) and expose
      it on window.superset
    - Add `chat` to the manifest Contributions schema; drop the app.chatbot
      view location and AppLocation scope
    - Rename ChatbotMount to ChatMount and drive it from the chat registry:
      floating mode renders the trigger bubble plus the panel while open;
      panel mode docks the open panel on the right edge as an interim
      stand-in for the future header/footer layout slot
    - Remove the now-unused chatbot-era view registry helpers
      (subscribeToRegistry, getRegistryVersion, getViewProvider,
      getRegisteredViewIds)
    
    Co-Authored-By: Claude Fable 5 <no...@anthropic.com>
---
 .../packages/superset-core/package.json            |   4 +
 .../packages/superset-core/src/chat/index.ts       | 161 +++++++++++++++++++
 .../superset-core/src/contributions/index.ts       |  14 +-
 .../packages/superset-core/src/index.ts            |   1 +
 .../packages/superset-core/src/views/index.ts      |   9 --
 .../src/components/ChatMount/ChatMount.test.tsx    | 178 +++++++++++++++++++++
 .../src/components/ChatMount/index.tsx             | 135 ++++++++++++++++
 .../components/ChatbotMount/ChatbotMount.test.tsx  | 110 -------------
 .../src/components/ChatbotMount/index.tsx          |  94 -----------
 superset-frontend/src/core/chat/index.test.ts      | 166 +++++++++++++++++++
 superset-frontend/src/core/chat/index.ts           | 167 +++++++++++++++++++
 superset-frontend/src/core/chatbot/index.test.ts   |  97 -----------
 superset-frontend/src/core/chatbot/index.ts        |  70 --------
 superset-frontend/src/core/index.ts                |   1 +
 superset-frontend/src/core/utils.ts                |  29 +++-
 superset-frontend/src/core/views/index.test.ts     |  63 +-------
 superset-frontend/src/core/views/index.ts          |  46 ------
 .../src/extensions/ExtensionsStartup.test.tsx      |   1 +
 .../src/extensions/ExtensionsStartup.tsx           |   6 +-
 superset-frontend/src/extensions/supersetGlobal.ts |   2 +
 superset-frontend/src/views/App.tsx                |  10 +-
 superset-frontend/src/views/contributions.ts       |  31 ----
 22 files changed, 861 insertions(+), 534 deletions(-)

diff --git a/superset-frontend/packages/superset-core/package.json b/superset-frontend/packages/superset-core/package.json
index 0df87979aca..2866673fe5b 100644
--- a/superset-frontend/packages/superset-core/package.json
+++ b/superset-frontend/packages/superset-core/package.json
@@ -18,6 +18,10 @@
       "types": "./lib/authentication/index.d.ts",
       "default": "./lib/authentication/index.js"
     },
+    "./chat": {
+      "types": "./lib/chat/index.d.ts",
+      "default": "./lib/chat/index.js"
+    },
     "./dashboard": {
       "types": "./lib/dashboard/index.d.ts",
       "default": "./lib/dashboard/index.js"
diff --git a/superset-frontend/packages/superset-core/src/chat/index.ts b/superset-frontend/packages/superset-core/src/chat/index.ts
new file mode 100644
index 00000000000..5923a778f55
--- /dev/null
+++ b/superset-frontend/packages/superset-core/src/chat/index.ts
@@ -0,0 +1,161 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @fileoverview Chat contribution API for Superset extensions.
+ *
+ * Chat is a dedicated contribution type (not a view): an extension registers
+ * a chat via {@link registerChat} and the host owns where and how it is
+ * mounted. The host applies singleton resolution — multiple chat extensions
+ * may register, but exactly one is active at a time.
+ *
+ * @example
+ * ```typescript
+ * import { chat } from '@apache-superset/core';
+ *
+ * chat.registerChat(
+ *   { id: 'acme.chat', name: 'Acme Chat' },
+ *   () => <AcmeTrigger />,
+ *   () => <AcmePanel />,
+ * );
+ * ```
+ */
+
+import { ReactElement } from 'react';
+import type { Disposable, Event } from '../common';
+
+export interface Chat {
+  /** The unique identifier for the chat. */
+  id: string;
+  /** The display name of the chat. */
+  name: string;
+  /** Optional description of the chat, for display in contribution manifests. */
+  description?: string;
+}
+
+export type ChatMode = 'floating' | 'panel';
+
+/**
+ * Registers a chat provider. The host applies singleton resolution —
+ * only one chat is active at a time per RFC §4.3.
+ * Disposing the returned Disposable unregisters the chat.
+ *
+ * @param chat The chat descriptor (id, name).
+ * @param trigger A function returning the collapsed bubble element. Owned by
+ *   the extension — dynamic state such as unread counts and badges lives here.
+ *   Hidden by the host when in panel mode.
+ * @param panel A function returning the chat panel element. Mounted by the
+ *   host as a floating overlay in 'floating' mode, or as a layout slot between
+ *   the header and footer in 'panel' mode. Same component in both modes.
+ * @returns A Disposable that unregisters the chat when disposed.
+ *
+ * @example
+ * ```typescript
+ * chat.registerChat(
+ *   { id: 'acme.chat', name: 'Acme Chat' },
+ *   () => <AcmeTrigger />,
+ *   () => <AcmePanel />,
+ * );
+ * ```
+ */
+export declare function registerChat(
+  chat: Chat,
+  trigger: () => ReactElement,
+  panel: () => ReactElement,
+): Disposable;
+
+/**
+ * Returns the active chat descriptor.
+ *
+ * @returns The registered Chat descriptor, or undefined if none is registered.
+ */
+export declare function getChat(): Chat | undefined;
+
+/**
+ * Event fired when a chat is registered.
+ */
+export declare const onDidRegisterChat: Event<Chat>;
+
+/**
+ * Event fired when a chat is unregistered.
+ */
+export declare const onDidUnregisterChat: Event<Chat>;
+
+/**
+ * Opens the chat panel.
+ */
+export declare function open(): void;
+
+/**
+ * Closes the chat panel.
+ */
+export declare function close(): void;
+
+/**
+ * Returns whether the chat panel is currently open.
+ *
+ * @returns True if the chat panel is open.
+ */
+export declare function isOpen(): boolean;
+
+/**
+ * Event fired when the chat panel opens.
+ */
+export declare const onDidOpen: Event<void>;
+
+/**
+ * Event fired when the chat panel closes.
+ */
+export declare const onDidClose: Event<void>;
+
+/**
+ * Returns the current display mode.
+ *
+ * @returns The current ChatMode.
+ */
+export declare function getMode(): ChatMode;
+
+/**
+ * Sets the display mode.
+ *
+ * The host supports both modes on all pages. The host also exposes a mode
+ * toggle in its chrome — use onDidChangeMode to react to changes initiated
+ * outside the extension.
+ *
+ * @param mode The display mode to switch to.
+ */
+export declare function setMode(mode: ChatMode): void;
+
+/**
+ * Event fired when the display mode changes, whether triggered by the
+ * extension via setMode() or by the user through host-provided controls.
+ */
+export declare const onDidChangeMode: Event<ChatMode>;
+
+/**
+ * Event fired when the user resizes the panel in panel mode.
+ *
+ * The host owns the resizer handle and drag interaction. Listen to this
+ * event to adapt internal layout to the available width.
+ */
+export declare const onDidResizePanel: Event<{ width: number }>;
+
+// TODO: client actions API — tool availability functions will be added here
+// once the client_actions SIP is finalized. The chat namespace is the
+// intended integration point between the two SIPs.
diff --git a/superset-frontend/packages/superset-core/src/contributions/index.ts b/superset-frontend/packages/superset-core/src/contributions/index.ts
index 86cf42d1959..e514c17cb57 100644
--- a/superset-frontend/packages/superset-core/src/contributions/index.ts
+++ b/superset-frontend/packages/superset-core/src/contributions/index.ts
@@ -26,6 +26,7 @@
  * menus, editors) and re-exported here for the manifest schema.
  */
 
+import { Chat } from '../chat';
 import { Command } from '../commands';
 import { View } from '../views';
 import { Menu } from '../menus';
@@ -43,9 +44,6 @@ export type SqlLabLocation =
   | 'results'
   | 'queryHistory';
 
-/** Valid locations within the app shell (persist across all routes). */
-export type AppLocation = 'chatbot';
-
 /**
  * Nested structure for view contributions by scope and location.
  * @example
@@ -58,7 +56,6 @@ export type AppLocation = 'chatbot';
  */
 export interface ViewContributions {
   sqllab?: Partial<Record<SqlLabLocation, View[]>>;
-  app?: Partial<Record<AppLocation, View[]>>;
 }
 
 /**
@@ -75,7 +72,8 @@ export interface MenuContributions {
 }
 
 /**
- * Aggregates all contributions (commands, menus, views, and editors) provided by an extension or module.
+ * Aggregates all contributions (commands, menus, views, editors, and chats)
+ * provided by an extension or module.
  */
 export interface Contributions {
   /** List of commands. */
@@ -86,4 +84,10 @@ export interface Contributions {
   views: ViewContributions;
   /** List of editors. */
   editors?: Editor[];
+  /**
+   * Chats contributed by the extension. Chat is its own contribution type
+   * (not a view): the host applies singleton resolution and renders exactly
+   * one active chat at a time.
+   */
+  chat?: Chat[];
 }
diff --git a/superset-frontend/packages/superset-core/src/index.ts b/superset-frontend/packages/superset-core/src/index.ts
index 79c699caff4..417a8af2e82 100644
--- a/superset-frontend/packages/superset-core/src/index.ts
+++ b/superset-frontend/packages/superset-core/src/index.ts
@@ -18,6 +18,7 @@
  */
 export * as common from './common';
 export * as authentication from './authentication';
+export * as chat from './chat';
 export * as commands from './commands';
 export * as dashboard from './dashboard';
 export * as dataset from './dataset';
diff --git a/superset-frontend/packages/superset-core/src/views/index.ts b/superset-frontend/packages/superset-core/src/views/index.ts
index 33f69292065..32c27a17912 100644
--- a/superset-frontend/packages/superset-core/src/views/index.ts
+++ b/superset-frontend/packages/superset-core/src/views/index.ts
@@ -75,15 +75,6 @@ export interface View {
  *   () => <ResultStatsPanel />,
  * );
  * ```
- *
- * @example Chatbot bubble (`core.chatbot` — singleton, host renders one)
- * ```typescript
- * views.registerView(
- *   { id: 'my_ext.chatbot', name: 'My Chatbot', icon: 'Bubble' },
- *   'core.chatbot',
- *   () => <ChatbotApp />,
- * );
- * ```
  */
 export declare function registerView(
   view: View,
diff --git a/superset-frontend/src/components/ChatMount/ChatMount.test.tsx b/superset-frontend/src/components/ChatMount/ChatMount.test.tsx
new file mode 100644
index 00000000000..fa368af6c35
--- /dev/null
+++ b/superset-frontend/src/components/ChatMount/ChatMount.test.tsx
@@ -0,0 +1,178 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { act, render, screen } from 'spec/helpers/testing-library';
+import { chat } from 'src/core/chat';
+import ChatMount from '.';
+
+const disposables: Array<{ dispose: () => void }> = [];
+
+afterEach(() => {
+  disposables.forEach(d => d.dispose());
+  disposables.length = 0;
+  // Reset host-owned state shared across tests in this module.
+  act(() => {
+    chat.close();
+    chat.setMode('floating');
+  });
+});
+
+test('renders nothing when no chat extension is registered', () => {
+  render(<ChatMount />);
+
+  expect(screen.queryByTestId('chat-mount')).not.toBeInTheDocument();
+});
+
+test('renders the trigger bubble of the registered chat', () => {
+  disposables.push(
+    chat.registerChat(
+      { id: 'acme.chat', name: 'Acme Chat' },
+      () => <button type="button">Acme Bubble</button>,
+      () => <div>Acme Panel</div>,
+    ),
+  );
+
+  render(<ChatMount />);
+
+  expect(screen.getByTestId('chat-mount')).toBeInTheDocument();
+  expect(screen.getByText('Acme Bubble')).toBeInTheDocument();
+  // The panel stays unmounted until the chat is opened.
+  expect(screen.queryByText('Acme Panel')).not.toBeInTheDocument();
+});
+
+test('mounts the panel when the chat opens and unmounts it on close', () => {
+  disposables.push(
+    chat.registerChat(
+      { id: 'acme.chat', name: 'Acme Chat' },
+      () => <button type="button">Acme Bubble</button>,
+      () => <div>Acme Panel</div>,
+    ),
+  );
+
+  render(<ChatMount />);
+
+  act(() => chat.open());
+
+  expect(screen.getByText('Acme Panel')).toBeInTheDocument();
+  // In floating mode the trigger stays mounted alongside the open panel.
+  expect(screen.getByText('Acme Bubble')).toBeInTheDocument();
+
+  act(() => chat.close());
+
+  expect(screen.queryByText('Acme Panel')).not.toBeInTheDocument();
+});
+
+test('renders the last-registered chat when several are installed', () => {
+  disposables.push(
+    chat.registerChat(
+      { id: 'first.chat', name: 'First Chat' },
+      () => <div>First Bubble</div>,
+      () => <div>First Panel</div>,
+    ),
+    chat.registerChat(
+      { id: 'second.chat', name: 'Second Chat' },
+      () => <div>Second Bubble</div>,
+      () => <div>Second Panel</div>,
+    ),
+  );
+
+  render(<ChatMount />);
+
+  // Last-loaded wins: the second registration takes over the singleton slot.
+  expect(screen.getByText('Second Bubble')).toBeInTheDocument();
+  expect(screen.queryByText('First Bubble')).not.toBeInTheDocument();
+});
+
+test('reacts to a chat registering after the initial render', () => {
+  render(<ChatMount />);
+
+  expect(screen.queryByTestId('chat-mount')).not.toBeInTheDocument();
+
+  act(() => {
+    disposables.push(
+      chat.registerChat(
+        { id: 'acme.chat', name: 'Acme Chat' },
+        () => <button type="button">Acme Bubble</button>,
+        () => <div>Acme Panel</div>,
+      ),
+    );
+  });
+
+  expect(screen.getByText('Acme Bubble')).toBeInTheDocument();
+});
+
+test('panel mode docks the open panel and hides the trigger', () => {
+  disposables.push(
+    chat.registerChat(
+      { id: 'acme.chat', name: 'Acme Chat' },
+      () => <button type="button">Acme Bubble</button>,
+      () => <div>Acme Panel</div>,
+    ),
+  );
+
+  render(<ChatMount />);
+
+  act(() => {
+    chat.setMode('panel');
+    chat.open();
+  });
+
+  expect(screen.getByText('Acme Panel')).toBeInTheDocument();
+  expect(screen.queryByText('Acme Bubble')).not.toBeInTheDocument();
+
+  act(() => chat.close());
+
+  // A closed chat in panel mode renders nothing — the trigger is hidden too.
+  expect(screen.queryByTestId('chat-mount')).not.toBeInTheDocument();
+});
+
+test('isolates a failing chat so it does not crash the host', () => {
+  const FailingTrigger = () => {
+    throw new Error('chat blew up');
+  };
+  disposables.push(
+    chat.registerChat(
+      { id: 'acme.chat', name: 'Acme Chat' },
+      () => <FailingTrigger />,
+      () => <div>Acme Panel</div>,
+    ),
+  );
+
+  // The host-owned error boundary catches the failure; render does not throw.
+  expect(() => render(<ChatMount />)).not.toThrow();
+  // The mount slot still renders (the boundary lives inside it), confirming
+  // the provider was actually exercised and contained.
+  expect(screen.getByTestId('chat-mount')).toBeInTheDocument();
+});
+
+test('isolates a chat whose provider function itself throws', () => {
+  disposables.push(
+    chat.registerChat(
+      { id: 'acme.chat', name: 'Acme Chat' },
+      () => {
+        throw new Error('provider blew up');
+      },
+      () => <div>Acme Panel</div>,
+    ),
+  );
+
+  // ChatRenderer wraps provider() in a component so ErrorBoundary catches
+  // synchronous throws from the provider function, not just from its output.
+  expect(() => render(<ChatMount />)).not.toThrow();
+  expect(screen.getByTestId('chat-mount')).toBeInTheDocument();
+});
diff --git a/superset-frontend/src/components/ChatMount/index.tsx b/superset-frontend/src/components/ChatMount/index.tsx
new file mode 100644
index 00000000000..88d051a950f
--- /dev/null
+++ b/superset-frontend/src/components/ChatMount/index.tsx
@@ -0,0 +1,135 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import {
+  type ReactElement,
+  useMemo,
+  useRef,
+  useSyncExternalStore,
+} from 'react';
+import { t } from '@apache-superset/core/translation';
+import { logging } from '@apache-superset/core/utils';
+import { css, useTheme } from '@apache-superset/core/theme';
+import { ErrorBoundary } from 'src/components/ErrorBoundary';
+import { addDangerToast } from 'src/components/MessageToasts/actions';
+import { store } from 'src/views/store';
+import {
+  chat,
+  getActiveChat,
+  subscribeToChatState,
+  getChatStateVersion,
+} from 'src/core/chat';
+
+const CHAT_EDGE_MARGIN = 24;
+const PANEL_MODE_WIDTH = 400;
+
+/**
+ * Wraps a chat provider in a React component so that ErrorBoundary can catch
+ * synchronous throws from the provider function itself. Calling `provider()`
+ * inline (e.g. `{activeChat.panel()}`) would throw outside React's render
+ * boundary and crash the host.
+ */
+const ChatRenderer = ({ provider }: { provider: () => ReactElement }) =>
+  provider();
+
+const ChatMount = () => {
+  const theme = useTheme();
+  // Notify once per mount; a crash can re-render and would otherwise re-toast.
+  const crashNotified = useRef(false);
+
+  // The active chat, the open state, and the display mode all live in the
+  // chat registry. Read via useSyncExternalStore so the mount re-renders
+  // whenever a chat extension registers/disposes or toggles its state.
+  const stateVersion = useSyncExternalStore(
+    subscribeToChatState,
+    getChatStateVersion,
+  );
+
+  const activeChat = useMemo(() => getActiveChat(), [stateVersion]);
+  const panelOpen = chat.isOpen();
+  const mode = chat.getMode();
+
+  if (!activeChat) {
+    return null;
+  }
+
+  const onProviderError = (error: Error) => {
+    // Fault isolation: contain the crash, log it, surface a one-time
+    // notification, and leave the slot empty rather than parking a
+    // persistent error card.
+    logging.error('[chat] provider crashed', error);
+    if (!crashNotified.current) {
+      crashNotified.current = true;
+      store.dispatch(addDangerToast(t('The chat failed to load.')));
+    }
+  };
+
+  if (mode === 'panel') {
+    // Panel mode hides the trigger and docks the panel to the right edge.
+    // Interim approximation of the "layout slot between header and footer"
+    // from the chat API contract — the dock overlays the page until the host
+    // grows a real layout slot and resizer chrome.
+    if (!panelOpen) {
+      return null;
+    }
+    return (
+      <div
+        data-test="chat-mount"
+        css={css`
+          position: fixed;
+          top: 0;
+          right: 0;
+          bottom: 0;
+          width: ${PANEL_MODE_WIDTH}px;
+          background: ${theme.colorBgContainer};
+          box-shadow: ${theme.boxShadow};
+          /* Above dashboard content and the toast layer, below modal dialogs. */
+          z-index: ${theme.zIndexPopupBase + 2};
+        `}
+      >
+        <ErrorBoundary showMessage={false} onError={onProviderError}>
+          <ChatRenderer provider={activeChat.panel} />
+        </ErrorBoundary>
+      </div>
+    );
+  }
+
+  return (
+    <div
+      data-test="chat-mount"
+      css={css`
+        position: fixed;
+        right: ${CHAT_EDGE_MARGIN}px;
+        bottom: ${CHAT_EDGE_MARGIN}px;
+        display: flex;
+        flex-direction: column;
+        align-items: flex-end;
+        gap: ${theme.sizeUnit * 2}px;
+        /* Above dashboard content and the toast layer, below modal dialogs. */
+        z-index: ${theme.zIndexPopupBase + 2};
+      `}
+    >
+      <ErrorBoundary showMessage={false} onError={onProviderError}>
+        {panelOpen && <ChatRenderer provider={activeChat.panel} />}
+        <ChatRenderer provider={activeChat.trigger} />
+      </ErrorBoundary>
+    </div>
+  );
+};
+
+export default ChatMount;
diff --git a/superset-frontend/src/components/ChatbotMount/ChatbotMount.test.tsx b/superset-frontend/src/components/ChatbotMount/ChatbotMount.test.tsx
deleted file mode 100644
index 683e32b6592..00000000000
--- a/superset-frontend/src/components/ChatbotMount/ChatbotMount.test.tsx
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { render, screen } from 'spec/helpers/testing-library';
-import { views } from 'src/core';
-import { CHATBOT_LOCATION } from 'src/views/contributions';
-import ChatbotMount from '.';
-
-const disposables: Array<{ dispose: () => void }> = [];
-
-afterEach(() => {
-  disposables.forEach(d => d.dispose());
-  disposables.length = 0;
-});
-
-test('renders nothing when no chatbot extension is registered', () => {
-  render(<ChatbotMount />);
-
-  expect(screen.queryByTestId('chatbot-mount')).not.toBeInTheDocument();
-});
-
-test('renders the registered chatbot inside the fixed mount slot', () => {
-  const provider = () => <div>My Chatbot Bubble</div>;
-  disposables.push(
-    views.registerView(
-      { id: 'core.chatbot', name: 'Superset Chatbot' },
-      CHATBOT_LOCATION,
-      provider,
-    ),
-  );
-
-  render(<ChatbotMount />);
-
-  expect(screen.getByTestId('chatbot-mount')).toBeInTheDocument();
-  expect(screen.getByText('My Chatbot Bubble')).toBeInTheDocument();
-});
-
-test('renders the last-registered chatbot when several are installed', () => {
-  const firstProvider = () => <div>First Bubble</div>;
-  const secondProvider = () => <div>Second Bubble</div>;
-  disposables.push(
-    views.registerView(
-      { id: 'first.chatbot', name: 'First Chatbot' },
-      CHATBOT_LOCATION,
-      firstProvider,
-    ),
-    views.registerView(
-      { id: 'second.chatbot', name: 'Second Chatbot' },
-      CHATBOT_LOCATION,
-      secondProvider,
-    ),
-  );
-
-  render(<ChatbotMount />);
-
-  // Last-loaded wins: the second registration takes over the singleton bubble.
-  expect(screen.getByText('Second Bubble')).toBeInTheDocument();
-  expect(screen.queryByText('First Bubble')).not.toBeInTheDocument();
-});
-
-test('isolates a failing chatbot so it does not crash the host', () => {
-  const FailingChatbot = () => {
-    throw new Error('chatbot blew up');
-  };
-  disposables.push(
-    views.registerView(
-      { id: 'core.chatbot', name: 'Superset Chatbot' },
-      CHATBOT_LOCATION,
-      () => <FailingChatbot />,
-    ),
-  );
-
-  // The host-owned error boundary catches the failure; render does not throw.
-  expect(() => render(<ChatbotMount />)).not.toThrow();
-  // The mount slot still renders (the boundary lives inside it), confirming the
-  // provider was actually exercised and contained.
-  expect(screen.getByTestId('chatbot-mount')).toBeInTheDocument();
-});
-
-test('isolates a chatbot whose provider function itself throws', () => {
-  disposables.push(
-    views.registerView(
-      { id: 'core.chatbot', name: 'Superset Chatbot' },
-      CHATBOT_LOCATION,
-      () => {
-        throw new Error('provider blew up');
-      },
-    ),
-  );
-
-  // ChatbotRenderer wraps provider() in a component so ErrorBoundary catches
-  // synchronous throws from the provider function, not just from its output.
-  expect(() => render(<ChatbotMount />)).not.toThrow();
-  expect(screen.getByTestId('chatbot-mount')).toBeInTheDocument();
-});
diff --git a/superset-frontend/src/components/ChatbotMount/index.tsx b/superset-frontend/src/components/ChatbotMount/index.tsx
deleted file mode 100644
index ddc430b563b..00000000000
--- a/superset-frontend/src/components/ChatbotMount/index.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import {
-  type ReactElement,
-  useMemo,
-  useRef,
-  useSyncExternalStore,
-} from 'react';
-import { t } from '@apache-superset/core/translation';
-import { logging } from '@apache-superset/core/utils';
-import { css, useTheme } from '@apache-superset/core/theme';
-import { ErrorBoundary } from 'src/components/ErrorBoundary';
-import { addDangerToast } from 'src/components/MessageToasts/actions';
-import { store } from 'src/views/store';
-import { getActiveChatbot } from 'src/core/chatbot';
-import { subscribeToRegistry, getRegistryVersion } from 'src/core/views';
-
-const CHATBOT_EDGE_MARGIN = 24;
-
-/**
- * Wraps the chatbot provider in a React component so that ErrorBoundary can
- * catch synchronous throws from the provider function itself. Calling
- * `provider()` inline (e.g. `{activeChatbot.provider()}`) would throw outside
- * React's render boundary and crash the host.
- */
-const ChatbotRenderer = ({ provider }: { provider: () => ReactElement }) =>
-  provider();
-
-const ChatbotMount = () => {
-  const theme = useTheme();
-  // Notify once per mount; a crash can re-render and would otherwise re-toast.
-  const crashNotified = useRef(false);
-
-  // The active chatbot is a function of the view registry alone: the
-  // most-recently-registered chatbot wins. Read via useSyncExternalStore so it
-  // re-resolves whenever a chatbot extension registers or disposes.
-  const registryVersion = useSyncExternalStore(
-    subscribeToRegistry,
-    getRegistryVersion,
-  );
-
-  const activeChatbot = useMemo(() => getActiveChatbot(), [registryVersion]);
-
-  if (!activeChatbot) {
-    return null;
-  }
-
-  return (
-    <div
-      data-test="chatbot-mount"
-      css={css`
-        position: fixed;
-        right: ${CHATBOT_EDGE_MARGIN}px;
-        bottom: ${CHATBOT_EDGE_MARGIN}px;
-        /* Above dashboard content and the toast layer, below modal dialogs. */
-        z-index: ${theme.zIndexPopupBase + 2};
-      `}
-    >
-      <ErrorBoundary
-        showMessage={false}
-        onError={(error: Error) => {
-          // Fault isolation: contain the crash, log it, surface a one-time
-          // notification, and leave the corner empty rather than parking a
-          // persistent error card.
-          logging.error('[chatbot] provider crashed', error);
-          if (!crashNotified.current) {
-            crashNotified.current = true;
-            store.dispatch(addDangerToast(t('The chatbot failed to load.')));
-          }
-        }}
-      >
-        <ChatbotRenderer provider={activeChatbot.provider} />
-      </ErrorBoundary>
-    </div>
-  );
-};
-
-export default ChatbotMount;
diff --git a/superset-frontend/src/core/chat/index.test.ts b/superset-frontend/src/core/chat/index.test.ts
new file mode 100644
index 00000000000..4d1dc906551
--- /dev/null
+++ b/superset-frontend/src/core/chat/index.test.ts
@@ -0,0 +1,166 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { createElement } from 'react';
+import { chat, getActiveChat } from './index';
+
+const disposables: Array<{ dispose: () => void }> = [];
+
+const trigger = () => createElement('button', null, 'Bubble');
+const panel = () => createElement('div', null, 'Panel');
+
+afterEach(() => {
+  disposables.forEach(d => d.dispose());
+  disposables.length = 0;
+  // Reset host-owned state shared across tests in this module.
+  chat.close();
+  chat.setMode('floating');
+});
+
+test('getChat returns undefined when no chat is registered', () => {
+  expect(chat.getChat()).toBeUndefined();
+  expect(getActiveChat()).toBeUndefined();
+});
+
+test('registerChat resolves the registered chat with its providers', () => {
+  const descriptor = { id: 'acme.chat', name: 'Acme Chat' };
+  disposables.push(chat.registerChat(descriptor, trigger, panel));
+
+  expect(chat.getChat()).toEqual(descriptor);
+  expect(getActiveChat()).toEqual({ chat: descriptor, trigger, panel });
+});
+
+test('the last-registered chat wins when multiple are installed', () => {
+  disposables.push(
+    chat.registerChat({ id: 'first.chat', name: 'First' }, trigger, panel),
+    chat.registerChat({ id: 'second.chat', name: 'Second' }, trigger, panel),
+  );
+
+  expect(chat.getChat()?.id).toBe('second.chat');
+});
+
+test('disposing the active chat falls back to the previous registration', () => {
+  disposables.push(
+    chat.registerChat({ id: 'first.chat', name: 'First' }, trigger, panel),
+  );
+  const second = chat.registerChat(
+    { id: 'second.chat', name: 'Second' },
+    trigger,
+    panel,
+  );
+
+  expect(chat.getChat()?.id).toBe('second.chat');
+
+  second.dispose();
+
+  expect(chat.getChat()?.id).toBe('first.chat');
+});
+
+test('re-registering an id replaces the previous registration', () => {
+  const stalePanel = () => createElement('div', null, 'Stale');
+  disposables.push(
+    chat.registerChat({ id: 'acme.chat', name: 'Acme' }, trigger, stalePanel),
+    chat.registerChat({ id: 'acme.chat', name: 'Acme v2' }, trigger, panel),
+  );
+
+  expect(chat.getChat()?.name).toBe('Acme v2');
+  expect(getActiveChat()?.panel).toBe(panel);
+});
+
+test('disposing a registration twice unregisters only once', () => {
+  const unregistered = jest.fn();
+  disposables.push(chat.onDidUnregisterChat(unregistered));
+
+  const registration = chat.registerChat(
+    { id: 'acme.chat', name: 'Acme' },
+    trigger,
+    panel,
+  );
+  registration.dispose();
+  registration.dispose();
+
+  expect(unregistered).toHaveBeenCalledTimes(1);
+  expect(chat.getChat()).toBeUndefined();
+});
+
+test('onDidRegisterChat and onDidUnregisterChat fire with the descriptor', () => {
+  const registered = jest.fn();
+  const unregistered = jest.fn();
+  disposables.push(
+    chat.onDidRegisterChat(registered),
+    chat.onDidUnregisterChat(unregistered),
+  );
+
+  const descriptor = { id: 'acme.chat', name: 'Acme' };
+  const registration = chat.registerChat(descriptor, trigger, panel);
+
+  expect(registered).toHaveBeenCalledWith(descriptor);
+  expect(unregistered).not.toHaveBeenCalled();
+
+  registration.dispose();
+
+  expect(unregistered).toHaveBeenCalledWith(descriptor);
+});
+
+test('a disposed event subscription stops receiving notifications', () => {
+  const registered = jest.fn();
+  const subscription = chat.onDidRegisterChat(registered);
+  subscription.dispose();
+
+  disposables.push(
+    chat.registerChat({ id: 'acme.chat', name: 'Acme' }, trigger, panel),
+  );
+
+  expect(registered).not.toHaveBeenCalled();
+});
+
+test('open and close toggle the panel and fire their events once', () => {
+  const opened = jest.fn();
+  const closed = jest.fn();
+  disposables.push(chat.onDidOpen(opened), chat.onDidClose(closed));
+
+  expect(chat.isOpen()).toBe(false);
+
+  chat.open();
+  // Opening an already-open panel is a no-op and must not re-fire.
+  chat.open();
+
+  expect(chat.isOpen()).toBe(true);
+  expect(opened).toHaveBeenCalledTimes(1);
+
+  chat.close();
+  chat.close();
+
+  expect(chat.isOpen()).toBe(false);
+  expect(closed).toHaveBeenCalledTimes(1);
+});
+
+test('mode defaults to floating and setMode fires only on change', () => {
+  const modeChanged = jest.fn();
+  disposables.push(chat.onDidChangeMode(modeChanged));
+
+  expect(chat.getMode()).toBe('floating');
+
+  // Setting the current mode is a no-op.
+  chat.setMode('floating');
+  expect(modeChanged).not.toHaveBeenCalled();
+
+  chat.setMode('panel');
+  expect(chat.getMode()).toBe('panel');
+  expect(modeChanged).toHaveBeenCalledWith('panel');
+});
diff --git a/superset-frontend/src/core/chat/index.ts b/superset-frontend/src/core/chat/index.ts
new file mode 100644
index 00000000000..3ad21374129
--- /dev/null
+++ b/superset-frontend/src/core/chat/index.ts
@@ -0,0 +1,167 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @fileoverview Host implementation of the `chat` contribution type.
+ *
+ * Chat is a dedicated contribution type, not a view: extensions register via
+ * the public `chat.registerChat()` and the host owns mounting, open/close
+ * state, and the display mode. Multiple chat extensions may register, but the
+ * host applies singleton resolution — the most-recently-registered chat is
+ * active; disposing it falls back to the previous one.
+ *
+ * The public namespace (`chat`) is exposed to extensions on
+ * `window.superset`; the other exports are host-internal accessors for
+ * ChatMount and are NOT part of the public `@apache-superset/core` API.
+ */
+
+import { ReactElement } from 'react';
+import type { chat as chatApi } from '@apache-superset/core';
+import { Disposable } from '../models';
+import { createEmitter, createEventEmitter } from '../utils';
+
+type Chat = chatApi.Chat;
+type ChatMode = chatApi.ChatMode;
+
+/** A registered chat: its descriptor plus the host-mountable providers. */
+export interface RegisteredChat {
+  /** The chat descriptor passed to `registerChat`. */
+  chat: Chat;
+  /** Renders the collapsed bubble. Hidden by the host in panel mode. */
+  trigger: () => ReactElement;
+  /** Renders the chat panel, mounted per the current {@link ChatMode}. */
+  panel: () => ReactElement;
+}
+
+/** Registration order is the singleton-resolution order: last entry wins. */
+const registrations: RegisteredChat[] = [];
+
+let panelOpen = false;
+
+const registerEmitter = createEventEmitter<Chat>();
+const unregisterEmitter = createEventEmitter<Chat>();
+const openEmitter = createEventEmitter<void>();
+const closeEmitter = createEventEmitter<void>();
+const resizePanelEmitter = createEventEmitter<{ width: number }>();
+const modeEmitter = createEmitter<ChatMode>('floating');
+
+/**
+ * Monotonic version of the whole chat state (registrations, open state, and
+ * mode). Bumped on every change so the host UI can re-derive state via
+ * React's `useSyncExternalStore`.
+ */
+let stateVersion = 0;
+const stateSubscribers = new Set<() => void>();
+
+const notifyState = () => {
+  stateVersion += 1;
+  stateSubscribers.forEach(fn => fn());
+};
+
+export const subscribeToChatState = (listener: () => void): (() => void) => {
+  stateSubscribers.add(listener);
+  return () => {
+    stateSubscribers.delete(listener);
+  };
+};
+
+export const getChatStateVersion = () => stateVersion;
+
+/**
+ * Host-internal: resolves the active chat with its providers.
+ * The most-recently-registered chat wins; when it is disposed the previous
+ * registration takes over the slot again.
+ */
+export const getActiveChat = (): RegisteredChat | undefined =>
+  registrations[registrations.length - 1];
+
+const registerChat: typeof chatApi.registerChat = (
+  chat: Chat,
+  trigger: () => ReactElement,
+  panel: () => ReactElement,
+): Disposable => {
+  // Re-registering an id replaces the previous entry and moves it to the
+  // most-recent position, mirroring the view registry's same-id semantics.
+  const existingIndex = registrations.findIndex(r => r.chat.id === chat.id);
+  if (existingIndex !== -1) {
+    registrations.splice(existingIndex, 1);
+  }
+
+  const entry: RegisteredChat = { chat, trigger, panel };
+  registrations.push(entry);
+  registerEmitter.fire(chat);
+  notifyState();
+
+  return new Disposable(() => {
+    const index = registrations.indexOf(entry);
+    if (index === -1) {
+      // Already removed — replaced by a same-id registration or disposed twice.
+      return;
+    }
+    registrations.splice(index, 1);
+    unregisterEmitter.fire(chat);
+    notifyState();
+  });
+};
+
+const getChat: typeof chatApi.getChat = (): Chat | undefined =>
+  getActiveChat()?.chat;
+
+const open: typeof chatApi.open = (): void => {
+  if (panelOpen) return;
+  panelOpen = true;
+  openEmitter.fire(undefined);
+  notifyState();
+};
+
+const close: typeof chatApi.close = (): void => {
+  if (!panelOpen) return;
+  panelOpen = false;
+  closeEmitter.fire(undefined);
+  notifyState();
+};
+
+const isOpen: typeof chatApi.isOpen = (): boolean => panelOpen;
+
+const getMode: typeof chatApi.getMode = (): ChatMode =>
+  modeEmitter.getCurrent();
+
+const setMode: typeof chatApi.setMode = (mode: ChatMode): void => {
+  if (mode === modeEmitter.getCurrent()) return;
+  modeEmitter.fire(mode);
+  notifyState();
+};
+
+export const chat: typeof chatApi = {
+  registerChat,
+  getChat,
+  onDidRegisterChat: registerEmitter.event,
+  onDidUnregisterChat: unregisterEmitter.event,
+  open,
+  close,
+  isOpen,
+  onDidOpen: openEmitter.event,
+  onDidClose: closeEmitter.event,
+  getMode,
+  setMode,
+  onDidChangeMode: modeEmitter.event,
+  // The host fires this from its panel resizer; until that chrome exists the
+  // event is exposed but never fires.
+  onDidResizePanel: resizePanelEmitter.event,
+};
diff --git a/superset-frontend/src/core/chatbot/index.test.ts b/superset-frontend/src/core/chatbot/index.test.ts
deleted file mode 100644
index 7b6eb00b0ac..00000000000
--- a/superset-frontend/src/core/chatbot/index.test.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import { createElement } from 'react';
-import { views } from 'src/core/views';
-import { CHATBOT_LOCATION } from 'src/views/contributions';
-import { getActiveChatbot } from './index';
-
-const disposables: Array<{ dispose: () => void }> = [];
-
-afterEach(() => {
-  disposables.forEach(d => d.dispose());
-  disposables.length = 0;
-});
-
-test('getActiveChatbot returns undefined when no chatbot is registered', () => {
-  expect(getActiveChatbot()).toBeUndefined();
-});
-
-test('getActiveChatbot resolves the single registered chatbot', () => {
-  const provider = () => createElement('div', null, 'Chatbot');
-  disposables.push(
-    views.registerView(
-      { id: 'core.chatbot', name: 'Superset Chatbot' },
-      CHATBOT_LOCATION,
-      provider,
-    ),
-  );
-
-  const active = getActiveChatbot();
-  expect(active).toEqual({ id: 'core.chatbot', provider });
-});
-
-test('getActiveChatbot picks the last-to-register when multiple are installed', () => {
-  const firstProvider = () => createElement('div', null, 'First');
-  const secondProvider = () => createElement('div', null, 'Second');
-  disposables.push(
-    views.registerView(
-      { id: 'first.chatbot', name: 'First Chatbot' },
-      CHATBOT_LOCATION,
-      firstProvider,
-    ),
-    views.registerView(
-      { id: 'second.chatbot', name: 'Second Chatbot' },
-      CHATBOT_LOCATION,
-      secondProvider,
-    ),
-  );
-
-  // Last-loaded wins: the most-recently-registered chatbot takes the slot.
-  const active = getActiveChatbot();
-  expect(active?.id).toBe('second.chatbot');
-  expect(active?.provider).toBe(secondProvider);
-});
-
-test('getActiveChatbot ignores views registered at other locations', () => {
-  const provider = () => createElement('div', null, 'Panel');
-  disposables.push(
-    views.registerView(
-      { id: 'some.panel', name: 'Some Panel' },
-      'sqllab.panels',
-      provider,
-    ),
-  );
-
-  expect(getActiveChatbot()).toBeUndefined();
-});
-
-test('getActiveChatbot stops resolving a chatbot once it is disposed', () => {
-  const provider = () => createElement('div', null, 'Chatbot');
-  const disposable = views.registerView(
-    { id: 'core.chatbot', name: 'Superset Chatbot' },
-    CHATBOT_LOCATION,
-    provider,
-  );
-
-  expect(getActiveChatbot()?.id).toBe('core.chatbot');
-
-  disposable.dispose();
-
-  expect(getActiveChatbot()).toBeUndefined();
-});
diff --git a/superset-frontend/src/core/chatbot/index.ts b/superset-frontend/src/core/chatbot/index.ts
deleted file mode 100644
index eded52c85a3..00000000000
--- a/superset-frontend/src/core/chatbot/index.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
- * @fileoverview Host-internal resolver for the exclusive `core.chatbot`
- * contribution area.
- *
- * `core.chatbot` is a singleton contribution area: multiple chatbot
- * extensions may register a view there, but the host renders exactly one.
- * This module owns the host-side selection policy.
- *
- * This is host-internal infrastructure — it is NOT part of the public
- * `@apache-superset/core` API. Extensions register via the public
- * `views.registerView()`; only the host resolves which one is active.
- */
-
-import { ReactElement } from 'react';
-import { CHATBOT_LOCATION } from 'src/views/contributions';
-import { getRegisteredViewIds, getViewProvider } from 'src/core/views';
-
-/**
- * The resolved active chatbot: a view id paired with its renderable provider.
- */
-export interface ActiveChatbot {
-  /** The registered view id of the selected chatbot. */
-  id: string;
-  /** The provider that renders the chatbot's React element. */
-  provider: () => ReactElement;
-}
-
-/**
- * Resolves which single chatbot extension is currently active.
- *
- * Selection policy:
- *  - If no chatbot is registered, returns `undefined` — the corner stays empty.
- *  - Otherwise the most-recently-registered (last-loaded) chatbot wins. When a
- *    second chatbot extension loads, it takes over the singleton bubble.
- *
- * @returns The active chatbot's id and provider, or `undefined` if none.
- */
-export const getActiveChatbot = (): ActiveChatbot | undefined => {
-  const registeredIds = getRegisteredViewIds(CHATBOT_LOCATION);
-  if (registeredIds.length === 0) {
-    return undefined;
-  }
-
-  // `getRegisteredViewIds` returns ids in registration order, so the last entry
-  // is the most-recently-loaded chatbot. `getViewProvider` reads the same
-  // synchronous registry maps, so the id always has a live provider; the final
-  // guard is cheap defensiveness, not a fallback path.
-  const selectedId = registeredIds[registeredIds.length - 1];
-
-  const provider = getViewProvider(CHATBOT_LOCATION, selectedId);
-  return provider ? { id: selectedId, provider } : undefined;
-};
diff --git a/superset-frontend/src/core/index.ts b/superset-frontend/src/core/index.ts
index d259597457c..dfe304eee54 100644
--- a/superset-frontend/src/core/index.ts
+++ b/superset-frontend/src/core/index.ts
@@ -27,6 +27,7 @@ export const core: typeof coreType = {
 };
 
 export * from './authentication';
+export * from './chat';
 export * from './commands';
 export * from './dashboard';
 export * from './dataset';
diff --git a/superset-frontend/src/core/utils.ts b/superset-frontend/src/core/utils.ts
index fe54011caec..c6c9474dfd7 100644
--- a/superset-frontend/src/core/utils.ts
+++ b/superset-frontend/src/core/utils.ts
@@ -51,9 +51,20 @@ export interface Emitter<T> {
   getCurrent: () => T;
 }
 
-export function createEmitter<T>(initial: T): Emitter<T> {
+/**
+ * A current-value-less event emitter for pure notifications (e.g. "a chat
+ * was registered", "the panel opened") where a "latest value" reading makes
+ * no sense. {@link createEmitter} layers value tracking on top of this.
+ */
+export interface EventEmitter<T> {
+  /** Subscribe to events; conforms to the public `Event<T>` shape. */
+  event: EventSubscriber<T>;
+  /** Notify all current subscribers with `value`. */
+  fire: (value: T) => void;
+}
+
+export function createEventEmitter<T>(): EventEmitter<T> {
   const listeners = new Set<(e: T) => void>();
-  let current = initial;
 
   return {
     event: (listener, thisArgs) => {
@@ -64,9 +75,21 @@ export function createEmitter<T>(initial: T): Emitter<T> {
       });
     },
     fire: value => {
-      current = value;
       listeners.forEach(fn => fn(value));
     },
+  };
+}
+
+export function createEmitter<T>(initial: T): Emitter<T> {
+  const { event, fire } = createEventEmitter<T>();
+  let current = initial;
+
+  return {
+    event,
+    fire: value => {
+      current = value;
+      fire(value);
+    },
     getCurrent: () => current,
   };
 }
diff --git a/superset-frontend/src/core/views/index.test.ts b/superset-frontend/src/core/views/index.test.ts
index 1112beb6491..d98a05b7f4f 100644
--- a/superset-frontend/src/core/views/index.test.ts
+++ b/superset-frontend/src/core/views/index.test.ts
@@ -17,12 +17,7 @@
  * under the License.
  */
 import React from 'react';
-import {
-  views,
-  resolveView,
-  getViewProvider,
-  getRegisteredViewIds,
-} from './index';
+import { views, resolveView } from './index';
 
 const disposables: Array<{ dispose: () => void }> = [];
 
@@ -115,59 +110,3 @@ test('dispose removes the view registration', () => {
 
   expect(views.getViews('sqllab.panels')).toBeUndefined();
 });
-
-test('getViewProvider returns the registered provider for a matching location', () => {
-  const provider = () => React.createElement('div', null, 'Test');
-  disposables.push(
-    views.registerView(
-      { id: 'test.provider', name: 'Test Provider' },
-      'core.chatbot',
-      provider,
-    ),
-  );
-
-  expect(getViewProvider('core.chatbot', 'test.provider')).toBe(provider);
-});
-
-test('getViewProvider returns undefined when the location does not match', () => {
-  const provider = () => React.createElement('div', null, 'Test');
-  disposables.push(
-    views.registerView(
-      { id: 'test.provider', name: 'Test Provider' },
-      'sqllab.panels',
-      provider,
-    ),
-  );
-
-  // Registered, but at a different location.
-  expect(getViewProvider('core.chatbot', 'test.provider')).toBeUndefined();
-});
-
-test('getViewProvider returns undefined for an unknown id', () => {
-  expect(getViewProvider('core.chatbot', 'nonexistent')).toBeUndefined();
-});
-
-test('getRegisteredViewIds returns ids in registration order', () => {
-  const provider = () => React.createElement('div', null, 'Test');
-  disposables.push(
-    views.registerView(
-      { id: 'first.chatbot', name: 'First' },
-      'core.chatbot',
-      provider,
-    ),
-    views.registerView(
-      { id: 'second.chatbot', name: 'Second' },
-      'core.chatbot',
-      provider,
-    ),
-  );
-
-  expect(getRegisteredViewIds('core.chatbot')).toEqual([
-    'first.chatbot',
-    'second.chatbot',
-  ]);
-});
-
-test('getRegisteredViewIds returns an empty array for an unused location', () => {
-  expect(getRegisteredViewIds('core.chatbot')).toEqual([]);
-});
diff --git a/superset-frontend/src/core/views/index.ts b/superset-frontend/src/core/views/index.ts
index bc3bea3588f..8f726432cce 100644
--- a/superset-frontend/src/core/views/index.ts
+++ b/superset-frontend/src/core/views/index.ts
@@ -39,27 +39,6 @@ const viewRegistry: Map<
 
 const locationIndex: Map<string, Set<string>> = new Map();
 
-/**
- * Monotonic version of the view registry. Bumped on every registration or
- * disposal so consumers can re-derive state via React's `useSyncExternalStore`.
- */
-let registryVersion = 0;
-const registrySubscribers = new Set<() => void>();
-
-const notifyRegistry = () => {
-  registryVersion += 1;
-  registrySubscribers.forEach(fn => fn());
-};
-
-export const subscribeToRegistry = (listener: () => void): (() => void) => {
-  registrySubscribers.add(listener);
-  return () => {
-    registrySubscribers.delete(listener);
-  };
-};
-
-export const getRegistryVersion = () => registryVersion;
-
 const registerView: typeof viewsApi.registerView = (
   view: View,
   location: string,
@@ -78,13 +57,10 @@ const registerView: typeof viewsApi.registerView = (
   ids.add(id);
   locationIndex.set(location, ids);
 
-  notifyRegistry();
-
   return new Disposable(() => {
     const registeredLocation = viewRegistry.get(id)?.location ?? location;
     viewRegistry.delete(id);
     locationIndex.get(registeredLocation)?.delete(id);
-    notifyRegistry();
   });
 };
 
@@ -107,28 +83,6 @@ const getViews: typeof viewsApi.getViews = (
     .filter((c): c is View => !!c);
 };
 
-/**
- * Host-internal: returns the provider for a registered view id at a location.
- * Not part of the public `@apache-superset/core` API — `getViews` stays
- * descriptor-only so extensions cannot render each other's views directly.
- */
-export const getViewProvider = (
-  location: string,
-  id: string,
-): (() => ReactElement) | undefined => {
-  const entry = viewRegistry.get(id);
-  if (entry?.location !== location) {
-    return undefined;
-  }
-  return entry.provider;
-};
-
-/** Host-internal: view ids at a location in registration order. */
-export const getRegisteredViewIds = (location: string): string[] => {
-  const ids = locationIndex.get(location);
-  return ids ? Array.from(ids) : [];
-};
-
 export const views: typeof viewsApi = {
   registerView,
   getViews,
diff --git a/superset-frontend/src/extensions/ExtensionsStartup.test.tsx b/superset-frontend/src/extensions/ExtensionsStartup.test.tsx
index bdc646423bf..59ec6100bfe 100644
--- a/superset-frontend/src/extensions/ExtensionsStartup.test.tsx
+++ b/superset-frontend/src/extensions/ExtensionsStartup.test.tsx
@@ -97,6 +97,7 @@ test('sets up global superset object when user is logged in', async () => {
     // Verify the global superset object is set up
     expect((window as any).superset).toBeDefined();
     expect((window as any).superset.authentication).toBeDefined();
+    expect((window as any).superset.chat).toBeDefined();
     expect((window as any).superset.core).toBeDefined();
     expect((window as any).superset.commands).toBeDefined();
     expect((window as any).superset.extensions).toBeDefined();
diff --git a/superset-frontend/src/extensions/ExtensionsStartup.tsx b/superset-frontend/src/extensions/ExtensionsStartup.tsx
index 87abcd4192e..62b313c49e0 100644
--- a/superset-frontend/src/extensions/ExtensionsStartup.tsx
+++ b/superset-frontend/src/extensions/ExtensionsStartup.tsx
@@ -22,6 +22,7 @@ import { logging } from '@apache-superset/core/utils';
 import { FeatureFlag, isFeatureEnabled } from '@superset-ui/core';
 import {
   authentication,
+  chat,
   core,
   commands,
   dashboard,
@@ -90,6 +91,7 @@ const ExtensionsStartup: React.FC<{ children?: React.ReactNode }> = ({
     // as that would leak un-contracted symbols onto window.superset.
     window.superset = {
       authentication,
+      chat,
       core,
       commands,
       dashboard,
@@ -104,8 +106,8 @@ const ExtensionsStartup: React.FC<{ children?: React.ReactNode }> = ({
     };
 
     // Render the host immediately; extension bundles load in the background.
-    // ChatbotMount re-resolves reactively once the chatbot extension registers
-    // (via subscribeToRegistry / getRegistryVersion), so the bubble appears
+    // ChatMount re-resolves reactively once a chat extension registers (via
+    // subscribeToChatState / getChatStateVersion), so the bubble appears
     // without blocking the UI.
     setInitialized(true);
 
diff --git a/superset-frontend/src/extensions/supersetGlobal.ts b/superset-frontend/src/extensions/supersetGlobal.ts
index 70e5786e999..cd2993491a1 100644
--- a/superset-frontend/src/extensions/supersetGlobal.ts
+++ b/superset-frontend/src/extensions/supersetGlobal.ts
@@ -28,6 +28,7 @@
 
 import type {
   authentication,
+  chat,
   commands,
   core,
   dashboard,
@@ -45,6 +46,7 @@ import type {
 export interface SupersetGlobal {
   authentication: typeof authentication;
   core: typeof core;
+  chat: typeof chat;
   commands: typeof commands;
   dashboard: typeof dashboard;
   dataset: typeof dataset;
diff --git a/superset-frontend/src/views/App.tsx b/superset-frontend/src/views/App.tsx
index 0ea9014f575..6a5c08672ee 100644
--- a/superset-frontend/src/views/App.tsx
+++ b/superset-frontend/src/views/App.tsx
@@ -40,7 +40,7 @@ import { logEvent } from 'src/logger/actions';
 import { store } from 'src/views/store';
 import { FeatureFlag, isFeatureEnabled } from '@superset-ui/core';
 import ExtensionsStartup from 'src/extensions/ExtensionsStartup';
-import ChatbotMount from 'src/components/ChatbotMount';
+import ChatMount from 'src/components/ChatMount';
 import { RootContextProviders } from './RootContextProviders';
 import { ScrollToTop } from './ScrollToTop';
 
@@ -115,12 +115,12 @@ const App = () => (
           ))}
         </Switch>
         {/*
-          The singleton chatbot bubble. Rendered as a sibling of the route
-          Switch — inside ExtensionsStartup so chatbot extensions have been
-          loaded and registered, but outside the Switch so the bubble persists
+          The singleton chat slot. Rendered as a sibling of the route
+          Switch — inside ExtensionsStartup so chat extensions have been
+          loaded and registered, but outside the Switch so the chat persists
           across route changes.
         */}
-        {isFeatureEnabled(FeatureFlag.EnableExtensions) && <ChatbotMount />}
+        {isFeatureEnabled(FeatureFlag.EnableExtensions) && <ChatMount />}
       </ExtensionsStartup>
       <ToastContainer />
     </RootContextProviders>
diff --git a/superset-frontend/src/views/contributions.ts b/superset-frontend/src/views/contributions.ts
deleted file mode 100644
index 12770b699bc..00000000000
--- a/superset-frontend/src/views/contributions.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
- * View locations for app-shell extension integration.
- *
- * These define locations that persist across all routes, mirroring the `app`
- * scope of the `ViewContributions` manifest schema.
- */
-export const AppViewLocations = {
-  app: {
-    chatbot: 'core.chatbot',
-  },
-} as const;
-
-export const CHATBOT_LOCATION = AppViewLocations.app.chatbot;