Make group navigation controller-driven

This commit is contained in:
Joe Julian
2026-03-29 11:21:38 -07:00
parent 484448b51c
commit 43fc278fd1
6 changed files with 191 additions and 60 deletions
+24
View File
@@ -597,6 +597,30 @@ func (s *State) MoveSelectedEntry(path []string) error {
return nil
}
func (s *State) DeleteCurrentGroup() error {
session, ok := s.Session.(MutableSession)
if !ok {
return fmt.Errorf("session is not mutable")
}
model, err := session.Current()
if err != nil {
return err
}
if err := model.DeleteGroup(s.CurrentPath); err != nil {
return err
}
session.Replace(model)
if len(s.CurrentPath) > 0 {
s.CurrentPath = append([]string(nil), s.CurrentPath[:len(s.CurrentPath)-1]...)
}
s.SelectedEntryID = ""
s.Dirty = true
return nil
}
func (s *State) AddAttachmentToSelectedEntry(name string, content []byte) error {
session, ok := s.Session.(MutableSession)
if !ok {