Skip to content

V05.2: keep typed move coordinates on a re-selection and pre-fill in round-trip form - #107

Merged
Blogbotana merged 1 commit into
Apibim-com:masterfrom
axisrow:ao/task-next-fork/promotion/v052-edit-prefill
Oct 20, 2026
Merged

Blogbotana merged 1 commit into
Apibim-com:masterfrom
axisrow:ao/task-next-fork/promotion/v052-edit-prefill

Conversation

@axisrow

@axisrow axisrow commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What this changes

Mirror of the fork's #37 (axisrow/BeamCraft), rebased onto upstream master 73c3597.
One commit, verbatim:

  • V05.2: keep typed move coordinates on a re-selection and pre-fill in round-trip form
    (934ccaf).

The V05.2 edit panel's Move form was re-created empty on every re-selection, so typed but
uncommitted coordinates vanished when the user clicked another element and back; the pre-fill
also showed internal f64 display instead of the round-trip form the CLI accepts. The form
now keeps what was typed across a re-selection and pre-fills from the element in the exact
round-trip representation. Pure UI-side change on the V05.2 edit panel; the engine and the
CLI are untouched.

How you verified it

  • cargo clippy -p beamcraft-ui --all-targets -- -D warnings
  • cargo test -p beamcraft-ui --test edit_tools — 7 tests, 0 failed (the suite drives
    the edit state machines against the real CLI; the change's round-trip pre-fill is
    covered by the move-form assertions)
  • CI on this PR for Windows/Linux.

Provenance (clean-room)

  • Verbatim fork material, same MPL-2.0 project; no new assets or dependencies.

🤖 Generated with Claude Code

Verified final integration status

Earlier preparation/draft notes in this historical description are superseded by GitHub's final state: merged into master on 2026-10-20T13:07:30Z. Independently fetched integration commit 6ccfd5b: Merge pull request #107 from axisrow/ao/task-next-fork/promotion/v052-edit-prefill. This records delivery of this PR's limited slice, not completion of open acceptance gates.

Issue tracking

Fixes #350

…round-trip form

Selecting the already selected element again rewrote the move form with
the snapshot's placement, silently discarding what the user had typed.
And the pre-fill used Display formatting, so a placement with float
noise (for example 5.551115123125783e-17) printed as a 34-character
decimal string and failed the number field's own 32-character cap on an
untouched form. The pre-fill now uses the shortest round-trip (Debug)
form, which parses back and always fits the cap, and a re-selection of
the same element leaves the typed coordinates alone.

(cherry picked from commit 934ccaf)

@axisrow axisrow left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Verdict: approved

Promotion of the V05.2 edit-prefill fix; the diff is one behaviour change in Editor::select plus tests.

Checked in detail:

  • The re-selection guard compares ElementInfo by value, so it is identity-correct: the same unchanged element keeps the typed coordinates, while a genuinely moved element (different reported translation) pre-fills the new one. A stale staged preview is still dropped unconditionally, which is the safe direction — the user re-previews instead of committing a stale snapshot, and the doc comment states the typed-text versus staged-edit distinction accurately.
  • format!("{v:?}") (shortest round-trip) is the right prefill form: it stays under the 32-character number-field cap for every finite f64 (worst case -1.7976931348623157e308, 22 chars) where Display would print tiny values as a digit string that overflows the cap, and the CLI float parser accepts exponent notation, which the new test exercises end to end through prepare.
  • The new test covers all three behaviours (round-trip prefill with float noise and exponents, re-click keeps typing, another selection pre-fills its own translation), and the two updated assertions ("0" to "0.0") are the only Display-to-Debug cosmetic fallout.
  • No production code outside select is touched; the fork has run this exact behaviour since its V05.2 fix.

@Blogbotana
Blogbotana merged commit 6ccfd5b into Apibim-com:master Oct 20, 2026
4 checks passed
@axisrow
axisrow deleted the ao/task-next-fork/promotion/v052-edit-prefill branch October 24, 2026 06:54
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.

PR #107: V05.2: keep typed move coordinates on a re-selection and pre-fill in round-trip form

2 participants