Adding a NamedObjectSave and renaming one in the tree are two separate code paths that share
validation logic. See [[glue-task-manager]] for how each path's save/codegen work gets queued.
"New Object" modal — type radios, filtered type list, name box
Glue/ViewModels/AddObjectViewModel.cs
Backing VM; SetDefaultObjectName() auto-generates a unique name; IsTypePredetermined/IsSelectionEnabled/IsObjectTypeGroupBoxEnabled gate which controls are enabled
RenameItem() — SelectionLogic.Current.CurrentNode.IsEditing = true is the whole mechanism for entering inline rename
Gotchas
IsTypePredetermined (set when adding to a typed list, or explicitly by the caller, e.g.
HandleAddLayerClick) drives IsSelectionEnabled => !IsTypePredetermined, which disables both the
type radio group and the type list, not just one. CreateAndShowAddNamedObjectWindow checks the
final value of this flag (it can be narrowed later, e.g. AvailableEntities.Count < 2 for a typed
list whose generic type has derived entities to choose from) and skips constructing the WPF window
entirely when true — adds immediately with the SetDefaultObjectName() default, no modal shown at
all. RightClickHelper.AddObjectAndBeginRename() then drops the new tree node straight into inline
rename.
IsOkButtonEnabled only checks SelectedItem != null — it was never gated on name validity. The
name field itself no longer exists in NewObjectTypeSelectionControlWpf.xaml; naming happens via
inline tree rename after add, not before.
DialogCommands.ShowAddNewObjectDialog no longer calls NameVerifier.IsNamedObjectNameValid before
adding — the name is Glue's own computed default at that point, not free-typed input. It still checks
RecursionManager.Self.CanContainInstanceOf (unrelated to naming).
Double-clicking a type in the list (StrongSelect) immediately confirms the dialog with whatever's
in the name box — no Enter/OK click needed.
Tree inline rename validates via NameVerifier and reverts on invalid input inside
NodeViewModel.HandleRenameThroughEdit → GluxCommands.RenameNamedObjectSave — the same validation
the Add path uses, so chaining add → immediate rename stays safe.
Chaining Add then Rename queues two independent SaveProjectAndElements(AddOrMoveToEnd) calls with
different DisplayInfo, so per glue-task-manager's coalescing rule they run as two separate
save/codegen passes, not one.
AddNewNamedObjectToAsync and AddNamedObjectToAsync's own TaskManager.Self.AddAsync calls both use
TaskExecutionPreference.Asap, not the AddAsync default of Fifo — the add is a direct
user-triggered action AddObjectAndBeginRename depends on completing immediately, not something that
should sit behind unrelated Fifo-tier work. Bumping the inner (nested) call is defensive rather than
strictly required — see glue-task-manager's note on why a nested AddAsync call runs inline
regardless of its own preference.
RightClickHelper.AddObjectAndBeginRename() is the single shared entry point for the tree's own "Add
Object"/"Add Layer" menu items and the Ctrl+N shortcut (MainTreeViewControl.xaml.cs) — it calls
ShowAddNewObjectDialog, then SelectionLogic.Current.SelectByTag/.IsEditing = true.
DragDropManager.cs's drag-and-drop add and QuickActionPlugin's add call ShowAddNewObjectDialog
directly instead (they get the modal-skip but not the auto-inline-rename trigger, since
SelectionLogic is internal to the TreeViewPlugin assembly and unreachable from those projects).
1---2name: glue-add-object-flow3description: Glue Add-Object Flow4---56# Glue Add-Object Flow78Adding a `NamedObjectSave` and renaming one in the tree are two separate code paths that share9validation logic. See [[glue-task-manager]] for how each path's save/codegen work gets queued.1011## File Map1213| File | Role |14|---|---|15| `Glue/Controls/NewObjectTypeSelectionControlWpf.xaml(.cs)` | "New Object" modal — type radios, filtered type list, name box |16| `Glue/ViewModels/AddObjectViewModel.cs` | Backing VM; `SetDefaultObjectName()` auto-generates a unique name; `IsTypePredetermined`/`IsSelectionEnabled`/`IsObjectTypeGroupBoxEnabled` gate which controls are enabled |17| `Glue/Plugins/ExportedImplementations/CommandInterfaces/DialogCommands.cs` | `ShowAddNewObjectDialog` / `CreateAndShowAddNamedObjectWindow` — shows the modal, validates the name after it closes |18| `Glue/Plugins/ExportedImplementations/CommandInterfaces/GluxCommands.cs` | `AddNewNamedObjectToSelectedElementAsync` → `AddNewNamedObjectToAsync` → `AddNamedObjectToAsync` (actual add); `RenameNamedObjectSave` (separate rename path) |19| `OfficialPlugins/TreeViewPlugin/ViewModels/NodeViewModel.cs` | `IsEditing` toggle drives in-place tree rename; `HandleRenameThroughEdit` dispatches by `Tag` type (`GlueElement`/`ReferencedFileSave`/`NamedObjectSave`/folder) |20| `OfficialPlugins/TreeViewPlugin/Logic/RightClickHelper.cs` | `RenameItem()` — `SelectionLogic.Current.CurrentNode.IsEditing = true` is the whole mechanism for entering inline rename |2122## Gotchas2324- `IsTypePredetermined` (set when adding to a typed list, or explicitly by the caller, e.g.25 `HandleAddLayerClick`) drives `IsSelectionEnabled => !IsTypePredetermined`, which disables *both* the26 type radio group and the type list, not just one. `CreateAndShowAddNamedObjectWindow` checks the27 *final* value of this flag (it can be narrowed later, e.g. `AvailableEntities.Count < 2` for a typed28 list whose generic type has derived entities to choose from) and skips constructing the WPF window29 entirely when true — adds immediately with the `SetDefaultObjectName()` default, no modal shown at30 all. `RightClickHelper.AddObjectAndBeginRename()` then drops the new tree node straight into inline31 rename.32- `IsOkButtonEnabled` only checks `SelectedItem != null` — it was never gated on name validity. The33 name field itself no longer exists in `NewObjectTypeSelectionControlWpf.xaml`; naming happens via34 inline tree rename after add, not before.35- `DialogCommands.ShowAddNewObjectDialog` no longer calls `NameVerifier.IsNamedObjectNameValid` before36 adding — the name is Glue's own computed default at that point, not free-typed input. It still checks37 `RecursionManager.Self.CanContainInstanceOf` (unrelated to naming).38- Double-clicking a type in the list (`StrongSelect`) immediately confirms the dialog with whatever's39 in the name box — no Enter/OK click needed.40- Tree inline rename validates via `NameVerifier` and reverts on invalid input inside41 `NodeViewModel.HandleRenameThroughEdit` → `GluxCommands.RenameNamedObjectSave` — the same validation42 the Add path uses, so chaining add → immediate rename stays safe.43- Chaining Add then Rename queues two independent `SaveProjectAndElements(AddOrMoveToEnd)` calls with44 different `DisplayInfo`, so per `glue-task-manager`'s coalescing rule they run as two separate45 save/codegen passes, not one.46- `AddNewNamedObjectToAsync` and `AddNamedObjectToAsync`'s own `TaskManager.Self.AddAsync` calls both use47 `TaskExecutionPreference.Asap`, not the `AddAsync` default of `Fifo` — the add is a direct48 user-triggered action `AddObjectAndBeginRename` depends on completing immediately, not something that49 should sit behind unrelated Fifo-tier work. Bumping the inner (nested) call is defensive rather than50 strictly required — see `glue-task-manager`'s note on why a nested `AddAsync` call runs inline51 regardless of its own preference.52- `RightClickHelper.AddObjectAndBeginRename()` is the single shared entry point for the tree's own "Add53 Object"/"Add Layer" menu items and the Ctrl+N shortcut (`MainTreeViewControl.xaml.cs`) — it calls54 `ShowAddNewObjectDialog`, then `SelectionLogic.Current.SelectByTag`/`.IsEditing = true`.55 `DragDropManager.cs`'s drag-and-drop add and `QuickActionPlugin`'s add call `ShowAddNewObjectDialog`56 directly instead (they get the modal-skip but not the auto-inline-rename trigger, since57 `SelectionLogic` is internal to the TreeViewPlugin assembly and unreachable from those projects).
Run npx skillmds@latest add vchelaru/glue-add-object-flow in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Glue Add-Object Flow It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
vchelaru (@vchelaru) published this skill. Their other Agent Skills are listed on their SkillMD profile.