fix: prevent chat panel toggle-off in authenticated Teams join
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
df0763d840
commit
aec15602c2
1 changed files with 27 additions and 0 deletions
|
|
@ -48,8 +48,35 @@ export class ChatProcedure {
|
|||
|
||||
/**
|
||||
* Open the chat panel by clicking the chat button.
|
||||
* In authenticated Teams, the chat panel may already be open (meeting loads
|
||||
* from a chat thread). Clicking again would TOGGLE it closed.
|
||||
*/
|
||||
private async _openChatPanel(): Promise<void> {
|
||||
// Check if chat panel is already open before clicking (avoid toggle-off)
|
||||
const alreadyOpen = await this._page.evaluate(() => {
|
||||
const chatBtn = document.querySelector('button[id="chat-button"], button[data-tid="chat-button"]') as HTMLElement | null;
|
||||
if (chatBtn) {
|
||||
// Teams toggle buttons use aria-pressed="true" when active
|
||||
if (chatBtn.getAttribute('aria-pressed') === 'true') return true;
|
||||
}
|
||||
// Also check if chat input or message list is visible (panel is open)
|
||||
const chatInput = document.querySelector(
|
||||
'[data-tid="ckeditor-replyConversation"], div[role="textbox"][data-tid*="chat"], div[role="textbox"][aria-label*="message" i]'
|
||||
) as HTMLElement | null;
|
||||
if (chatInput && chatInput.offsetHeight > 0) return true;
|
||||
// Check if message list container is visible
|
||||
const messageList = document.querySelector(
|
||||
'[data-tid="message-pane-list"], [data-tid="chat-pane-list"], [data-tid="chat-pane"]'
|
||||
) as HTMLElement | null;
|
||||
if (messageList && messageList.offsetHeight > 50) return true;
|
||||
return false;
|
||||
});
|
||||
|
||||
if (alreadyOpen) {
|
||||
this._logger.info('Chat panel already open - skipping toggle');
|
||||
return;
|
||||
}
|
||||
|
||||
const chatButtonSelectors = [
|
||||
'button[id="chat-button"]',
|
||||
'button[data-tid="chat-button"]',
|
||||
|
|
|
|||
Loading…
Reference in a new issue