Skip to content

refactor(llc/frontend): consolidate tree-build, status-color, run-status mapping (#9909) - #9969

Merged
mrveiss merged 1 commit into
Dev_new_guifrom
issue-9909
Jun 11, 2026
Merged

mrveiss merged 1 commit into
Dev_new_guifrom
issue-9909

Conversation

@mrveiss

@mrveiss mrveiss commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Thinking Path

Retrospective of the LLC ship (#9861/PR #9902) surfaced copy-paste duplication across views/llc/: an identical recursive markExpanded in two trees, parent-pointer forest assembly in two shapes, a status→tailwind color map duplicated 3×, and two run-status translations inline in CompanyDashboard. Consolidated into two shared composables; one color map (CompanyTreeNode) is genuinely different (paused→yellow, no idle/error keys) so it stays a separate companyStatusColor() with a unit test pinning the divergence.

What Changed

  • NEW src/composables/llc/useLlcTree.ts — markExpanded, generic buildTreeFromParent(items, idKey, parentKey, toNode), mapTree
  • NEW src/composables/llc/llcStatus.ts — AgentDisplayStatus/RunDisplayStatus unions, agentStatusColor, companyStatusColor, runStatusToAgentStatus, runStatusToRunDisplayStatus
  • Consumers rewired: GoalTree.vue, SubCompanyTree.vue, OrgTreeNode.vue, CompanyTreeNode.vue, CompanyDashboard.vue
  • Zero-behavior cleanups in touched files: removed OrgTreeNode's invalid import { defineProps, defineEmits } from 'vue' (fixes 2 pre-existing TS2440) and CompanyDashboard's unused useRoute

NO behavior change — code-reviewer verified line-by-line parity of every replaced function (orderings, orphan handling, else-branches, null fallbacks).

Verification

  • npx vitest run src/composables/llc/__tests__/ → 30/30 passed (orphan-parent, self-reference, empty input, paused-divergence, null run-status all pinned)
  • npx vue-tsc --noEmit -p tsconfig.app.json → zero new errors; 2 pre-existing errors fixed
  • eslint on all 9 touched files → clean
  • grep audit: only the shared modules + import sites remain in LLC code

Model Used

Fable 5 (main session) + Sonnet sub-agents (implementation + independent code review)

Fixes #9909

🤖 Generated with Claude Code

…tus mapping (#9909)

No behavior change — pure consolidation of duplicated LLC view logic:

- composables/llc/useLlcTree.ts: shared markExpanded(), generic
  buildTreeFromParent() (GoalTree parent_goal_id assembly), and mapTree()
  (SubCompanyTree nested-raw recursion).
- composables/llc/llcStatus.ts: AgentDisplayStatus/RunDisplayStatus unions,
  agentStatusColor() (OrgTreeNode + CompanyDashboard identical maps),
  companyStatusColor() (CompanyTreeNode's intentionally different map —
  paused→yellow, no idle/error), runStatusToAgentStatus(), and
  runStatusToRunDisplayStatus() (completed→done).
- Views updated to import the shared module; hand-typed status unions
  replaced with the shared types.
- OrgTreeNode: dropped bogus defineProps/defineEmits import from 'vue'
  (fixes 2 pre-existing TS2440 errors; compiler macros need no import).
- CompanyDashboard: dropped unused useRoute binding (pre-existing lint).
- Unit tests for both new modules (30 tests).

No generated LLC run-status type exists under src/types or src/api, so
llcStatus.ts is the single source of truth for these unions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant