Skip to content

feat(wix-headless): combinatorial layout composition (CODEAI-696)#408

Draft
yanivefraim wants to merge 1 commit into
mainfrom
feat/codeai-696-layout-variants
Draft

feat(wix-headless): combinatorial layout composition (CODEAI-696)#408
yanivefraim wants to merge 1 commit into
mainfrom
feat/codeai-696-layout-variants

Conversation

@yanivefraim

@yanivefraim yanivefraim commented Jun 17, 2026

Copy link
Copy Markdown
Member

CODEAI-696 — generated sites share one layout

Every site wix-headless generated used the same fixed layout (same hero, same nav), so two sites from different prompts looked like the same template re-skinned — only colors/fonts varied. This makes the homepage structure vary per build while keeping the deterministic, no-LLM-layout pipeline (≤600s, reliable).

Approach — combinatorial section composition

compose.mjs now assembles the homepage from one randomly chosen fragment per slot instead of filling a single fixed skeleton:

  • index.astro is a thin shell — {{hero}} {{home-markers}} {{about}}.
  • fragments/hero/ (4) × fragments/about/ (3) × fragments/nav/ (3) = 36 homepage combinations. New fragments are auto-discovered (drop a file in, no code change).
  • Random per run (Math.random); pass an integer layoutSeed for a reproducible pick (tests). The chosen combo + seed are recorded in the manifest (data.layout) since the run is otherwise non-reproducible.
  • Every fragment preserves the exact slots/markers the pipeline depends on (heroHeadline/heroSub, data-decorative-slot="hero"|"about", <!-- home:* --> / <!-- nav:links -->, nav-actions, site-nav, transition:persist) → downstream build agents stay variant-agnostic. global.css / Layout.astro / Footer.astro are shared (View-Transitions wiring untouched).

BUILD-astro.md documents that layout is auto-randomized by compose (no input required). DISCOVERY-create.md no longer promises a specific layout in the plan (structure is chosen post-approval at compose time).

Supersedes the earlier "3 whole-page variants" approach — those whole-page templates were decomposed into the per-slot fragment library (this branch was squashed to a single clean commit).

Verification

  • compose unit runs: across 16 seeds, every combo renders all slots/markers with no leftover {{…}}; same layoutSeed reproducible; random runs produce distinct combos; global.css/Layout/Footer stable across layouts.
  • End-to-end: 3 minimal yoga sites built + published, each with a visibly different hero/nav layout (centered-banner / stacked-top / split-left), confirmed via Playwright screenshots.

Scope & follow-ups

  • v1 scope: homepage hero + navigation.
  • Follow-ups: per-vertical page fragments (products/services/blog); section-order shuffle + vibe-weighted selection for more variety; persist chosen combo to .wix/layout.json/AGENTS.md for after-the-fact reproducibility; fragment-authoring contract doc + build-all-combos smoke test.
  • Independent of PR fix(wix-headless): carry the user's vibe choice through to the generated theme #405 (CODEAI-667 theme vibe-binding), which stays in draft.

🤖 Generated with Claude Code

@yanivefraim yanivefraim force-pushed the feat/codeai-696-layout-variants branch from 0a81532 to ab86ad1 Compare June 17, 2026 05:38
@yanivefraim yanivefraim changed the title feat(wix-headless): vibe-driven layout variants (CODEAI-696) feat(wix-headless): combinatorial layout composition (CODEAI-696) Jun 17, 2026
Generated sites all shared one fixed layout — same hero, same nav — so two
sites from different prompts looked like the same template re-skinned (only
colors/fonts varied). This makes the homepage STRUCTURE vary per build while
keeping the deterministic, no-LLM-layout pipeline (≤600s, reliable).

compose.mjs now ASSEMBLES the homepage from one randomly chosen fragment per
slot rather than filling a single fixed skeleton:
- index.astro is a thin shell ({{hero}} {{home-markers}} {{about}}).
- fragments/hero/ (4), fragments/about/ (3), fragments/nav/ (3) → 36 homepage
  combinations; new fragments are auto-discovered (drop-in, no code change).
- Selection is random per run (Math.random); pass an integer `layoutSeed` for a
  reproducible pick (tests). The chosen combo + seed are recorded in the
  manifest (data.layout) since the run is otherwise non-reproducible.
- Every fragment preserves the exact slots/markers the pipeline depends on
  (heroHeadline/heroSub, data-decorative-slot hero|about, home:* and nav:links
  markers, nav-actions, site-nav, transition:persist) so downstream build
  agents stay variant-agnostic; global.css/Layout/Footer are shared (View-
  Transitions wiring untouched).

BUILD-astro.md documents that layout is auto-randomized by compose (no input
required; optional layoutSeed for reproducibility). DISCOVERY-create.md no
longer promises a specific layout in the plan (structure is chosen post-approval
at compose time).

v1 scope: homepage hero + navigation. Per-vertical page fragments
(products/services/blog) are a documented follow-up.

Verified: compose across 16 seeds renders all slots/markers with no leftover
placeholders; same seed reproducible; random runs produce distinct combos;
shared shell files stable across layouts. End-to-end: 3 minimal yoga sites built
+ published, each with a visibly different hero/nav layout (centered-banner,
stacked-top, split-left).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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