Changeset 0.37.19 (#232)

Co-authored-by: gobha <jasafpro@gmail.com>
Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
2026-03-25 00:26:44 +00:00
committed by xcaliber
parent 54ceeb4299
commit be67feaa8e
21 changed files with 173 additions and 88 deletions

View File

@@ -312,6 +312,7 @@ func (h *ChannelHandler) CreateChannel(c *gin.Context) {
if err := h.stores.Channels.CreateFull(ctx, ch, req.Folder, req.Tags, aiMode,
userID, dmPartners, req.Model, defaultConfigID); err != nil {
log.Printf("[channels] CreateFull error: %v", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to create channel"})
return
}

View File

@@ -108,13 +108,9 @@ type NotesPageData struct {
}
// SettingsPageData is what the settings surface templates receive.
// Feature gates (BYOK, personas) moved to sw.auth.policies in v0.37.19.
type SettingsPageData struct {
Section string `json:"section"`
// v0.22.7: Feature gates from admin config.
// These control which nav links/tabs are visible in the settings surface.
BYOKEnabled bool `json:"BYOKEnabled"`
UserPersonasEnabled bool `json:"UserPersonasEnabled"`
}
// ── Loader registration ──────────────────────
@@ -422,20 +418,7 @@ func (e *Engine) settingsLoader(c *gin.Context, s store.Stores) (any, error) {
section = "general"
}
data := &SettingsPageData{Section: section}
// Read feature gates from policies (where admin settings saves them).
// Keys: allow_user_byok, allow_user_personas
if s.Policies != nil {
ctx := context.Background()
policies, err := s.Policies.GetAll(ctx)
if err == nil {
data.BYOKEnabled = policies["allow_user_byok"] == "true"
data.UserPersonasEnabled = policies["allow_user_personas"] == "true"
}
}
return data, nil
return &SettingsPageData{Section: section}, nil
}
func (e *Engine) projectsLoader(c *gin.Context, s store.Stores) (any, error) {

View File

@@ -121,8 +121,8 @@
window.__ENV__ = '{{.Environment}}';
window.__BRANDING__ = {};
window.__SURFACE__ = '{{.Surface}}';
window.__PAGE_DATA__ = {{.Data | toJSON}};
window.__USER__ = {{.User | toJSON}};
{{/* __PAGE_DATA__ and __USER__ removed in v0.37.19 — SDK boot
populates sw.auth.user and sw.auth.policies from API. */}}
{{if .Manifest}}window.__MANIFEST__ = {{.Manifest | toJSON}};{{end}}
</script>