Skip to content

Reorganize source into components, controllers, and domain modules - #59

Merged
skratchdot merged 2 commits into
mainfrom
refactor-sorting-playground
Sep 8, 2026
Merged

skratchdot merged 2 commits into
mainfrom
refactor-sorting-playground

Conversation

@skratchdot

Copy link
Copy Markdown
Owner

Summary

Reorganize the source tree to make UI, application coordination, and domain logic easier to find. This is a structural refactor, not a redesign or state/API rewrite.

Structure

  • Keep Home, About, and API content directly in TanStack route files. Route components remain unexported so automatic code splitting can work.
  • Group screen controls under components/playground, dialogs under components/dialogs, and the document shell under components/layout.
  • Replace the generic workspace terminology with playground and player names, including the screen DOM ID and lazy-load error message.
  • Move non-React orchestration into controllers while leaving shared state in state.
  • Consolidate lib/utilities into utils with function-specific filenames and update shadcn aliases.
  • Move the worker into sorting, the Timbre adapter into audio, and audio preview drawing into audio. Keep editor initialization beside its dialog.
  • Update imports, browser selectors, tests, and developer documentation.

Behavior preserved

Browser-only audio/editor loading, prerendering, navigation, worker execution, editing, playback lifecycle, and the current visual design are retained. No React Compiler or new hooks layer is introduced.

Verification

  • pnpm run check passed: lint, formatting, spelling, TypeScript, 360 unit tests, and production build.
  • All 37 Playwright browser tests passed using local Chrome.
  • About and API remain separate production chunks; all three pages prerender successfully.
  • git diff --check passed.
  • Existing large-chunk build warnings remain. Edit-time Fast Refresh state preservation was not separately tested.

Replace the workspace feature hierarchy with components/playground, shared components/dialogs, and non-React controllers. Rename workspace APIs and selectors to playground/player terminology while preserving lifecycle and playback behavior.

Keep page content directly in TanStack routes, move the document shell under components/layout, and retain browser-only lazy loading for the interactive screen. Keep shared state in place, consolidate generic helpers under utils, and update shadcn aliases. Move the sort worker and Timbre adapter into their domain folders and audio previews into audio.

Update imports, regression tests, and architecture/development documentation. Verified lint, formatting, spelling, TypeScript, 360 unit tests, production prerendering, and 37 browser tests. Existing bundle-size warnings remain.
Rename utils to utilities and update imports, shadcn aliases, and architecture documentation. Verified the full check pipeline, including 360 unit tests and production build.
@skratchdot
skratchdot merged commit d15728f into main Sep 8, 2026
1 check passed
@skratchdot
skratchdot deleted the refactor-sorting-playground branch September 9, 2026 03:42
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