From de0d9a175435e2b991452d76970a34db0fbd9a22 Mon Sep 17 00:00:00 2001 From: NeilClack Date: Tue, 7 Apr 2026 09:43:49 -0500 Subject: [PATCH] Remove unused method --- internal/page/proclamationOptions.go | 49 ---------------------------- 1 file changed, 49 deletions(-) diff --git a/internal/page/proclamationOptions.go b/internal/page/proclamationOptions.go index 1dd5e09..6719c0b 100644 --- a/internal/page/proclamationOptions.go +++ b/internal/page/proclamationOptions.go @@ -144,55 +144,6 @@ func (p *ProclamationOptions) Init(ctx *PageCtx) error { return nil } -// expandAndCollectProcs is like expand() but also populates SearchText and allProclamations. -// Used only during Init to build the initial fully-expanded tree. -func (p *ProclamationOptions) expandAndCollectProcs(index int, procContentMap map[string]string) { - parent := p.allItems[index] - parentID, _ := strconv.Atoi(parent.ID) - var newItems []*FlatItem - - var cats []db.ProclamationCategory - p.Context.DbPtr.Where("parent_id = ?", parentID).Find(&cats) - for _, c := range cats { - fi := p.createFlatItem(c.Name, fmt.Sprint(c.ID), true, parent.Depth+1) - fi.Expanded = true - newItems = append(newItems, fi) - } - - var procs []db.Proclamation - p.Context.DbPtr.Where("category_id = ?", parentID).Find(&procs) - for _, pr := range procs { - fi := p.createFlatItem(pr.Name, pr.ID, false, parent.Depth+1) - fi.SearchText = strings.ToLower(pr.Name + " " + pr.Content) - newItems = append(newItems, fi) - } - - tail := append([]*FlatItem{}, p.allItems[index+1:]...) - p.allItems = append(p.allItems[:index+1], append(newItems, tail...)...) - - // Recurse into subcategories and collect their proclamations too - i := index + 1 - for i < len(p.allItems) && p.allItems[i].Depth > parent.Depth { - item := p.allItems[i] - if item.IsCategory { - p.expandAndCollectProcs(i, procContentMap) - } else { - // It's a leaf — add to pool if not already present - alreadyIn := false - for _, existing := range p.allProclamations { - if existing.ID == item.ID { - alreadyIn = true - break - } - } - if !alreadyIn { - p.allProclamations = append(p.allProclamations, item) - } - } - i++ - } -} - func (p *ProclamationOptions) createFlatItem(name, id string, isCat bool, depth int) *FlatItem { text := name if isCat && depth == 0 {