Skip to content

fix(draft): show suggested nonbasic lands in deck - #7062

Merged
matthewevans merged 3 commits into
mainfrom
ship/fixdraft-show-suggested-nonbasic-lands-in-deck
Aug 7, 2026
Merged

fix(draft): show suggested nonbasic lands in deck#7062
matthewevans merged 3 commits into
mainfrom
ship/fixdraft-show-suggested-nonbasic-lands-in-deck

Conversation

@matthewevans

@matthewevans matthewevans commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved suggested deck construction so drafted nonbasic fixing lands are included in the main deck.
    • Land recommendations now contain only additional lands that can be added.
    • Preserved draft-pool order and correctly handled duplicate cards.
    • Prevented off-color or unrecognized nonbasic lands from being added.
    • Ensured suggested decks maintain the requested size.
    • Improved handling when card information is unavailable.

@matthewevans
matthewevans enabled auto-merge August 6, 2026 18:52
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c6df0aa-53b8-403c-9193-48b72dbf0a5f

📥 Commits

Reviewing files that changed from the base of the PR and between c62bae7 and 0a3d225.

📒 Files selected for processing (1)
  • crates/draft-wasm/src/suggest.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/draft-wasm/src/suggest.rs

📝 Walkthrough

Walkthrough

The suggestion logic places drafted nonbasic fixing lands in main_deck. The lands map now contains only addable cards. Selection preserves pool order and supports duplicate drafted copies. Tests cover color eligibility, exact deck size, and missing card databases.

Changes

Drafted land classification

Layer / File(s) Summary
Classify drafted fixing lands
crates/draft-wasm/src/suggest.rs
SuggestedDeck records drafted nonbasic lands in main_deck. Selection preserves pool order, decrements duplicate counts, and keeps lands limited to addable cards.
Validate fixing land output
crates/draft-wasm/src/suggest.rs
Tests verify on-color inclusion, off-color exclusion, absence from lands, exact deck size, duplicate copies, and no-database behavior.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested labels: needs-maintainer

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: displaying suggested nonbasic lands in the draft deck.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ship/fixdraft-show-suggested-nonbasic-lands-in-deck

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/draft-wasm/src/suggest.rs (1)

481-540: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add a duplicate drafted-land test.

The tests do not create two distinct DraftCardInstance values with the same selected nonbasic-land name. Add a test that verifies both copies enter main_deck and each copy replaces one basic land. This validates the count-decrement logic in Lines 115-127.

As per path instructions, CLAUDE.md requires focused tests for “duplicate drafted copies.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/draft-wasm/src/suggest.rs` around lines 481 - 540, Add a focused test
alongside the existing nonbasic-land tests that constructs two distinct
DraftCardInstance values with the same selected nonbasic land name, runs the
suggestion flow, and asserts both copies appear in main_deck. Also verify each
copy replaces a basic by asserting the combined spell and land count remains
min_deck_size and the basic-land allocation is reduced by two.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/draft-wasm/src/suggest.rs`:
- Around line 481-540: Add a focused test alongside the existing nonbasic-land
tests that constructs two distinct DraftCardInstance values with the same
selected nonbasic land name, runs the suggestion flow, and asserts both copies
appear in main_deck. Also verify each copy replaces a basic by asserting the
combined spell and land count remains min_deck_size and the basic-land
allocation is reduced by two.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 40b500ee-ca34-4c79-8fb0-e138f13744dd

📥 Commits

Reviewing files that changed from the base of the PR and between 8c6e1d1 and c62bae7.

📒 Files selected for processing (1)
  • crates/draft-wasm/src/suggest.rs

@matthewevans
matthewevans added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 68e0bf6 Aug 7, 2026
13 checks passed
@matthewevans
matthewevans deleted the ship/fixdraft-show-suggested-nonbasic-lands-in-deck branch August 7, 2026 01:16
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