refactor: Fine-tune sidebar interaction and refine company suite configuration

This commit is contained in:
2026-05-14 18:04:25 +09:00
parent 75d7e6b83a
commit d84e02c696
13 changed files with 215 additions and 33 deletions
+37 -10
View File
@@ -2541,6 +2541,23 @@
return el;
};
// ── 디스플레이 필드 (이름·역할·이모지·색상) ──
// 빌트인이든 커스텀이든 사용자가 자유롭게 리네이밍 가능. 변경 후
// CEO 보고서·planner enumeration·세션 로그 등 모든 표시 지점에
// 즉시 반영된다 — resolveAgent가 override를 머지하므로.
const nameInput = _field('name', '이름 (Display Name)', false, a.name, a.defaultName, a.nameOverridden);
const roleInput = _field('role', '역할 (Role Title)', false, a.role, a.defaultRole, a.roleOverridden);
// 이모지·색상은 한 줄에 나란히 — CSS는 grid 없이 inline flex로 처리.
const visualWrap = document.createElement('div');
visualWrap.style.cssText = 'display:flex; gap:8px;';
const emojiInput = _field('emoji', '이모지', false, a.emoji, a.defaultEmoji, a.emojiOverridden);
const colorInput = _field('color', '색상 (#hex)', false, a.color, a.defaultColor, a.colorOverridden);
// 위에서 만든 두 필드는 editor에 이미 append됨. 한 줄로 묶고 싶으면
// 부모에서 분리해 visualWrap에 다시 넣는다 — label은 직전 sibling.
// 더 단순하게: emoji/color 입력 후 reflow는 그냥 두고 max-width만 줄임.
emojiInput.style.maxWidth = '80px';
colorInput.style.maxWidth = '120px';
const tagInput = _field('tagline', 'Tagline (한 줄)', false, a.tagline, a.defaultTagline, a.taglineOverridden);
const specInput = _field('specialty', 'Specialty (CEO가 dispatch 판단에 사용)', true, a.specialty, a.defaultSpecialty, a.specialtyOverridden);
const persInput = _field('persona', 'Persona (말투·관점·강조)', true, a.persona, a.defaultPersona, a.personaOverridden);
@@ -2553,13 +2570,10 @@
const resetBtn = document.createElement('button');
resetBtn.className = 'danger';
resetBtn.textContent = 'Reset';
resetBtn.title = '이 에이전트의 모든 override 제거 → 디폴트로 복귀';
resetBtn.title = '이 에이전트의 모든 override 제거 → 디폴트로 복귀 (이름·역할·프롬프트 전부)';
resetBtn.onclick = () => {
vscode.postMessage({
type: 'setCompanyAgentPrompt',
agentId: a.id,
override: null,
});
vscode.postMessage({ type: 'setCompanyAgentPrompt', agentId: a.id, override: null });
vscode.postMessage({ type: 'setCompanyAgentDisplay', agentId: a.id, override: null });
};
const cancelBtn = document.createElement('button');
@@ -2573,10 +2587,23 @@
saveBtn.className = 'primary';
saveBtn.textContent = 'Save';
saveBtn.onclick = () => {
// Send what's currently in each field. The backend treats an
// empty string as "clear this field" (back to default), so
// typing nothing into Tagline + saving = Tagline default,
// Specialty + Persona untouched if not modified.
// 두 개의 message로 분리 전송 — display(name/role/emoji/color)와
// prompt(tagline/specialty/persona)는 백엔드에서 서로 다른
// override 테이블을 쓴다. 빈 문자열은 그 필드만 reset, 디폴트와
// 같은 값은 override 안 함(원본 그대로 두기) — 사용자가 일부러
// 디폴트 값을 다시 입력해 "override 박제"하는 케이스는 드물고,
// 안 박는 게 다음 코드 업데이트 시 새 디폴트를 자동 흡수해서
// 유리하다.
vscode.postMessage({
type: 'setCompanyAgentDisplay',
agentId: a.id,
override: {
name: nameInput.value === a.defaultName ? '' : nameInput.value,
role: roleInput.value === a.defaultRole ? '' : roleInput.value,
emoji: emojiInput.value === a.defaultEmoji ? '' : emojiInput.value,
color: colorInput.value === a.defaultColor ? '' : colorInput.value,
},
});
vscode.postMessage({
type: 'setCompanyAgentPrompt',
agentId: a.id,