Files
cadcraft/crates/engine
code-compliant 8f2a89d048 Properties: a pending edit follows the whole attribute (#1213)
The pending snapshot and the dialog's stale-row check compared the fields a
row shows: tag, prompt, value, insertion point and flags. Two attributes can
match all of those and still be different attributes. With two editable `T=v`
definitions at the same insertion point, texts 1 and 2 high, typing into the
first Properties field and then running `battman {"name":"Twin","action":
"down","tag":"T"}` leaves every compared field equal while the reorder puts
the height-2 attribute in that place; Enter wrote the typed text there, and
the dialog applied its stale row the same way, both without a message.

The row now keeps the whole stored attribute: `AttributeRow::record`, the
engine's own `Attrib` (its text, its own layer, colour, linetype and
lineweight overrides, its modes and its multiline text). A pending edit and a
dialog row are bound to that record, so any stored property that differs
refuses the stale text and says so. The displayed fields stay for the list.

Equality is the drawing data's: two attributes identical in every stored
property are interchangeable, so a swap between them still applies. Text
holding a NaN never equals itself, so such a row refuses a pending edit; it
does not panic.

Tests: both paths write the height-2 attribute without the record comparison
and change nothing with it, checked by height.
2026-11-23 20:06:56 +08:00
..