Skip to content

Add AQRE puzzle type support#1

Open
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin/1776158424-add-aqre-support
Open

Add AQRE puzzle type support#1
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin/1776158424-add-aqre-support

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot commented Apr 14, 2026

Summary

Adds full AQRE puzzle type support to icebarn-rs, including:

  • PuzzleType enum (Icebarn, Aqre) with #[serde(default)] for backward-compatible deserialization
  • BPZ parser extensions: PUZZLE-TYPE aqre, REGION row col id, RECT-REGION bl_row bl_col tr_row tr_col id
  • Region-aware rendering: thick borders between different regions, thin borders within regions
  • Click-to-shade / drag-to-shade interaction: left-click toggles cell shading, drag to shade/unshade multiple cells; line-drawing and right-click marking disabled for AQRE
  • AQRE shading CSS: solid gray background with white text (no diagonal hatching overlay)
  • Serialization fix: switched rmp_serde::to_vecto_vec_named so new fields don't break existing stored room data
  • 6 sample puzzle files: Basic ×3, Paint ×1, Spiral ×1, Binario ×1
  • Multiplayer sync works automatically via existing CRDT marked/toggle_mark mechanism

Review & Testing Checklist for Human

  • Serialization compatibility: Verify that existing multiplayer rooms still load correctly after this change (the switch to to_vec_named + #[serde(default)] should handle it, but worth verifying with real DB data)
  • AQRE shading interaction: Open an AQRE puzzle in singleplayer, click cells to shade/unshade, drag across multiple cells — verify solid gray fill without diagonal hatching
  • Region borders: Verify thick borders appear between different regions and thin borders within regions
  • Icebarn regression: Verify existing icebarn puzzles still render and interact correctly (line drawing, portals, arrows)
  • Sample puzzles: Replace the 6 sample .bpz files with actual BmMT 2026 competition puzzles

Notes

  • The interactive() method on Cell hasn't been updated for AQRE — all non-removed cells are interactive by default since they have Shading::Default, which passes the existing check
  • AQRE variant rules (Paint, Spiral, Binario) are not enforced in the editor — this is a puzzle editor, not a solver
  • Cell text in AQRE uses smaller font (text-sm font-medium) to fit region count clues

Link to Devin session: https://app.devin.ai/sessions/d1ea1cd3b93444dda95af5fc775be43a
Requested by: @oliver-ni


Open with Devin

- Add PuzzleType enum (Icebarn, Aqre) to bpz module
- Add region field to Cell for AQRE region groupings
- Add REGION and RECT-REGION instructions to BPZ parser
- Update editor state with AqreShading draw mode for click-to-shade interaction
- Add region-aware border rendering in cell component
- Add aqre-shaded CSS class for shaded cell visual feedback
- Disable line-drawing and right-click marking for AQRE puzzles
- Add 6 sample AQRE puzzle files (Basic, Paint, Spiral, Binario variants)
- Pass puzzle_type through State, PuzzleEditor, and multiplayer components

Co-Authored-By: Oliver Ni <oliver.ni@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration bot and others added 2 commits April 14, 2026 09:33
- Make class:marked conditional on non-AQRE puzzles to prevent diagonal
  hatching stripes from overlapping the solid gray AQRE shading
- Switch rmp_serde::to_vec to to_vec_named for map-based MessagePack
  serialization, preventing field position breakage
- Add #[serde(default)] to new fields (puzzle_type, region) so existing
  stored room data deserializes correctly

Co-Authored-By: Oliver Ni <oliver.ni@gmail.com>
…rialization

Old room data was serialized with positional (array) MessagePack encoding.
Having puzzle_type as the first field would cause a type mismatch when
deserializing old data (Pos parsed as PuzzleType). Moving it to the end
means old positional data deserializes correctly for the first 5 fields,
and #[serde(default)] kicks in when the array is exhausted for the 6th.

Co-Authored-By: Oliver Ni <oliver.ni@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

Test Results — AQRE Puzzle Support

Ran app locally via cargo leptos watch, tested AQRE puzzle UI in Singleplayer mode end-to-end.

All 5 tests passed.

AQRE Puzzle Tests
  • It should render AQRE puzzle with region borders and clue numbers — passed

    • 4×4 grid with thick borders between 2×2 regions, thin borders within. Clue numbers (1, 0, 3, 2) visible. No icebarn dots.

    Aqre Basic 1 grid

  • It should shade cells on click without diagonal hatching — passed

    • Clicked cell shows solid gray fill. White text on clue numbers. No diagonal hatching stripes.

    Shaded cell

  • It should shade multiple cells via drag — passed

    • Dragged across top row — all 4 cells shaded with solid gray.

    Drag shaded

  • It should render different AQRE puzzles with correct region layouts — passed

    • Aqre Basic 3 (6×6), Paint 1, Spiral 1, Binario 1 all render with correct region borders and clues.
    Aqre Basic 3 Aqre Paint 1 + Binario 1
    Basic 3 Paint + Binario
Regression Test
  • [Regression] It should still draw lines in icebarn puzzles — passed

    • Red line drawn between two cells. Small gray dots visible. Line-drawing interaction intact.

    Icebarn regression


Devin session

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