Discovered during
LLC ship (#9861 / PR #9902) — retrospective review of the touched LLC views surfaced copy-paste duplication across autobot-frontend/src/views/llc/.
Duplication (file:line)
markExpanded() — identical recursive tree-expander duplicated:
GoalTree.vue:76
SubCompanyTree.vue:71
- Build-forest-from-parent — same "group children under parent pointer" logic:
GoalTree.vue:31 (buildGoalTree, parent_goal_id)
SubCompanyTree.vue (mapNode recursion)
- (backend mirror:
companies.py get_org_chart forest assembly via reports_to — cross-language, can't share, but the FE copies can.)
statusColor() — identical status → tailwind bg-* map duplicated 3×:
OrgTreeNode.vue:27, CompanyTreeNode.vue:30, CompanyDashboard.vue:149
- Agent run-status → display-status mapping —
LLCRunStatus value translation duplicated:
CompanyDashboard.vue:84 (runStatusToAgentStatus) and :108 (mapRun, completed→done)
- drift risk against the backend's
_heartbeat_status_to_org_status (companies.py).
- Status vocabulary
'active' | 'idle' | 'error' | 'paused' hand-typed in OrgTreeNode.vue:12, CompanyDashboard.vue:28 (should derive from generated API types or a shared const).
Suggested consolidation
composables/llc/useLlcTree.ts — markExpanded + buildTreeFromParent(items, idKey, parentKey).
composables/llc/llcStatus.ts — the status union type, statusColor(), and runStatusToDisplayStatus() (single source aligned with LLCRunStatus).
Non-blocking; no behavior change. Filed per "every duplication is an issue".
Discovered during
LLC ship (#9861 / PR #9902) — retrospective review of the touched LLC views surfaced copy-paste duplication across
autobot-frontend/src/views/llc/.Duplication (file:line)
markExpanded()— identical recursive tree-expander duplicated:GoalTree.vue:76SubCompanyTree.vue:71GoalTree.vue:31(buildGoalTree,parent_goal_id)SubCompanyTree.vue(mapNoderecursion)companies.py get_org_chartforest assembly viareports_to— cross-language, can't share, but the FE copies can.)statusColor()— identicalstatus → tailwind bg-*map duplicated 3×:OrgTreeNode.vue:27,CompanyTreeNode.vue:30,CompanyDashboard.vue:149LLCRunStatusvalue translation duplicated:CompanyDashboard.vue:84(runStatusToAgentStatus) and:108(mapRun,completed→done)_heartbeat_status_to_org_status(companies.py).'active' | 'idle' | 'error' | 'paused'hand-typed inOrgTreeNode.vue:12,CompanyDashboard.vue:28(should derive from generated API types or a shared const).Suggested consolidation
composables/llc/useLlcTree.ts—markExpanded+buildTreeFromParent(items, idKey, parentKey).composables/llc/llcStatus.ts— the status union type,statusColor(), andrunStatusToDisplayStatus()(single source aligned withLLCRunStatus).Non-blocking; no behavior change. Filed per "every duplication is an issue".