feat: split Settings (workspace) from Admin (instance config) (#8) #58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/v6.2-settings-admin-redesign"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #8. Last open issue in the v6.2 milestone.
Problem
The single ~1,300-line Settings page mixed per-workspace controls (projects, tags, categories, export) with server-wide instance configuration (AI, SMTP, backup, etc.), blurring the line with the admin-only Admin page. And
PUT /api/settingswas writable by any authenticated user even though every key is instance config.Changes
Instance config → Admin (admin-only). AI, AI tools, Search (similarity threshold), Media, Email (SMTP), Backup, and the Federation kill-switch now live on the Admin page alongside Version / Storage quotas / Users / Audit Log.
Extraction (no duplicated save machinery). Each config section became a self-contained component under
app/src/components/settings/(GeneralSettings,AiSettings,AiToolsSettings,SearchSettings,MediaSettings,SmtpSettings,FederationSettings) built on sharedField/SectionHeading/SaveButtonprimitives + a newuseSettings()hook that owns theGET/PUT /api/settingsfetch + optimistic merge (incl. sensitive-key masking). AdminPage loads settings once and passes them down.Settings → workspace-only. Keeps Projects, Project templates, Tags, Categories, Integrations (API tokens + Stash webhook), Export.
API gating.
app.use('/api/settings', requireAdmin, settingsRouter)— non-admins now get403on read/write andtest-email.requireAuthstill runs first, so an unauthenticated request is401as before.Profile: no change — the redesign plan mentioned moving "appearance" to Profile, but theme is handled by
useTheme/localStorage (a Shell toggle), not a settings-table key, so there was nothing settings-backed to move.Verification (dev server)
app:npm run build(tsc + vite) ✓,npm test→ 63/63 ✓api:npm test→ 175/175 ✓ (added a non-admin403case tosettings.test.ts; promoted its agent to admin likeadmin.test.ts)No migration.
🤖 Generated with Claude Code