Skip to content

refactor: split CommandCard into focused components and hooks#1308

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/refactor-commandcard-primitives-MxZzZ
Feb 3, 2026
Merged

refactor: split CommandCard into focused components and hooks#1308
braedonsaunders merged 1 commit into
mainfrom
claude/refactor-commandcard-primitives-MxZzZ

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner
  • Extract UI primitives to src/components/ui/: CommandButton, CommandTooltip, CostDisplay, EmptySlot, IconBadge
  • Extract hooks to CommandCard/hooks/: useUnitCommands, useBuildingCommands, useCommandKeyboard
  • Extract commandIcons utility with getCommandIcon and getAttackTypeText
  • Restructure CommandCard as folder with index.tsx (~156 lines vs 1204 original) and CommandGrid.tsx for grid layout
  • Add constants.ts for building lists and research map
  • Add types.ts for CommandButtonData and MenuMode

This improves code organization, reusability, and testability while maintaining the same functionality.

https://claude.ai/code/session_01ERLmsBpuoVkidE5KJN2Wrv

- Extract UI primitives to src/components/ui/: CommandButton, CommandTooltip,
  CostDisplay, EmptySlot, IconBadge
- Extract hooks to CommandCard/hooks/: useUnitCommands, useBuildingCommands,
  useCommandKeyboard
- Extract commandIcons utility with getCommandIcon and getAttackTypeText
- Restructure CommandCard as folder with index.tsx (~156 lines vs 1204 original)
  and CommandGrid.tsx for grid layout
- Add constants.ts for building lists and research map
- Add types.ts for CommandButtonData and MenuMode

This improves code organization, reusability, and testability while
maintaining the same functionality.

https://claude.ai/code/session_01ERLmsBpuoVkidE5KJN2Wrv
@braedonsaunders braedonsaunders merged commit 6086297 into main Feb 3, 2026
3 of 4 checks passed
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.

2 participants