Skip to content

Paste a configuration set into a model's table, and move one out - #101

Merged
ww-mw merged 4 commits into
mainfrom
model/config-set-paste
Nov 5, 2026
Merged

ww-mw merged 4 commits into
mainfrom
model/config-set-paste

Conversation

@ww-mw

@ww-mw ww-mw commented Nov 5, 2026

Copy link
Copy Markdown
Member

A model's table now takes a configuration set pasted or dropped onto its Configurations (heading or any set), on core v1.58.0 (mathworks/data-explorer-core#270), and moves a set out of it:

  • EngineFile.pasteTarget names the section a row is in where it is beside the variables (MODEL_FILE: the configuration sets); MatView's transfer pastes there (pasteEntries('<model>/config', …)). MODEL_FILE sends the config rule beside the workspace's, so Paste and the drop cursor say what it takes.
  • EngineFile.movedOut names the nodes a move into another document takes out (the sets), found by the token their copy carried: a set is cut or dragged out as a dictionary's entry is, and Cut is offered on a set again. Core refuses to take out the active set, and the move then leaves it, in core's words.
  • A pasted set shows no Status (as an added or renamed set shows none); it had shown Modified, which a save left painted.

Core names a duplicate as MATLAB does (Fast1) and writes the set with its settings; a model's set pasted into a dictionary is held there whole (checked in MATLAB: R2027a 60/60).

  • Peer range raised to ^1.58.0 (an older core offers no paste there); dev pin and README example v1.58.0.
  • Goldens: the three one-set models' Configuration shows the dictionary's read-only Other group in its inspector (sparse_ws, mcosfix, projmodel), as core 1.58 builds an R2026b+ model's sets from their parts; nothing else moved.
  • Tests (test/modelEngine/model.test.ts): a set duplicated (one edit, saved, undone), a dictionary's set into a model and a model's into the dictionary (with its settings), a set cut into another model (taken out of the first; the active one stays), no Status on a pasted set, older-layout refusals. npm run verify: 4,725 pass.

Downstream: vscode branch model/config-set-paste (core v1.58.0, an integration test of copy and paste).

ww-mw added 4 commits November 4, 2026 20:28
A model's table is to take a configuration set pasted into its
Configurations: a copy of one of its own, named as MATLAB names a
duplicate (Fast1), one edit, saved; a dictionary's set; and a model's
set pasted into a dictionary's table. The section's rule says what it
takes. An older layout's set is not copied, nor a set pasted into one,
saying why, and a workspace takes none (pd.sldd, MATLAB's own save,
from core's fixtures).
A paste or a drop onto a model's Configurations heading or one of its
sets now lands in the sets, where core says they take an edit:
- EngineFile.pasteTarget names the section a row is in where it is
  beside the variables (MODEL_FILE: the configuration sets).
- MatView's transfer pastes there (core's pasteEntries into
  <model>/config).
- MODEL_FILE sends the config rule beside the workspace's, so the
  table's Paste and drop cursor say what it takes.

Core names a duplicate as MATLAB does (Fast1) and writes the set with
its settings. A model's set copied out pastes into a dictionary whole.

Goldens: core v1.58's sets of an R2026b+ model hold their settings, as
a dictionary's do, so the three one-set models' Configuration shows
the dictionary's read-only Other group in its inspector (sparse_ws,
mcosfix, projmodel); nothing else in them moved.
…ed one

From review:
- A drag of a set into another document landed the paste, but its
  original stayed: the move's delete looked for it among the workspace's
  variables by name. EngineFile.movedOut names the nodes beside the
  variables a move takes out (MODEL_FILE: the configuration sets),
  each found by the token its copy carried. So a set is moved, cut or
  dragged, as a dictionary's entry is, and Cut is offered on a set
  again. Core refuses to take out the active set; the move then leaves
  it, in core's words.
- A pasted set was handed to the Status column's marks as a variable:
  it showed Modified, and a save left the mark painted. It shows none
  now, as an added or renamed set shows none.
The model table's paste into its configuration sets, and a move of one
out, are core 1.58's (mathworks/data-explorer-core#270): an older core
offers no paste there. So the peer range is ^1.58.0.
@ww-mw
ww-mw merged commit f49a7f0 into main Nov 5, 2026
6 checks passed
@ww-mw
ww-mw deleted the model/config-set-paste branch November 5, 2026 02:35
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