feat(chat): extract and render action buttons from task cards (Cancel, Review Changes)
This commit is contained in:
@@ -174,12 +174,27 @@ class CDPClient {
|
||||
}
|
||||
});
|
||||
|
||||
// 카드 내부 액션 버튼 추출 (Cancel, Review Changes 등)
|
||||
const actionKeywords = ['Proceed','Cancel','Open','View','Review','Approve','Reject','Yes','No','Accept','Deny','Allow','Skip'];
|
||||
const cardBtns = Array.from(card.querySelectorAll('button')).map(b => {
|
||||
const label = b.textContent.trim();
|
||||
const rect = b.getBoundingClientRect();
|
||||
return {
|
||||
label,
|
||||
x: Math.round(rect.left + rect.width / 2),
|
||||
y: Math.round(rect.top + rect.height / 2),
|
||||
w: Math.round(rect.width),
|
||||
h: Math.round(rect.height),
|
||||
};
|
||||
}).filter(b => b.label && b.w > 0 && actionKeywords.some(k => b.label.includes(k)));
|
||||
|
||||
messages.push({
|
||||
type: 'task',
|
||||
title: titleEl ? titleEl.textContent.trim() : '',
|
||||
summary: summaryEl ? summaryEl.textContent.trim().substring(0, 500) : '',
|
||||
collapsed: expanded ? expanded.getAttribute('aria-expanded') === 'false' : true,
|
||||
steps: steps.slice(0, 20),
|
||||
actions: cardBtns.slice(0, 5),
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user