Improve group deletion and status banner UX

This commit is contained in:
Joe Julian
2026-03-29 16:17:22 -07:00
parent fe3fa854bb
commit 1c4fb59960
4 changed files with 236 additions and 10 deletions
+8
View File
@@ -180,17 +180,25 @@ func (u *ui) deleteSelectedTemplateAction() error {
}
func (u *ui) createGroupAction() error {
u.clearDeleteGroupConfirmation()
return u.state.CreateGroup(strings.TrimSpace(u.groupName.Text()))
}
func (u *ui) renameGroupAction() error {
u.clearDeleteGroupConfirmation()
return u.state.RenameCurrentGroup(strings.TrimSpace(u.groupName.Text()))
}
func (u *ui) deleteCurrentGroupAction() error {
if !u.deleteGroupPendingConfirmation() {
return fmt.Errorf("confirm deleting the empty group first")
}
if err := u.state.DeleteCurrentGroup(); err != nil {
return err
}
u.clearDeleteGroupConfirmation()
u.currentPath = append([]string(nil), u.state.CurrentPath...)
u.syncedPath = append([]string(nil), u.state.CurrentPath...)
u.filter()
return nil
}