Skip to content

FE-2424: Rename a net object's id in the editor - #10710

Draft
kube wants to merge 5 commits into
cf/fe-2423-readable-ids-corefrom
cf/fe-2424-rename-a-net-objects-id-in-the-editor
Draft

kube wants to merge 5 commits into
cf/fe-2423-readable-ids-corefrom
cf/fe-2424-rename-a-net-objects-id-in-the-editor

Conversation

@kube

@kube kube commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Before this PR, renaming an object rewrote the document and said nothing first. The values set for a run stayed under the older id: starting tokens, parameter values and the selected scenario were lost on a rename. A paste that numbered an id, and an import that made ids from names, changed them without a word.

This PR adds the feedback. While an id is typed, a note under the ID field counts the arcs, references and code the rename will rewrite. The run configuration and the open entity follow a rename, whoever made it. A paste names the ids it changed, and an import says what the migration did.

10710.mp4

Links

Changes

Rename: a note counts what it rewrites, and the run configuration follows
  • ID field counts what a rename rewrites while an id is typed

    Reads "Also updates 2 arcs, 1 reference and 4 pieces of code."
    Note floats over the fields below it, so nothing moves.

  • Note names the code a rename cannot follow

    "1 piece of code reads it in a way a rename cannot follow."

  • useRenameEntity returns effects

    Dry run of the rename on the current document, null for a draft the entity cannot take.

  • Run configuration follows a rename

    Starting tokens, parameter values, the selected scenario, its parameter values and an ad-hoc scenario move to the new id.

  • Open entity and the timeline's metric follow a rename
  • A rename is detected by position between two versions of a list

    A rename made by the assistant or by Undo is followed like one made in the ID field.

Paste and import: each says which ids it changed
  • A paste returns the ids it changed

    pastePayloadIntoSDCPN and applyClipboardPaste return renamedIds, each with the id it came with and the id it took.

  • Editor names them in a notice

    "Pasted Queue as Queue2", or a count with the first three ids.

  • Import says how many ids the migration changed to fit
  • Import warns about code left reading a former name

    Warning names the entities and stays until dismissed.

  • A notification can outlive a switch of net

    outlivesNetSwitch keeps one through the remount an import causes.
    tone takes warning, and durationMs: Infinity keeps a toast until dismissed.

Known issues

  • Note shows in the ID field of the properties panel alone

    Metric and scenario drawers, Definitions cells, the Dimensions table and the list of nets rename without it.

  • Starting tokens of a place inside a component instance do not follow a rename
  • Some editor state keeps the older id

    Open visualizers, unfolded component instances, hidden timeline series and navigation history.

  • Import notices need Menu > Import

    A host that loads a file through the document handle drops what the migration reports.

More: rename detection, Diagnostics
  • An object removed and another added at one index reads as a rename
  • Diagnostics does not list metric or scenario code left reading a former name

    Warning omits its pointer to Diagnostics when such code is among it.

Test coverage

Unit and component tests: note, rename following, paste result, notices
  • describe-rename-effects.test.ts, draft-field-input.test.tsx, use-rename-entity.test.tsx:

    Wording of the note, when it shows, and the dry run behind it.

  • renamed-ids.test.ts, follow-renamed-ids.test.ts, provider.renamed-ids.react.test.tsx:

    Rename detection, and each part of the run configuration under the new id.

  • resolve-navigated-ids.test.ts, editor-provider.test.tsx:

    Location and timeline metric after a rename.

  • paste.test.ts, commands.test.ts:

    renamedIds for numbered and reformatted ids, and for items a disabled extension strips.

  • id-change-messages.test.ts, use-keyboard-shortcuts.test.tsx, editor-menu.test.tsx, petrinaut.test.tsx:

    Wording of each notice, and that paste and import show them.

  • provider.test.tsx:

    A notification held through a remount, the warning tone and a toast that stays.

How to test

Rename: note under the ID field, starting tokens after a rename
  • Menu > Load example > any model
  • Select a place that has arcs
  • Type another ID in Properties > ID

    Expect a note under the field counting arcs and code, with no field below moving

  • Press Tab

    Expect canvas, arcs and code reading the new ID

  • Switch to Simulate
  • Set starting tokens on a place
  • Switch to Edit and rename that place
  • Switch to Simulate

    Expect the starting tokens under the new ID

Paste and import: notice after each
  • Menu > Load example > any model
  • Copy a place and paste it

    Expect a notice naming the ID it came with and the ID it took

  • Menu > Import > a file saved by an older build

    Expect a notice that IDs were made from the names in the file

kube added 4 commits December 3, 2026 19:32
A note under the ID field of the properties panel counts the arcs, the
references and the pieces of code a rename to the draft would update. It
floats, so nothing around the field moves, and shows only for a draft the
entity can take.
A paste returns the ids it numbered or put in form, and the editor names
them in a notice. Opening a file saved before ids were readable says how
many ids were changed to fit, and warns about code left reading a former
name. A notice can outlive the switch of net that an import causes.
@kube kube self-assigned this Dec 3, 2026
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Dec 3, 2026 7:18pm UTC
petrinaut Ready Ready Preview Dec 3, 2026 7:18pm UTC
petrinaut-docs Ready Ready Preview Dec 3, 2026 7:18pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Dec 3, 2026 7:18pm UTC

Request Review

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team labels Dec 3, 2026
@kube
kube added this pull request to stack #10711 December 3, 2026 19:34

This branch was successfully deployed

3 active deployments
Preview – hash — e86ce78e Deployed Dec 3, 2026 by vercel[bot]
Preview – petrinaut — e86ce78e Deployed Dec 3, 2026 by vercel[bot]
Preview – petrinaut-docs — e86ce78e Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

1 participant