Skip to content

Conversation

@neptunusRomulus
Copy link
Owner

Motivation

  • Reduce complexity in App.tsx by moving editor/business logic and static metadata into focused feature modules under src/editor so App.tsx remains an orchestrator.
  • Make toolbar collapse behavior reusable and testable by extracting it into a hook under src/hooks.
  • Improve code organization and enable easier unit testing and maintenance of editor utilities.

Description

  • Extracted map spawn helpers into src/editor/mapSpawnUtils.ts and exported computeIntermapTarget, buildSpawnContent, extractSpawnIntermapValue, and STARTING_MAP_INVALID_NAMES.
  • Moved object validation into src/editor/objectValidation.ts and exported validateAndSanitizeObject plus related types and spec placeholders.
  • Moved item/actor role metadata and rule option lists into src/editor/itemRoles.ts, src/editor/actorRoles.ts, and src/editor/ruleOptions.ts and updated App.tsx imports to consume them.
  • Added useToolbarAutoCollapse in src/hooks/useToolbarAutoCollapse.ts, wired the main, bottom, and brush toolbars to use it (with brush toolbar autoCollapse disabled), and cleaned up some unused icon imports in App.tsx.

Testing

  • No automated tests were executed for this change.
  • Local type/runtime validation was not performed as part of this commit (no test suite run).

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants