{"record":{"id":"1f05009ee0e02bca","repo":"LykosAI/StabilityMatrix","slug":"name-is-required","errorCode":null,"errorMessage":"Name is required","messagePattern":"Name is required","errorType":"validation","errorClass":"DataValidationException","httpStatus":null,"severity":"warning","filePath":"StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageExtensionBrowserViewModel.cs","lineNumber":841,"sourceCode":"\n        foreach (var item in SelectedInstalledItems.ToImmutableArray())\n            item.IsSelected = false;\n\n        foreach (var item in SelectedExtensionPackExtensions.ToImmutableArray())\n            item.IsSelected = false;\n    }\n\n    private (BetterContentDialog dialog, TextBoxField nameField) GetNameEntryDialog()\n    {\n        var textFields = new TextBoxField[]\n        {\n            new()\n            {\n                Label = \"Name\",\n                Validator = text =>\n                {\n                    if (string.IsNullOrWhiteSpace(text))\n                        throw new DataValidationException(\"Name is required\");\n\n                    if (ExtensionPacks.Any(pack => pack.Name == text))\n                        throw new DataValidationException(\"Pack already exists\");\n                },\n            },\n        };\n\n        return (DialogHelper.CreateTextEntryDialog(\"Pack Name\", \"\", textFields), textFields[0]);\n    }\n\n    private async Task<bool> BeforeInstallCheck()\n    {\n        if (\n            !settingsManager.Settings.SeenTeachingTips.Contains(\n                Core.Models.Settings.TeachingTip.PackageExtensionsInstallNotice\n            )\n        )\n        {","sourceCodeStart":823,"sourceCodeEnd":859,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageExtensionBrowserViewModel.cs#L823-L859","documentation":"The 'Create Extension Pack' dialog's Name field validator throws DataValidationException('Name is required') when the entered pack name is null or whitespace. It guarantees every extension pack gets a non-empty identifier before creation.","triggerScenarios":"Confirming the Pack Name text-entry dialog with an empty or whitespace-only Name field.","commonSituations":"User clicks OK immediately after the dialog opens without typing a name; clipboard paste of whitespace.","solutions":["Type a non-empty name for the extension pack before confirming.","If scripting, ensure the name argument passed to the dialog is trimmed and non-empty."],"exampleFix":"// before\nif (string.IsNullOrWhiteSpace(text)) throw new DataValidationException(\"Name is required\");\n// after\nvar name = text?.Trim();\nif (string.IsNullOrEmpty(name)) throw new DataValidationException(\"Name is required\");","handlingStrategy":"validation","validationCode":"var name = promptText?.Trim();\nif (string.IsNullOrEmpty(name)) return; // do not submit","typeGuard":"bool HasName(string? s) => !string.IsNullOrWhiteSpace(s);","tryCatchPattern":"try { await ShowCreatePackDialog(); }\ncatch (DataValidationException ex) { SetFieldError(ex.Message); }","preventionTips":["Type the pack name before clicking OK; check the field is non-empty.","Keep the OK button disabled while the name field is blank.","Trim input to distinguish whitespace-only entries from real names."],"tags":["validation","input","dialog"],"backgroundTag":"empty-required-field","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}