Skip to content

v3.0: Skeleton-First Crossword Generation

Choose a tag to compare

@rquader rquader released this 04 Apr 05:10
· 158 commits to master since this release
e3aa3c3

v3.0 — Skeleton-First Crossword Generation

Complete redesign of the crossword creation flow and word entry system. 45 files changed, +4316 / -2000 lines since v2.2.

Skeleton-First Crossword Flow (the big change)

Instead of "type all your words and hope the generator uses them," users now:

  1. Pick a grid size (width, height)
  2. Generate Skeleton → see a visual crossword grid with numbered blank slots
  3. Fill slots with words and clues — letters appear in the grid as you type
  4. Create Puzzle when done

Optional: check "Strictly include specific words" → enter must-include words that are guaranteed in the skeleton before blank slots are generated.

Visual Skeleton Grid

  • Filled cells (must-include words) shown in teal
  • Empty slot cells with dots (unfilled) or constraint letters (from crossing words)
  • Blocked cells in dark
  • Click any cell to select its slot in the fill list
  • Crossing cell incumbent ownership: the letter currently in a crossing cell stays — a new crossing word can't displace it. Only when the incumbent word is cleared does the other word's letter take over.

Crossing Cell Visual States

State Color When
Partial Amber One word has filled this cell, crossing word hasn't yet
Matched Green flash (3s) Both words just agreed — brief confirmation, then back to normal
Conflict Red Both words disagree — incumbent letter stays, red signals the problem
Selected Teal ring User clicked this slot — ring overlay, never hides crossing colors

Priority-Based Generator

  • Must-include words placed first (failures reported with specific reasons)
  • Can-include words fill remaining intersections (best-effort, silently skipped)
  • Three-tier system ready for future import review modal (must / can / don't)
  • Uses presorted flag on core generator to control placement order without changing the algorithm

Grid Size Recommendation

  • Formula-based suggestion considering longest word, total content volume, crossword density (~30%)
  • Outlier word detection: warns if one word is disproportionately long (>2x median AND 4+ longer than next)
  • Dynamic presets: Compact / Suggested / Spacious (adapt to your words, replace fixed Small/Medium/Large)
  • Slider range expanded from 15 to 20

New Word Entry System

  • Replaced old CustomInputPanel with new wizard-based entry system
  • EntryTableEditor — word + clue table with add/delete rows
  • TextImportView — paste text with delimiter detection (colon, comma, tab, pipe)
  • File upload support (.txt, .csv, .json) with replace/append decision dialog
  • wizardState.ts — localStorage persistence with hydration and repair

Word Bank

  • ~300 curated common English words (3-12 letters) for skeleton structure
  • Used internally to fill structural gaps, then stripped to create blank slots
  • Never shown to users

Removed

  • Old preset word packs (unit_1 through unit_8, english) — 920 entries removed
  • Old database.ts preset system
  • Old CustomInputPanel component

Word Search

  • Unchanged — entry-first flow retained
  • All entered words included by default

Other Changes

  • GenerateTab fully rewritten — single-page flow, no more 3-step wizard
  • SettingsPanel renamed to "Grid Setup", mode toggle moved to GenerateTab
  • generationSettings.ts extracted as standalone module
  • HelpTab simplified
  • README updated with project authorship
  • createPuzzle.ts — new entry points: createPuzzleWithPriority(), createSkeletonFromEntries()

Tests

  • 144 tests passing (was 83 in v2.2 — 61 new tests added)
  • New test files: gridRecommendation.test.ts (30), priorityGenerator.test.ts (17), skeletonGenerator.test.ts (14), entryTable.test.ts, wizardState.test.ts, wordSourceModules.test.ts
  • Zero regressions, build clean