hermes-control-interface icon indicating copy to clipboard operation
hermes-control-interface copied to clipboard

feat(office): renderOfficeFloor + Auto-refresh + Agent Popup

Open quirinal36 opened this issue 6 months ago • 1 comments

Summary

Office 핵심 렌더링 로직 구현.

Functions added to src/js/main.js

  • loadOffice(container) — 페이지 skeleton 렌더, refreshOffice() 호출, 10초 interval 설정
  • refreshOffice() — /api/profiles + /api/office/departments 병렬 fetch → renderOfficeFloor
  • renderOfficeFloor(profiles, departments, floorEl) — 핵심 함수
    • profileMap, assignmentMap, unassigned 분리
    • Zone 레이아웃: DESKS_PER_ROW=3, DESK_SLOT=88px, 수직 배치
    • .office-dept-zone absolute 포지셔닝, .office-desk + .office-agent per profile
    • running/idle CSS class 토글
    • escapeHtml() XSS 방지
  • showOfficeAgentPopup(agentEl, event) — getBoundingClientRect() 기반 팝업, 외부 클릭 시 닫기

Test

  • 실제 에이전트로 방문 → running 에이전트 green glow 확인
  • 에이전트 클릭 → 팝업 표시, "Open" 클릭 → agent-detail 이동
  • 10초 후 상태 자동 갱신
  • 타 페이지 이동 → interval 누수 없음

quirinal36 avatar May 05 '26 08:05 quirinal36

Closed by merge commit e4b31af (PR #60 — office visualization with departments + Playwright e2e tests)

xaspx avatar May 10 '26 20:05 xaspx