Skip to content

feat(extensions): adds chatbot P1-P2#40433

Draft
EnxDev wants to merge 4 commits into
chat-prototypefrom
enxdev/feat/chatbot-p1-p2
Draft

feat(extensions): adds chatbot P1-P2#40433
EnxDev wants to merge 4 commits into
chat-prototypefrom
enxdev/feat/chatbot-p1-p2

Conversation

@EnxDev
Copy link
Copy Markdown
Contributor

@EnxDev EnxDev commented May 26, 2026

SUMMARY

Implements Phase 1 and Phase 2 of the chatbot extension architecture defined in the chatbot SIP.

P1 — Mount point & registration

  • Extends ViewContributions manifest schema with an app scope so superset.chatbot can be declared in extension.json
  • Adds CHATBOT_LOCATION = 'superset.chatbot' constant and AppViewLocations structure in src/views/contributions.ts
  • Adds host-internal getViewProvider(location, id) and getRegisteredViewIds(location) to src/core/views — not exposed on the public @apache-superset/core API, preserving the getViews descriptor-only boundary
  • Adds subscribeToLocation for reactive re-resolution when the registry changes
  • Adds icon?: string field to the View descriptor (static, set at registerView() time) and a ChatbotView type alias for extension authors
  • Adds src/core/chatbot/getActiveChatbot — first-to-register fallback policy
  • Adds ChatbotMount component: fixed bottom-right, zIndexPopupBase + 2, host-owned ErrorBoundary, reactive via subscribeToLocation
  • Mounts <ChatbotMount /> as a sibling of <Switch> inside ExtensionsStartup so the bubble persists across route changes
  • Host-level unhandledrejection isolation in ExtensionsStartup covers extension async failures

P2 — Admin & singleton selection

  • Adds ExtensionSettings (singleton row) and ExtensionEnabled (per-extension flag) SQLAlchemy models
  • Adds Alembic migration b2c3d4e5f6a7
  • Adds GET /api/v1/extensions/settings and PUT /api/v1/extensions/settings endpoints
  • ChatbotMount fetches active_chatbot_id on mount and passes it to getActiveChatbot
  • ExtensionsList shows a "Default chatbot" Select picker when more than one chatbot is registered

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — infrastructure only, no visible UI change until a chatbot extension is installed.

TESTING INSTRUCTIONS

  1. Install a chatbot extension that calls views.registerView({ id: 'my.chatbot', name: 'My Chatbot' }, 'superset.chatbot', () => <MyBot />)
  2. Verify the bubble appears fixed at the bottom-right corner across all routes
  3. Install two chatbot extensions; verify only one renders at a time
  4. Go to Extensions → set "Default chatbot" → verify the correct one renders
  5. Disable a chatbot via the toggle; verify it stops rendering

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 26, 2026

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at evan@preset.io.

@dosubot dosubot Bot added change:backend Requires changing the backend change:frontend Requires changing the frontend labels May 26, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 26, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 6a07ad2
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a158ace47052e000744ce0e
😎 Deploy Preview https://deploy-preview-40433--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@EnxDev EnxDev changed the title feat(extensions): chatbot mount point, singleton resolver, and admin settings (SIP P1+P2) feat(extensions): adds chatbot P1-P2 May 26, 2026
Comment thread superset/extensions/settings.py Outdated
Comment thread superset-frontend/src/extensions/ExtensionsList.tsx Outdated
@EnxDev EnxDev force-pushed the enxdev/feat/chatbot-p1-p2 branch from 6a07ad2 to 222023d Compare May 26, 2026 12:05
Comment thread superset/extensions/settings.py Outdated
Comment thread superset/extensions/settings.py Outdated
Comment thread superset-frontend/src/components/ChatbotMount/index.tsx
Comment thread superset-frontend/src/extensions/ExtensionsList.tsx
Comment thread superset-frontend/src/extensions/ExtensionsList.tsx
@EnxDev EnxDev force-pushed the enxdev/feat/chatbot-p1-p2 branch from 222023d to f298e14 Compare May 26, 2026 12:08
@EnxDev EnxDev force-pushed the enxdev/feat/chatbot-p1-p2 branch from 692772c to a4ddc83 Compare May 26, 2026 13:02
@github-actions github-actions Bot added risk:db-migration PRs that require a DB migration packages labels May 26, 2026
EnxDev and others added 4 commits May 26, 2026 15:24
- Add `app` scope and `AppLocation` type to `ViewContributions` manifest schema
- Add host-internal `getViewProvider` and `getRegisteredViewIds` accessors to the views registry
- Add `getActiveChatbot` resolver with first-to-register fallback policy
- Mount `ChatbotMount` in the app shell (fixed bottom-right, persists across routes
…sList

- settings.py: @transaction() replaces manual db.session.commit(); strict
  isinstance(enabled, bool) guard prevents "false" string coercion;
  active_chatbot_id validated as non-empty string before assignment
- ExtensionsList: Switch checked falls back to true (not stale API field);
  chatbotExtensions useMemo reacts to registry changes via subscribeToLocation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 46.80851% with 25 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (chat-prototype@793ffb3). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...uperset-frontend/src/extensions/ExtensionsList.tsx 41.93% 18 Missing ⚠️
...set-frontend/src/components/ChatbotMount/index.tsx 45.45% 6 Missing ⚠️
superset-frontend/src/core/chatbot/index.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             chat-prototype   #40433   +/-   ##
=================================================
  Coverage                  ?   67.71%           
=================================================
  Files                     ?     1852           
  Lines                     ?    77104           
  Branches                  ?    24705           
=================================================
  Hits                      ?    52210           
  Misses                    ?    24894           
  Partials                  ?        0           
Flag Coverage Δ
javascript 67.27% <46.80%> (?)
python 100.00% <ø> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EnxDev EnxDev force-pushed the enxdev/feat/chatbot-p1-p2 branch from aac4597 to 69bd1f2 Compare May 26, 2026 14:03
@EnxDev EnxDev marked this pull request as draft May 26, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API change:backend Requires changing the backend change:frontend Requires changing the frontend packages risk:db-migration PRs that require a DB migration size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant