Implement Knowledge City platform, organizer and DAV integration

Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming.

Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
This commit is contained in:
Anya Tokugawa committed 2026-09-27 14:44:43 +09:00
1 parent 288e6e94ac
commit c1175d389f
699 files changed
+110197 -4117

No files matched your search

+30 -24
View File
@@ -2,12 +2,12 @@ package server
import (
"net/http"
"path"
"strings"
"pageswiki/internal/store"
)
type TreeViewNode struct {
Href string
Name string
Path string
Depth int
@@ -21,8 +21,8 @@ func (s *Server) handleTree(
r *http.Request,
) {
tree, err :=
s.store.BuildPathTree()
rootPath := path.Clean("/" + strings.TrimPrefix(r.URL.Path, "/v/tree"))
readable, err := s.readableNavigation(r)
if err != nil {
@@ -35,44 +35,50 @@ func (s *Server) handleTree(
return
}
var flattened []store.FlatTreeNode
store.FlattenTree(
tree,
0,
&flattened,
)
var nodes []TreeViewNode
for _, n := range flattened {
visible := []publicTreeNode{}
for _, n := range publicTreeNodes(readable, rootPath) {
if n.Path != "/u" && !strings.HasPrefix(n.Path, "/u/") {
visible = append(visible, n)
}
}
visibleChildren := make(map[string]int)
for _, n := range visible {
if n.Path != "/" {
visibleChildren[parentPath(n.Path)]++
}
}
for _, n := range visible {
nodes = append(
nodes,
TreeViewNode{
Href: n.Href,
Name: n.Name,
Path: n.FullPath,
Depth: n.Depth,
IsDir: n.IsDir,
ChildCount: n.ChildCount,
Path: n.Path,
Depth: n.Depth + 1,
IsDir: n.IsDir || visibleChildren[n.Path] > 0,
ChildCount: visibleChildren[n.Path],
IsDraft: strings.HasPrefix(
n.FullPath,
n.Path,
"/draft/",
),
},
)
}
s.render(
s.renderWithContext(
w,
r,
"tree.gohtml",
map[string]any{
"NavItems": resolveNavItems(
s.getSystemNavItems(),
NavContext{},
s.getSystemNavItems(s.domainUUIDForRequest(r)),
NavContext{Path: rootPath},
),
"Nodes": nodes,
"Nodes": nodes,
"Path": rootPath,
"Breadcrumbs": buildBreadcrumbs(rootPath),
},
)
}