Redesign "settings" and "admin" #8

Closed
opened 2026-06-20 01:17:42 +00:00 by rbrooks · 2 comments
Owner

The Settings page vs Admin page are confusing; there are many settings in "Settings" that feel like they should be in "Admin" instead. Consolidate and determine if both are needed; user settings should go to a user's profile settings page.

The Settings page vs Admin page are confusing; there are many settings in "Settings" that feel like they should be in "Admin" instead. Consolidate and determine if both are needed; user settings should go to a user's profile settings page.
rbrooks self-assigned this 2026-06-20 01:17:42 +00:00
Author
Owner

Plan — Settings / Admin / Profile redesign

Current inventory

  • Settings (one ~1,300-line component, shared settings object + per-section save handlers): General, Projects, Project templates, AI, AI tools, Search, Media, Email (SMTP), Backup, Integrations, Federation, Tags, Categories, Export
  • Admin (admin-only): Version & updates, Storage quotas, Users, Audit Log
  • Profile (per-user): Identity, Storage, Bio, Social links, Federation opt-out

Target structure (decided)

  • Admin (instance config, admin-only) — move from Settings: AI, AI tools, Search (similarity threshold), Media, Email (SMTP), Backup, Federation kill-switch (activitypub.enabled), plus the existing Version / Storage quotas / Users / Audit Log.
  • Settings (workspace, all users) — keep: Projects, Project templates, Tags, Categories, Export, Integrations (API tokens + webhooks). Rename heading to "Workspace" if it reads better.
  • Profile (per-user) — add: General/appearance (site.displayName is instance → stays in Admin; the user-level appearance/theme bits move here) and keep the existing federation opt-out beside Identity/Bio/Social/Storage.

Implementation approach (avoids duplicating the save machinery)

  1. Extract app/src/hooks/useSettings.ts — encapsulates the GET /api/settings fetch, loading/error, and a generic saveKeys(partial: Record<string,string>) returning a SaveState. Both pages consume it.
  2. Extract each config section into app/src/components/settings/<Name>Settings.tsx (Ai, AiTools, Search, Media, Smtp, Backup, Federation), each self-contained on useSettings() + its own draft state. The Field / SectionHeading / inputCls helpers move to a shared components/settings/primitives.tsx.
  3. Mount the instance-config components in AdminPage; leave the workspace components in SettingsPage. Move appearance to ProfilePage.
  4. The instance-config endpoints are already admin-gated at the API layer for writes? Verify PUT /api/settings authorization — if it's currently any-authenticated, gate the instance keys to admins (or confirm requireAdmin covers them) so the IA change matches the security model.

Verification (no local Node — use the dev server)

  • ssh ai-dev-server, worktree off the branch, npm ci + npm run build (app tsc+vite) + npm test for both packages. Test DB/Redis on 5434/6381; docker exec tealeaves-redis-test-1 redis-cli FLUSHALL if 429s cascade.
  • One PR, CI green, merge, deploy, then this closes and v6.2.0 is ready to cut (categories #6 + data viz #7 already merged & deployed).

State tonight

main is clean and deployed at the post-#7 commit. #6 and #7 are done. This is the only remaining v6.2 issue.

🤖 Tracked by Claude Code

## Plan — Settings / Admin / Profile redesign ### Current inventory - **Settings** (one ~1,300-line component, shared `settings` object + per-section save handlers): General, Projects, Project templates, AI, AI tools, Search, Media, Email (SMTP), Backup, Integrations, Federation, Tags, Categories, Export - **Admin** (admin-only): Version & updates, Storage quotas, Users, Audit Log - **Profile** (per-user): Identity, Storage, Bio, Social links, Federation opt-out ### Target structure (decided) - **Admin** (instance config, admin-only) — move from Settings: **AI**, **AI tools**, **Search** (similarity threshold), **Media**, **Email (SMTP)**, **Backup**, **Federation kill-switch** (`activitypub.enabled`), plus the existing Version / Storage quotas / Users / Audit Log. - **Settings** (workspace, all users) — keep: **Projects**, **Project templates**, **Tags**, **Categories**, **Export**, **Integrations** (API tokens + webhooks). Rename heading to "Workspace" if it reads better. - **Profile** (per-user) — add: **General/appearance** (`site.displayName` is instance → stays in Admin; the user-level appearance/theme bits move here) and keep the existing federation opt-out beside Identity/Bio/Social/Storage. ### Implementation approach (avoids duplicating the save machinery) 1. **Extract `app/src/hooks/useSettings.ts`** — encapsulates the `GET /api/settings` fetch, loading/error, and a generic `saveKeys(partial: Record<string,string>)` returning a `SaveState`. Both pages consume it. 2. **Extract each config section into `app/src/components/settings/<Name>Settings.tsx`** (Ai, AiTools, Search, Media, Smtp, Backup, Federation), each self-contained on `useSettings()` + its own draft state. The `Field` / `SectionHeading` / `inputCls` helpers move to a shared `components/settings/primitives.tsx`. 3. **Mount** the instance-config components in `AdminPage`; leave the workspace components in `SettingsPage`. Move appearance to `ProfilePage`. 4. The instance-config endpoints are already admin-gated at the API layer for writes? **Verify** `PUT /api/settings` authorization — if it's currently any-authenticated, gate the instance keys to admins (or confirm `requireAdmin` covers them) so the IA change matches the security model. ### Verification (no local Node — use the dev server) - `ssh ai-dev-server`, worktree off the branch, `npm ci` + `npm run build` (app tsc+vite) + `npm test` for both packages. Test DB/Redis on 5434/6381; `docker exec tealeaves-redis-test-1 redis-cli FLUSHALL` if 429s cascade. - One PR, CI green, merge, deploy, then this closes and **v6.2.0** is ready to cut (categories #6 + data viz #7 already merged & deployed). ### State tonight `main` is clean and deployed at the post-#7 commit. #6 and #7 are done. This is the only remaining v6.2 issue. 🤖 Tracked by Claude Code
rbrooks referenced this issue from a commit 2026-06-29 17:48:48 +00:00
Contributor

Shipped in v6.2.0 (PR #58). Settings is now workspace-only (Projects, Project templates, Tags, Categories, Integrations, Export); instance config (AI, AI tools, Search, Media, SMTP, Backup, Federation kill-switch) moved to the admin-only Admin page, and /api/settings is now requireAdmin-gated. Profile was left unchanged — the only "appearance" control is the theme toggle, which is useTheme/localStorage, not a settings-table key.

Verified on dev (npm run build + 63 app / 175 API tests green) and deployed to dev (:18090) and prod (:8055) — both healthy. This was the last open issue in the v6.2 milestone (all three of #6/#7/#8 now closed); milestone ready to close.

Shipped in **v6.2.0** (PR #58). Settings is now workspace-only (Projects, Project templates, Tags, Categories, Integrations, Export); instance config (AI, AI tools, Search, Media, SMTP, Backup, Federation kill-switch) moved to the admin-only Admin page, and `/api/settings` is now `requireAdmin`-gated. Profile was left unchanged — the only "appearance" control is the theme toggle, which is `useTheme`/localStorage, not a settings-table key. Verified on dev (`npm run build` + 63 app / 175 API tests green) and deployed to **dev** (:18090) and **prod** (:8055) — both healthy. This was the last open issue in the **v6.2** milestone (all three of #6/#7/#8 now closed); milestone ready to close.
Sign in to join this conversation.
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rbrooks/TeaLeaves#8
No description provided.