Skip to content

test(ui): cover dynamic block names for several references - #2965

Open
AlexJoaquimPereira wants to merge 2 commits into
storytold:mainfrom
AlexJoaquimPereira:test/2403-dynamic-block-name
Open

AlexJoaquimPereira wants to merge 2 commits into
storytold:mainfrom
AlexJoaquimPereira:test/2403-dynamic-block-name

Conversation

@AlexJoaquimPereira

@AlexJoaquimPereira AlexJoaquimPereira commented Nov 9, 2026 •

Copy link
Copy Markdown

What changed

Adds the missing regression test for the multi-selection Properties palette's dynamic-block name.

6ecabc34 (#2403) made several selected references to one dynamic block show that block's name instead of the anonymous *U… block each reference points at. No test covered it. The new test reads the shared Door fixture, changes two references so each points at an anonymous block, selects both, and checks the palette shows Door, with no *VARIES* and no *U….

Why

Without the test, the behaviour can regress silently: the pre-fix code showed Name: *VARIES* because the two anonymous block names differ. The test fails on that old behaviour and passes with the fix.

Verification

  • cargo test -p cadcraft-ui-egui --lib several_dynamic_block_references_show_the_block_name — pass; with the old name resolution temporarily restored it fails with Name: *VARIES*.
  • cargo test -p cadcraft-ui-egui --lib — 261 passed, 1 ignored.
  • cargo clippy -p cadcraft-ui-egui --all-targets --keep-going -- -D warnings — pass.
  • cargo fmt --all -- --check — pass.
  • cargo xtask layers — pass.
  • cargo xtask assets — pass (28 assets attributed).
  • cargo xtask i18n — pass (report only).
  • cargo xtask wasm — pass (only pre-existing dead-code warnings on wasm).
  • cargo test --workspace --lib --bins --tests -- --skip mtext::tests::strips_formatting --skip complex::tests::thai_marks_stack_in_an_installed_font — exit 0, no failures.
  • cargo test --workspace --doc — pass.

cargo xtask ci on this base stops at mtext::tests::strips_formatting (issue #2952, fixed by open PR #2954), which is unrelated to this test-only change. Its fmt and clippy steps pass. The full workspace run above skips only that test and the pre-existing flaky complex::tests::thai_marks_stack_in_an_installed_font, which passes alone.

Scope

Test-only. No production code or behaviour changes. Adds cadcraft-io as a dev-dependency to read the existing shared Door fixture; no CI changes and no parity-doc edits.

Checklist

  • Narrow change: one regression test and its fixture dependency.
  • The test fails without the fix and passes with it.
  • Formatting, clippy, affected tests and project gates run locally.
  • No CI workflow changes.
  • No roadmap/gaps/parity docs edited.

Summary by CodeRabbit

  • Tests
    • Added regression coverage to verify that selecting multiple instances of the same dynamic Door block shows the shared Door name in the Properties palette.

The multi-selection Properties palette showed *VARIES* for references to one dynamic block, because each reference points at its own anonymous *U block. The fix in storytold#2403 (6ecabc3) resolves each reference's dynamic name; this adds the missing regression test. It reads the shared Door fixture, changes both references so they point at anonymous blocks, selects them, and checks that the palette shows the block name and no *VARIES*.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Run configuration

Commits

Reviewing files that changed from the base of the PR and between afde0da and 12b594e.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds a regression test for the Properties palette when two selected dynamic Door references point to separate anonymous blocks. The test loads the shared Door fixture and checks that the palette displays Door.

Changes: Dynamic Door Properties test

Layer / File(s) Summary
Build and verify the dynamic Door selection
crates/ui-egui/Cargo.toml, crates/ui-egui/src/palettes.rs
The test loads the Door fixture, creates and selects two dynamic references, and checks that the Properties palette displays Door rather than *VARIES* or an anonymous block name.

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

Change: Other

Suggested reviewers: aldozar, lforgiarini, dylanmtaylor

Merge Risk: Minimal · previous review afde0

The change adds a regression test without changing production behavior. No merge-blocking issue is established.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the added regression test for dynamic block names with multiple references.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a3d9348 and afde0da.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 2

  • crates/ui-egui/Cargo.toml
  • crates/ui-egui/src/palettes.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

freemans32 added a commit to freemans32/cadcraft that referenced this pull request Nov 10, 2026

This branch has not been deployed

No deployments
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