Skip to content

fix: hide broken-config banner for new workspaces and reject empty names on save - #50

Merged
joshooaj merged 2 commits into
mainfrom
fix/mc-new-workspace-false-broken-banner
Oct 29, 2026
Merged

joshooaj merged 2 commits into
mainfrom
fix/mc-new-workspace-false-broken-banner

Conversation

@joshooaj

@joshooaj joshooaj commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two Management Client workspace-page fixes in one branch.

1. False broken-config banner on a brand-new workspace

CreateItem persists a placeholder item named Enter a name with an empty home address, and the MIP shell then fills the page for that same item. DetectError on the empty config blob reports MissingBrowserConfig, which raises ticket #27's red "Saved configuration is broken" banner on an item the user never had a chance to save.

The banner is correct for genuinely corrupt definitions, but an empty-address initial item is the MIP add-item pattern: the state is unfinished, not broken. The placeholder name is the discriminator.

// WorkspaceItemManager
- SignalBrokenConfiguration(item, configError)
+ SignalBrokenConfiguration(item, properties, configError)
+   if WorkspaceConfiguration.IsUnfinishedNewWorkspace(name, properties)  // name is the placeholder AND DetectError != None
+     SignalUnfinishedNewItem()   // no banner; page stays dirty so Save is enabled
+     return
    SignalLoadDefect(banner)      // only genuinely broken definitions get the banner

2. Empty-name gate

// WorkspaceItemManager.ValidateAndSaveUserControl
+   if WorkspaceNameValidation.IsEmpty(_userControl.WorkspaceName)   // new pure helper, WorkspaceNameValidation
+     log + "Missing name" dialog, return false
-   CurrentItem.Name = _userControl.WorkspaceName ?? CurrentItem.Name   // blank box persisted a blank node
+   CurrentItem.Name = name   // assigned only after the gate passes

Previously, clearing the name box persisted a nameless item that the tree renders as a blank node. The placeholder name itself is not banned: a completed workspace that kept Enter a name remains a legitimate definition.

Test evidence

Behavior before this branch, as verified live in Management Client:

  • New workspace: banner "Saved configuration is broken: no browser page with a home address..." on an empty page the user never saved.
  • Save with an empty or whitespace name: the name persisted, leaving a blank tree node.

Behavior after, on a deployed build whose hash matches the branch tip:

  • New workspace: banner hidden, Save still enabled.
  • Save with an empty or whitespace name: dialog "Missing name" with the required-name message, save rejected, item untouched.

Unit tests:

dotnet test src/WebContent.Tests
Passed!  - Failed: 0, Passed: 217, Total: 217 (incl. NewWorkspacePlaceholderTests x10, WorkspaceNameValidationTests x8)

MSBuild x64 Debug plugin build, exit code 0.

Merge risk

Reverting is two-way: a revert drops the placeholder-name check and the name gate. There are no persisted-data or config-format changes.

Blast radius: the Management Client workspace page only. Genuinely broken definitions (any name other than the untouched placeholder) keep the ticket #27 banner, and Smart Client behavior (ticket #9 notifications) is untouched. Verified: the MC tree Rename command rejects an empty rename shell-side (a no-op), so the detail-page gate is the only guard the plugin needs.

CreateItem persists the initial placeholder item (name 'Enter a name',
empty home address) per the MIP add-item pattern, and the shell then
fills the detail page from that same item. FillUserControl re-ran
DetectError over the empty blob and the ticket #27 banner painted
'Saved configuration is broken' before the user ever had a chance to
save. The placeholder name distinguishes a never-completed new item
from a genuinely corrupt definition: admin fills now suppress the
banner for it while still marking the page dirty, so Save stays
enabled while the user completes name and home address.
ValidateAndSaveUserControl wrote _userControl.WorkspaceName straight into
CurrentItem.Name with only a null-coalesce fallback, so clearing the name
box persisted a nameless item the tree can only render as a blank node.
The save now gates on WorkspaceNameValidation.IsEmpty first (matching the
home-address gate below it): empty or whitespace-only names are rejected
with a dialog, the log names the FQID, and CurrentItem is left untouched.
The placeholder name itself is not banned -- a completed workspace that
kept 'Enter a name' remains a legitimate state.
@joshooaj joshooaj changed the title fix: stop flagging never-saved new workspaces as broken definitions fix: new-workspace admin page — false broken-config banner + empty-name gate Oct 29, 2026
@joshooaj joshooaj changed the title fix: new-workspace admin page — false broken-config banner + empty-name gate fix: hide broken-config banner for new workspaces and reject empty names on save Oct 29, 2026
@joshooaj
joshooaj merged commit 51eed68 into main Oct 29, 2026
2 checks passed
@joshooaj
joshooaj deleted the fix/mc-new-workspace-false-broken-banner branch October 29, 2026 08:30
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