justinpark opened a new pull request, #43559:
URL: https://github.com/apache/superset/pull/43559

   ### SUMMARY
   
   SQL Lab's left sidebar was a single hardcoded panel — a 
database/catalog/schema
   selector plus a table explorer tree — with no way for an extension to add its
   own panel there. `sqllab.leftSidebar` existed as a view location, but was 
wired
   only for toolbar-menu actions (`registerToolbarAction`/`PanelToolbar`), not 
full
   panel contributions, unlike `sqllab.rightSidebar` which already accepted 
views
   via `views.registerView`.
   
   This PR turns the left sidebar into a `VerticalMenuLayout`: a narrow icon 
rail
   on the left edge, plus a content panel beside it that shows whichever item is
   active. The built-in table explorer becomes the first item in that rail;
   extensions register more through `sqlLab.registerLeftBarView(view, trigger, 
panel)`,
   the same trigger-plus-panel shape `chat.registerChat` already uses — so an
   extension supplies its own rail icon as a real component (custom design,
   badges, spinners), not just a content view the way `views.registerView` 
allows.
   
   Key design points:
   - **Registration & isolation** — `sqlLab.registerLeftBarView` registers a 
view
     (id/name/description/order), a trigger, and a panel; `views.registerView`
     now throws if called for `sqllab.leftSidebar`, redirecting callers to the 
new
     API. Each trigger/panel is wrapped in its own `ErrorBoundary`, so one 
crashing
     extension panel can't take down the rail or any other view.
   - **Rail** — an antd `Menu` (inline, collapsed to icon-only), with Explorer
     first, registered extension views next (deterministically ordered), and
     Settings pinned alone at the bottom. Lives as a sibling of the content
     `Splitter`, so it stays visible regardless of the content panel's own
     collapsed/hidden state.
   - **User-controlled arrangement** — a "Arrange sidebar menu" settings panel
     lets users drag-reorder and show/hide any view (including Explorer, once at
     least one extension view exists), persisted to `localStorage`. Apply is
     disabled if unchecking everything would leave the sidebar empty.
   - **State persistence** — every rail view the user visits stays mounted 
(hidden
     via CSS, not unmounted) once first shown, so switching the rail's selection
     away and back no longer resets a panel's own state. The built-in Explorer 
is
     the one exception, staying keyed to the active SQL query editor tab, since
     its own DB/catalog/schema selection is per tab.
   - **Layout/collapse consistency** — the Splitter's own collapse chevron is 
now
     visible and functional in every state (previously dead while the rail had
     collapsed the content), and a border-color inconsistency between the two
     rail menus is fixed via a scoped `colorSplit` theme-token override rather
     than raw CSS.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   |Before (and no leftbar extensions attached)|After (with extensions)|
   |--|--|
   |<img width="1239" height="1045" alt="Screenshot 2026-08-24 at 4 47 24 PM" 
src="https://github.com/user-attachments/assets/99e31e3a-77f0-489f-9f9f-5020cbb53947";
 />|<img width="1075" height="995" alt="with rail menu" 
src="https://github.com/user-attachments/assets/0b7e94c0-b166-4865-9c41-c025f2de7a00";
 />|
   
   ### TESTING INSTRUCTIONS
   
   1. With no extensions registered, confirm the left sidebar is unchanged from
      today — no rail, just the table explorer.
   2. Register a test extension view via `sqlLab.registerLeftBarView` (see the
      `hello-world` example extension) — confirm a rail with Explorer + the new
      view + Settings appears, Explorer selected by default.
   3. Click between rail icons; confirm each panel's own state (search text,
      expanded tree nodes, in-progress Settings edits) survives switching away
      and back.
   4. Click the active rail icon again to collapse the content panel; confirm 
the
      Splitter's own collapse chevron is visible and works to re-expand it, and
      that dragging the Splitter fully closed (bypassing the rail) still works
      and doesn't corrupt the stored sidebar width.
   5. Open Settings, drag to reorder views (including Explorer), uncheck all but
      one, confirm Apply disables at zero and re-enables at one; Cancel discards
      unapplied edits.
   6. Switch SQL Lab query editor tabs; confirm Explorer's DB/schema selection
      resets per tab as before, while any active extension panel's state is
      unaffected by the tab switch.
   7. `npm run test -- src/SqlLab src/core` and `npm run type` both pass clean.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags: `ENABLE_EXTENSIONS` (registration is only 
reachable through the existing extensions loader, which already gates on this 
flag)
   - [x] Changes UI
   - [ ] Includes DB Migration
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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]

Reply via email to