fix(ui): smart display for long convos, action buttons for isBlocking, no middle gap
This commit is contained in:
@@ -304,20 +304,26 @@ class ChatPanel {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'msg-actions';
|
||||
|
||||
// 라벨(알림 문구) 표시
|
||||
if (msg.label) {
|
||||
const labelEl = document.createElement('div');
|
||||
labelEl.className = 'msg-actions-label';
|
||||
labelEl.textContent = msg.label;
|
||||
div.appendChild(labelEl);
|
||||
}
|
||||
|
||||
for (const btn of (msg.buttons || [])) {
|
||||
const el = document.createElement('button');
|
||||
el.className = 'msg-action-btn';
|
||||
el.className = 'msg-action-btn msg-action-primary';
|
||||
el.textContent = btn.label || btn;
|
||||
el.style.cursor = 'pointer';
|
||||
|
||||
// Proceed/Review 등 주요 액션은 강조
|
||||
const label = btn.label || btn;
|
||||
if (['Proceed', 'Approve', 'Accept', 'Yes', 'Allow'].some(k => label.includes(k))) {
|
||||
el.classList.add('msg-action-primary');
|
||||
}
|
||||
|
||||
// 좌표가 있으면 클릭 가능
|
||||
if (btn.x && btn.y) {
|
||||
el.style.cursor = 'pointer';
|
||||
// action 기반 처리
|
||||
if (btn.action === 'switch_mirror') {
|
||||
el.addEventListener('click', () => {
|
||||
document.getElementById('tabMirror')?.click();
|
||||
});
|
||||
} else if (btn.x && btn.y) {
|
||||
el.addEventListener('click', () => {
|
||||
if (this.onActionClick) {
|
||||
this.onActionClick({ label: btn.label, x: btn.x, y: btn.y });
|
||||
|
||||
Reference in New Issue
Block a user