From 50d427e367f0e18f824601cb37a766d9eba51355 Mon Sep 17 00:00:00 2001 From: gahusb Date: Sun, 17 May 2026 20:50:42 +0900 Subject: [PATCH] refactor(agent-office): derive ACTIVE_AGENT_IDS from GRID_SLOTS Eliminates dual-write drift risk between ACTIVE_AGENT_IDS list and GRID_SLOTS slot ordering. Single source of truth is now GRID_SLOTS; ACTIVE_AGENT_IDS is computed from it. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/pages/agent-office/constants.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/agent-office/constants.js b/src/pages/agent-office/constants.js index 60d0b9c..152f39a 100644 --- a/src/pages/agent-office/constants.js +++ b/src/pages/agent-office/constants.js @@ -14,8 +14,6 @@ export const AGENT_META = { lotto: { displayName: '로또 큐레이터', color: '#ef4444', image: lottoImg }, }; -export const ACTIVE_AGENT_IDS = ['stock', 'music', 'insta', 'realestate', 'lotto']; - // 3x3 슬롯 (좌→우, 위→아래). 처음 5칸은 active, 나머지 4칸은 placeholder. export const GRID_SLOTS = [ { agentId: 'stock' }, @@ -29,6 +27,8 @@ export const GRID_SLOTS = [ { agentId: null }, ]; +export const ACTIVE_AGENT_IDS = GRID_SLOTS.filter(s => s.agentId !== null).map(s => s.agentId); + export const PLACEHOLDER_IMAGE = undeterminedImg; export const PLACEHOLDER_LABEL = '준비 중';