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

+34 -1
View File
@@ -108,6 +108,24 @@ func (s *Server) handleUserProfile(w http.ResponseWriter, r *http.Request) {
return
}
action := r.FormValue("action")
if action == "contact" {
version, err := strconv.ParseInt(r.FormValue("contact_version"), 10, 64)
if err != nil {
http.Error(w, "invalid contact version", http.StatusBadRequest)
return
}
err = s.store.SaveProfileContact(r.Context(), domainUUID, current.UUID, store.ProfileContact{PhoneDisplay: r.FormValue("phone"), Visibility: r.FormValue("contact_visibility"), Version: version}, r.FormValue("contact_confirm_public") == "on")
if err != nil {
status := http.StatusBadRequest
if errors.Is(err, store.ErrGovernanceConflict) {
status = http.StatusConflict
}
http.Error(w, translate(s.getLocale(domainUUID), err.Error()), status)
return
}
http.Redirect(w, r, "/u/"+url.PathEscape(profile.Username)+"/_/edit?contact=saved#contact", http.StatusSeeOther)
return
}
if action == "visibility" {
version, parseErr := strconv.ParseInt(r.FormValue("visibility_version"), 10, 64)
if parseErr != nil {
@@ -235,7 +253,22 @@ func (s *Server) handleUserProfile(w http.ResponseWriter, r *http.Request) {
if editing {
userPages, _ = s.store.ListUserSpacePages(r.Context(), domainUUID, profile.UUID, 512)
}
s.renderWithContext(w, r, "profile.gohtml", map[string]any{"Principal": profile, "Editing": editing, "Saved": r.URL.Query().Get("saved") == "1", "VisibilitySaved": r.URL.Query().Get("visibility") == "saved", "Handle": profile.Username + "@" + profileHost(r), "RenderedHTML": template.HTML(rendered), "TOTPEnabled": totpEnabled, "TOTPSecret": pendingSecret, "TOTPUri": store.TOTPURI(pendingSecret, profile.Username, s.getWikiName(domainUUID)), "TOTPStatus": r.URL.Query().Get("totp"), "UserSpacePolicy": visibility, "UserSpacePages": userPages, "Locale": s.getLocale(domainUUID)})
contact, contactErr := s.store.ProfileContactForViewer(r.Context(), domainUUID, profile.UUID, viewer.UUID)
if contactErr != nil {
http.Error(w, "contact unavailable", http.StatusServiceUnavailable)
return
}
w.Header().Set("Cache-Control", "private, no-store")
s.renderWithContext(w, r, "profile.gohtml", map[string]any{"Principal": profile, "Editing": editing, "Saved": r.URL.Query().Get("saved") == "1", "VisibilitySaved": r.URL.Query().Get("visibility") == "saved", "Handle": profile.Username + "@" + profileHost(r), "RenderedHTML": template.HTML(rendered), "TOTPEnabled": totpEnabled, "TOTPSecret": pendingSecret, "TOTPUri": store.TOTPURI(pendingSecret, profile.Username, s.getWikiName(domainUUID)), "TOTPStatus": r.URL.Query().Get("totp"), "UserSpacePolicy": visibility, "UserSpacePages": userPages, "Contact": contact, "ContactHref": profileContactHref(contact), "ContactSaved": r.URL.Query().Get("contact") == "saved", "Locale": s.getLocale(domainUUID)})
}
func profileContactHref(contact store.ProfileContact) template.URL {
_, number, err := store.NormalizeContactPhone(contact.PhoneNumber)
if err != nil || number == "" {
return ""
}
// Only digits and an optional leading '+' survive validation above.
return template.URL("tel:" + number)
}
func (s *Server) serveProfileAvatar(w http.ResponseWriter, r *http.Request, principalUUID string) {