Skip to content

feat: combined web improvements (PRs #7, #8, #11, #12) - #14

Merged
daniel-jones-dev merged 13 commits into
mainfrom
web/feat-combined
Jul 2, 2026
Merged

daniel-jones-dev merged 13 commits into
mainfrom
web/feat-combined

Conversation

@daniel-jones-dev

Copy link
Copy Markdown
Owner

Summary

Combines four previously-open PRs into a single reviewable branch:

Also includes the shared AboveBoard component, min-width for controls, and solver improvements from the merged PR #9.

Test plan

  • Dev server running on port 5173 (npm run dev)
  • npx playwright test — all tests pass (57 tests)
  • Play mode: solve a puzzle → "Congratulations" banner and "New puzzle" button appear
  • Play/Solve: hint cells visually distinguish queen placements (green) from cross-outs (red)
  • Editor: generate a puzzle → JSON includes name, source, date fields
  • Solver: rules panel shows Easy/Medium/Hard categories

🤖 Generated with Claude Code

daniel-jones-dev and others added 13 commits June 29, 2026 13:31
hintChanges was Set<string> — board couldn't tell whether a hint cell
would become a queen or a cross, so all hint cells looked identical.

Changed to Map<string, number> (cellKey → target state). Cross hints
(state 2) get a diagonal stripe overlay. Queen hints (state 1) get no
overlay. Uninvolved cells now use a dark semi-transparent overlay
instead of opacity: 0.35, keeping colours visible while clearly muted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The button cluttered the action row while playing. It now appears
below the SolvedBanner immediately after solving, which is when the
player naturally wants a new challenge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated puzzles had no metadata, so the Play page showed no name
or source. Now Play↗ and Edit↗ inject name ("Generated N×N from seed
S"), source, and today's date into the puzzle JSON before navigating.

Also adds name/source/date as optional fields to PuzzleJson in Rust
and documents them in formats.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each Rust rule now carries a stable code_name (&'static str). WasmHint
gains a name() method that returns it. The web introduces
web/src/data/rules.ts as the single source for rule metadata (name,
difficulty, description). RulesPage renders from RULES instead of
hardcoded JSX. SolvePage matches active hints by codeName instead of
description string patterns, so rule display survives description text
changes on the Rust side.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
generate.test.ts: 'New puzzle' is now gated behind solved state —
tests updated to solve via hints first, and a new test asserts the
button is hidden until solving.

solve.test.ts: rule categories changed from Basic/Easy/Medium/Hard
to Easy/Medium/Hard — remove stale 'Basic' assertion.

helpers.ts: add solveViaHints helper for Play-mode integration tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Region border segments now track their two adjacent cells. When both
adjacent cells are dimmed (not involved in the hint), the border is
also dimmed (0.18 opacity vs 0.5). Involved cells get a subtle 10%
darkening so the focused area reads as intentionally highlighted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Board: reduce dim opacity for cells with existing content (queen/cross)
from 0.42 to 0.18 so placed marks remain readable when outside the
hint focus area. Remove the involved-cell overlay — it made the whole
board look slightly grey when the hint's involved set is broad.

EditorPage: add align-items: center to boardCol so the board and
controls are centred rather than stretching to the column width.

PlayPage/utils: PuzzleMeta now includes date; handleShare injects
name/source/date back into the puzzle JSON before base64-encoding,
since WasmPuzzle.to_json() always strips those fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Row 1: Undo · Redo · Clear board
Row 2: Size picker · Generate · Shuffle queens
Row 3: Share/Export · Open in Play

Buttons in each row use flex: 1 for equal widths. Removed the
vertical dividers that were grouping disparate actions within a row.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@daniel-jones-dev
daniel-jones-dev merged commit 3a3ea80 into main Jul 2, 2026
4 checks passed
@daniel-jones-dev
daniel-jones-dev deleted the web/feat-combined branch July 2, 2026 11:46
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