Skip to content

Reject the name of an existing list in the assembly list prompt - #4129

Merged
siegfriedpammer merged 1 commit into
masterfrom
fix/duplicate-assembly-list-name
Sep 9, 2026
Merged

Reject the name of an existing list in the assembly list prompt#4129
siegfriedpammer merged 1 commit into
masterfrom
fix/duplicate-assembly-list-name

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

The Manage Assembly Lists dialog does not prevent naming a new list after an existing one. All four flows (New / Clone / Rename / Add preconfigured) do check manager.AssemblyLists.Contains(name), but only to return -- the prompt closes, nothing happens, and nothing says why the list never appeared. The WPF host kept the prompt open and showed Resources.ListExistsAlready; the port kept the resource string and dropped the message.

The check now sits in the prompt itself, where the name is entered: CreateListDialog takes a predicate for "is this name in use", keeps OK disabled while the name collides, and shows that same resource string. Since all four flows go through the one prompt, all four are covered. Rename passes the name of the list being renamed as allowed -- renaming a list to its own name is a no-op, not a collision with itself. The early returns in the handlers stay as a second line of defence; they are simply no longer reachable through the UI.

Two headless tests cover the collision and the rename-to-itself case. Button.RootDefaultKeyDown gates on IsEffectivelyEnabled, so the disabled OK cannot be triggered with Enter either.

Full ILSpy.Tests run: 1277 tests, 0 failures.

This PR was prepared by an AI agent (Claude Code) on my behalf.

The WPF host kept the name prompt open and said the name was taken; the port
kept the resource string but dropped the message, and the New / Clone / Rename
/ Add-preconfigured handlers only return early on a collision. Nothing tells
the user why the list they just named did not appear, which reads as the dialog
having accepted the name.

The check belongs in the prompt, where the name is entered: OK stays disabled
while the name collides, so no flow can be handed one. Rename passes the name
of the list being renamed as allowed, because that is a no-op rather than a
collision with itself.

Assisted-by: Claude:claude-opus-5:Claude Code
@siegfriedpammer
siegfriedpammer merged commit 7777f57 into master Sep 9, 2026
17 checks passed
@siegfriedpammer
siegfriedpammer deleted the fix/duplicate-assembly-list-name branch September 9, 2026 19:08
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