Thanks for taking the time to contribute.
- Code of Conduct
- Getting Started
- Development Workflow
- Submitting Changes
- Issue Guidelines
- Inference Pipeline
- Testing
- Style Guide
Be respectful and constructive. Harassment, discrimination, and personal attacks will not be tolerated.
Prerequisites: Node.js 20+, npm.
git clone <repo-url>
cd VisualCompiler
npm install
npx playwright install --with-deps
npm run dev- Fork the repo and create a branch from
main. - Branch names should be descriptive:
fix/flex-wrap-detection,feat/gap-inference,test/sparse-grid-fixtures. - Keep commits focused — one logical change per commit.
- Run the full test suite before opening a PR.
npm run test:unit # Vitest unit tests
npm run test:e2e # Playwright browser tests
npm run build # TypeScript + Vite production build
npm run lint # ESLintAll four must pass cleanly.
- Open a pull request against
main. - Fill in the PR template — describe the problem, approach, and how you tested it.
- Link the related issue if one exists.
- Keep PRs small and focused. Large refactors should be discussed in an issue first.
- A maintainer will review and may request changes before merging.
Bug reports should include:
- Steps to reproduce (ideally a minimal canvas arrangement in JSON).
- Expected vs actual inference output.
- Browser and OS version if it's a rendering or interaction bug.
Feature requests should explain the use case, not just the desired API. If it touches the inference pipeline, describe the layout pattern it targets.
The core algorithm lives in src/inference/. Before touching it:
- Read
src/inference/index.tsto understand the pipeline order. - Each stage has a dedicated file — prefer changing one stage at a time.
- Algorithm invariants are documented in comments inside each file and in
MEMORY.md. Do not violate them without discussion:detectTracksclusters left edges only (not left+right combined).decideuses additive scoring, not residual error.- Tail-missing detection requires monotonically decreasing item counts.
- Add or update fixtures in
tests/fixtures/for any new layout pattern you target. - Add unit tests in
src/inference/__tests__/for any new scoring or classification logic.
- Unit tests (
src/inference/__tests__/): cover individual pipeline stages. Use plain objects — no DOM required. - Fixture tests (
tests/inference.spec.ts): read JSON fixtures fromtests/fixtures/and assert inference output end-to-end. - Browser tests (
tests/canvas.spec.ts): use Playwright and inject state viawindow.__canvasStore.
When adding a new layout pattern, add a fixture JSON file and at least one fixture test assertion before opening a PR.
- TypeScript strict mode — no
anywithout justification. - No default exports in
src/inference/— named exports only. - Prefer pure functions. Side effects should be isolated to store actions and React components.
- Do not add comments that restate what the code does; only comment on why when the reason is non-obvious.
- Keep each inference stage file focused on its single responsibility. Do not add layout logic to
emit.ts.