Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds side panel widgets to the tracker #146

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brichet
Copy link
Collaborator

@brichet brichet commented Jan 7, 2025

Add the side panel chats to the widget tracker.

Fixes #130
Fixes #139

The chats tracker tracks both LabChatPanel (the main area widget) and ChatWidget (widget in the side panel).

IMPROVEMENT

  • The layout restorer is now able to open back the chats in the main area and in the side panel.
  • The shortcut to focus on the chat input (Accel Shift 1) works for all the chat widgets. The last used input is focused.
  • EDIT: the chat input is focussed when clicking anywhere on the chat except on a focusable element.

TO DO

  • improve the tracking of the chat widget
    The widget become the current widget of the tracker only if an input has been clicked. We should focus on the input component when the chat is clicked (anywhere except on an other input). This would also be a nice UX improvement.
  • add tests on it

Copy link
Contributor

github-actions bot commented Jan 7, 2025

Binder 👈 Launch a Binder on branch brichet/jupyter-chat/side-panel-chats-tracker

@brichet brichet added enhancement New feature or request chat extension labels Jan 7, 2025
@@ -56,7 +57,7 @@ export interface IChatFactory {
/**
* The chat panel tracker.
*/
tracker: IWidgetTracker<LabChatPanel>;
tracker: WidgetTracker<LabChatPanel | ChatWidget>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to expose a full WidgetTracker? Or could we stick to the more limited IWidgetTracker as before?

@@ -152,16 +152,13 @@ export class ChatPanel extends SidePanel {
* @param model - the model of the chat widget
* @param name - the name of the chat.
*/
addChat(model: IChatModel, path: string): void {
addChat(model: IChatModel): ChatWidget {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this will likely require a 0.8.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chat extension enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyboard shortcuts: fix warnings and add one for focusing chat input Add tracker for chats in side panel
2 participants