Refactor architecture into eight components and consolidate reliability work
Build and publish container images / images (push) Successful in 9m34s
Release container images / release (push) Successful in 36s

Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts.

Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation.

Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
This commit is contained in:
Anya Tokugawa committed 2026-11-01 15:23:31 +09:00
1 parent 9dd425f765
commit d5d21b7841
302 files changed
+20037 -3492

No files matched your search

+24 -4
View File
@@ -1,9 +1,13 @@
package server
import (
"context"
"encoding/json"
"net/http"
"strings"
"time"
"pageswiki/internal/store"
)
type pathPickerEntry struct {
@@ -31,13 +35,13 @@ func (s *Server) handlePathPickerAPI(w http.ResponseWriter, r *http.Request) {
}
mode := strings.TrimSpace(r.URL.Query().Get("mode"))
switch mode {
case "", "any", "file", "folder", "image", "image-or-folder":
case "", "any", "file", "folder", "image", "image-or-folder", "children":
default:
http.Error(w, "invalid picker mode", http.StatusBadRequest)
return
}
selected := ""
if mode != "folder" && current != "/" {
if mode != "folder" && mode != "children" && current != "/" {
if objectUUID, resolveErr := s.store.ResolvePathInDomain(s.domainUUIDForRequest(r), current); resolveErr == nil {
if revision, revisionErr := s.latestRevisionMetadataForRequest(r, objectUUID); revisionErr == nil && (mode == "" || mode == "any" || mode == "file" || imageContentType(revision.ContentType)) {
selected = current
@@ -45,14 +49,30 @@ func (s *Server) handlePathPickerAPI(w http.ResponseWriter, r *http.Request) {
}
}
}
entries, err := s.store.ListBrowserEntriesInDomain(s.domainUUIDForRequest(r), current)
prefix := r.URL.Query().Get("prefix")
if len(prefix) > 1024 {
http.Error(w, "prefix too long", http.StatusBadRequest)
return
}
var entries []store.BrowserEntry
var err error
truncated := false
if mode == "children" {
ctx, cancel := context.WithTimeout(r.Context(), 2*time.Second)
defer cancel()
entries, truncated, err = s.store.ListPathCompletionNames(ctx, s.domainUUIDForRequest(r), current, prefix)
} else {
entries, err = s.store.ListBrowserEntriesInDomain(s.domainUUIDForRequest(r), current)
}
if err != nil {
http.Error(w, "path listing unavailable", http.StatusInternalServerError)
return
}
result := make([]pathPickerEntry, 0, min(len(entries), 250))
truncated := false
for _, entry := range entries {
if prefix != "" && !strings.HasPrefix(strings.ToLower(entry.Name), strings.ToLower(prefix)) {
continue
}
if !s.requestCanReadPath(r, entry.Path) {
continue
}