Whether the user is currently looking at the given session in the chat view. In that case the
user is already aware of what is happening, so notifications about it (completion, input
needed) should be suppressed.
This deliberately uses ApplicationShell.currentWidget rather than the focused widget:
while an agent is running, the chat input editor is disabled and loses DOM focus, but the user
is still looking at the chat. currentWidget remains the chat view until the user activates a
different widget, whereas activeWidget would already be undefined. The window must also have
focus, otherwise the user has switched to another application and should still be notified.
Lives in this standalone module (rather than on the ChatViewWidget namespace) so that
chat-input-widget can use it without importing chat-view-widget, which would form a
load-time import cycle (chat-view-widget → chat tree widgets → chat-input-widget). For the same
reason it matches the chat view by id rather than instanceof ChatViewWidget.
Whether the user is currently looking at the given session in the chat view. In that case the user is already aware of what is happening, so notifications about it (completion, input needed) should be suppressed.
This deliberately uses ApplicationShell.currentWidget rather than the focused widget: while an agent is running, the chat input editor is disabled and loses DOM focus, but the user is still looking at the chat.
currentWidgetremains the chat view until the user activates a different widget, whereasactiveWidgetwould already beundefined. The window must also have focus, otherwise the user has switched to another application and should still be notified.Lives in this standalone module (rather than on the
ChatViewWidgetnamespace) so thatchat-input-widgetcan use it without importingchat-view-widget, which would form a load-time import cycle (chat-view-widget → chat tree widgets → chat-input-widget). For the same reason it matches the chat view by id rather thaninstanceof ChatViewWidget.