Feat v0.6.17 bug fixes & welcome logic (#52)
Some checks failed
CI/CD / test-frontend (pull_request) Has been cancelled
CI/CD / test-sqlite (pull_request) Has been cancelled
CI/CD / test-go-pg (pull_request) Has been cancelled
CI/CD / build-and-deploy (pull_request) Has been cancelled
CI/CD / detect-changes (pull_request) Has been cancelled
Some checks failed
CI/CD / test-frontend (pull_request) Has been cancelled
CI/CD / test-sqlite (pull_request) Has been cancelled
CI/CD / test-go-pg (pull_request) Has been cancelled
CI/CD / build-and-deploy (pull_request) Has been cancelled
CI/CD / detect-changes (pull_request) Has been cancelled
Fix broken folder creation (sw.prompt), team member add (envelope unwrap), dropdown overflow (min-width:max-content), welcome auto-disable when surfaces installed, zero default bundled packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -747,6 +747,10 @@ func (h *PackageHandler) ListEnabledSurfaces(c *gin.Context) {
|
||||
if p.Type != "surface" && p.Type != "full" {
|
||||
continue
|
||||
}
|
||||
// Welcome is a fallback surface, not a navigable destination
|
||||
if p.ID == "welcome" {
|
||||
continue
|
||||
}
|
||||
route, _ := p.Manifest["route"].(string)
|
||||
icon, _ := p.Manifest["icon"].(string)
|
||||
enabled = append(enabled, navSurface{
|
||||
|
||||
@@ -22,18 +22,12 @@ import (
|
||||
"armature/triggers"
|
||||
)
|
||||
|
||||
// defaultBundledPackages is the curated set of packages installed by default.
|
||||
// Other packages still ship in the Docker image but require BUNDLED_PACKAGES
|
||||
// to be set explicitly (or "*" for all).
|
||||
//
|
||||
// Recommended production override: BUNDLED_PACKAGES=notes,chat,chat-core,mermaid-renderer,schedules
|
||||
var defaultBundledPackages = map[string]bool{
|
||||
"notes": true,
|
||||
"chat": true,
|
||||
"chat-core": true,
|
||||
"mermaid-renderer": true,
|
||||
"schedules": true,
|
||||
}
|
||||
// defaultBundledPackages is empty — fresh installs start bare.
|
||||
// Use BUNDLED_PACKAGES env var to control what gets installed per environment:
|
||||
// dev: BUNDLED_PACKAGES=*
|
||||
// test: BUNDLED_PACKAGES=notes,chat,chat-core
|
||||
// prod: BUNDLED_PACKAGES=notes,chat,chat-core,mermaid-renderer,schedules
|
||||
var defaultBundledPackages = map[string]bool{}
|
||||
|
||||
// InstallBundledPackages scans bundledDir for .pkg archives and installs
|
||||
// any that don't already exist in the database. Called once at startup
|
||||
@@ -74,7 +68,8 @@ func InstallBundledPackages(bundledDir, packagesDir, allowlist string, stores st
|
||||
}
|
||||
|
||||
// Check allowlist by filename (strip .pkg extension = package ID)
|
||||
if len(allowed) > 0 {
|
||||
// nil = install all ("*"), empty map = install nothing (empty default set)
|
||||
if allowed != nil {
|
||||
pkgName := strings.TrimSuffix(entry.Name(), ".pkg")
|
||||
if !allowed[pkgName] {
|
||||
filtered++
|
||||
|
||||
@@ -494,6 +494,10 @@ func (e *Engine) RegisterPageRoutes(base *gin.RouterGroup, mw PageRouteMiddlewar
|
||||
continue
|
||||
}
|
||||
handler := e.RenderSurface(s.ID)
|
||||
// Welcome auto-redirects to / when extension surfaces exist
|
||||
if s.ID == "welcome" {
|
||||
handler = e.welcomeRedirectIfSurfaces(handler)
|
||||
}
|
||||
registerRoutes(group, s, handler)
|
||||
}
|
||||
|
||||
|
||||
@@ -176,6 +176,28 @@ func (e *Engine) surfacePath(ctx context.Context, id string) string {
|
||||
return "/s/" + id
|
||||
}
|
||||
|
||||
// welcomeRedirectIfSurfaces wraps a welcome surface handler so that
|
||||
// /welcome auto-redirects to / when any extension surface is installed.
|
||||
// This means the welcome page only renders for truly empty deployments.
|
||||
func (e *Engine) welcomeRedirectIfSurfaces(inner gin.HandlerFunc) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
if e.stores.Packages != nil {
|
||||
if pkgs, err := e.stores.Packages.List(c.Request.Context()); err == nil {
|
||||
for _, p := range pkgs {
|
||||
if p.Source == "core" || !p.Enabled {
|
||||
continue
|
||||
}
|
||||
if p.Type == "surface" || p.Type == "full" {
|
||||
c.Redirect(http.StatusTemporaryRedirect, e.cfg.BasePath+"/")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
inner(c)
|
||||
}
|
||||
}
|
||||
|
||||
// disabledRedirect returns a handler that redirects to /.
|
||||
// The DefaultSurfaceRedirect handler will resolve to the appropriate surface.
|
||||
func (e *Engine) disabledRedirect() gin.HandlerFunc {
|
||||
|
||||
Reference in New Issue
Block a user