{"record":{"id":"8c349781747486a5","repo":"qishibo/AnotherRedisDesktopManager","slug":"this-t-message-group-name-required-8c3497","errorCode":null,"errorMessage":"this.$t('message.group_name_required')","messagePattern":"this\\.\\$t\\('message\\.group_name_required'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/NewConnectionDialog.vue","lineNumber":320,"sourceCode":"    dialogVisible(visible) {\n      if (!visible) {\n        this.finishTest();\n      }\n    },\n  },\n  methods: {\n    loadGroups() {\n      this.groups = storage.getGroups();\n    },\n    openNewGroupDialog() {\n      this.newGroupName = '';\n      this.showGroupDialog = true;\n    },\n    handleNewGroup() {\n      const name = this.newGroupName.trim();\n\n      if (!name) {\n        return this.$message.error(this.$t('message.group_name_required'));\n      }\n\n      const group = storage.addGroup(name);\n\n      if (!group) {\n        return this.$message.error(this.$t('message.group_exists'));\n      }\n\n      this.loadGroups();\n      this.connection.groupId = group.id;\n\n      this.showGroupDialog = false;\n      this.$message.success(this.$t('message.add_success'));\n      this.$bus.$emit('groups-updated');\n    },\n    show() {\n      this.dialogVisible = true;\n      this.resetFields();","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/components/NewConnectionDialog.vue#L302-L338","documentation":"Element UI error toast raised in handleNewGroup when the new group name is empty after trim(); storage.addGroup is never called. Connection groups are purely client-side records in localStorage ('connection_groups' via src/storage.js), so this is local form validation, not a server error.","triggerScenarios":"Opening the new-group dialog (openNewGroupDialog clears newGroupName to '') and clicking Confirm while the input is empty or whitespace-only: const name = this.newGroupName.trim(); if (!name) -> toast and return.","commonSituations":"Clicking Confirm before typing, pasting a whitespace-only string, double-submitting the dialog, or IME/keyboard states that leave the field visually non-empty but logically blank.","solutions":["Type a non-empty (non-whitespace) group name and confirm again","Disable the Confirm button while the trimmed input is empty so the error path is unreachable","Trim the model on @input so stray spaces never reach the submit handler"],"exampleFix":"// before (NewConnectionDialog.vue)\n<el-button type=\"primary\" @click=\"handleNewGroup\">OK</el-button>\n\n// after\n<el-button type=\"primary\" :disabled=\"!newGroupName.trim()\" @click=\"handleNewGroup\">OK</el-button>","handlingStrategy":"validation","validationCode":"// before submit\nconst name = this.newGroupName.trim();\nif (!name) {\n  this.$message.warning(this.$t('message.group_name_required'));\n  return;\n}\n// or bind the confirm button: :disabled=\"!newGroupName.trim()\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Trim user input at the model level (@input) so whitespace never reaches submit","Disable confirm buttons on empty models - validation errors then become unreachable","Treat this toast as a hint, not a failure: nothing was written"],"tags":["vue","element-ui","form-validation","ardm","localstorage"],"backgroundTag":"required-field-validation","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}