Skip to content

Configurable chat toolbar in side panel#445

Open
brichet wants to merge 10 commits into
jupyterlab:mainfrom
brichet:configurable-chat-toolbar
Open

Configurable chat toolbar in side panel#445
brichet wants to merge 10 commits into
jupyterlab:mainfrom
brichet:configurable-chat-toolbar

Conversation

@brichet

@brichet brichet commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a chatToolbarItems to the MultiChatPanel, to automatically add button to the toolbar when opening.

Adds a toolbar factory to the multichat panel, that is passed to the chat widget opened in the panel.
In jupyterlab-chat, the toolbar factory is built from the settings schema, and therefore have the same items as in the main area chat.

Some more context at #266 (comment)

API CHANGE

Since the same toolbar factory can be used in a main area chat and a chat in the side panel, this PR introduce a new interface to unify a chat panel (basically a panel containing a chat widget and a toolbar):

/**
 * The interface for any widget displaying a chat (main area or side panel).
 */
export interface IChatPanel extends Widget {
  /**
   * The chat widget embedded in the panel.
   */
  widget: ChatWidget;
  /**
   * The model of the chat widget.
   */
  model: IChatModel;
  /**
   * The area of the panel.
   */
  area: ChatArea;
  /**
   * The chat panel toolbar.
   */
  toolbar: Widget;
}

This widget interface is used to build the toolbar items in the registry, whether the widget is a main area chat or a side panel chat.

/**
 * An optional toolbar factory for each opened chat.
 */
 chatToolbarFactory?: (
   panel: IChatPanel
 ) => IObservableList<ToolbarRegistry.IToolbarItem>;

This interface is also used as the tracked widget from the chat tracker (API change):

/**
 * the chat tracker type.
 */
- export type IChatTracker = IWidgetTracker<ChatWidget | MainAreaChat>;
+ export type IChatTracker = IWidgetTracker<IChatPanel>;

Any extension bumping to the next version of @jupyter-chat and providing an IChatTracker should update its widgets accordingly.

@brichet brichet added the enhancement New feature or request label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Binder 👈 Launch a Binder on branch brichet/jupyter-chat/configurable-chat-toolbar

@brichet brichet force-pushed the configurable-chat-toolbar branch from 4177b1b to 617ef97 Compare July 7, 2026 08:12
@brichet brichet marked this pull request as ready for review July 7, 2026 09:11
@brichet brichet changed the title Configurable chat toolbar Configurable chat toolbar in side panel Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant