Repository navigation
refactor(llc/frontend): consolidate tree-build, status-color, run-status mapping (#9909) - #9969
Merged
Merged
Conversation
…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>
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thinking Path
Retrospective of the LLC ship (#9861/PR #9902) surfaced copy-paste duplication across
views/llc/: an identical recursivemarkExpandedin 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 separatecompanyStatusColor()with a unit test pinning the divergence.What Changed
src/composables/llc/useLlcTree.ts—markExpanded, genericbuildTreeFromParent(items, idKey, parentKey, toNode),mapTreesrc/composables/llc/llcStatus.ts—AgentDisplayStatus/RunDisplayStatusunions,agentStatusColor,companyStatusColor,runStatusToAgentStatus,runStatusToRunDisplayStatusGoalTree.vue,SubCompanyTree.vue,OrgTreeNode.vue,CompanyTreeNode.vue,CompanyDashboard.vueimport { defineProps, defineEmits } from 'vue'(fixes 2 pre-existing TS2440) and CompanyDashboard's unuseduseRouteNO 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 fixedModel Used
Fable 5 (main session) + Sonnet sub-agents (implementation + independent code review)
Fixes #9909
🤖 Generated with Claude Code