# Conflicts: # CLAUDE.md # backend/settings/routes.py # backend/telemetry/features.json # frontend/openapi.json # frontend/src/api.ts # frontend/src/business/settings/lazy.tsx # frontend/src/business/settings/redirects.test.tsx # frontend/src/business/settings/redirects.tsx # frontend/src/business/settings/registry.test.ts # frontend/src/business/settings/rows.test.ts # frontend/src/business/settings/rows.ts # frontend/src/generated/api.ts # frontend/src/lib/queries.ts # frontend/src/lib/telemetry/features.ts # frontend/src/root.tsx
13 KiB
Settings — one registry, filtered by permission
Since 2026-11-23. Decisions: the homelab's
data/log/2026-11-23-ai-agent-settings-reorg.md → "Revision 2" (groups, the
role table; entries a role lacks are hidden; search covers pages and
rows; Cmd+K has a Settings section; one Settings for everyone). Related:
permissions.md.
The single source
frontend/src/business/settings/registry.ts lists every Settings destination
once — { id, group, label, hint, short?, icon, to, match[], perm | anyPerm[] | allPerms[], unless?, when?, operator?, variants?, desktopOnly?, keywords[], bar? } — in
five groups: You, Your logins & tools, Workspace, People &
security, This machine. Everything else reads it, filtered by what the
caller holds (me.perms from /api/me, business/users/access.ts):
| reader | file |
|---|---|
| the left panel (one for everyone; search box, groups) | business/settings/components/SettingsPanel.tsx |
| the bottom bar's drawers (owner: Settings tab; others: Me = You, Settings = the rest) | business/composer/components/BottomBar.tsx |
SUB_SECTIONS.settings / navKeyOf |
nav.ts |
| the command palette's Settings section (pages + rows) | business/keyboard/components/CommandPalette.tsx |
the routes' guard (RequiresSettings: the entry owning the path names the permission) |
business/users/guards.tsx, root.tsx |
A group with no visible entry disappears. While /api/me loads or fails
everything is allowed (the owner never waits; an older backend mid-deploy
can't lock the admin out) — the guards render, like OwnerOnly.
Variants: one page, drawn per caller
An entry with variants is the same page for different people — the
operator's whole set, or a person's own. The first variant the caller fits
(its perm / anyPerm / allPerms, minus unless, plus when) decides the
label, short, hint, icon, keywords, group and at (listed just before that
entry of its group), and the page's scope: settingsScope(id, access) /
useSettingsScope(id) (business/settings/useScope.tsx) → "hub", "mine" or
null. The page reads the scope and draws the same components on the API that
caller has; the guard lets in whoever fits any variant. While /api/me is
pending the hook returns undefined and the page shows ScopeLoading (a guest
must not mount the operator's variant and fire its 403s); when /api/me
fails the scope is "hub", like useIsOwner — the operator is never locked
out. A variant's listed only hides the entry (the scope and guard ignore it).
entry (id) |
hub — the operator |
mine — a person |
|---|---|---|
profiles |
Machines (This machine), workers.read + accounts.manage |
My computers (Your logins & tools), self, not workers.manage; listed with computers.pair or runs.start |
accounts |
Logins (This machine), accounts.manage |
My logins (Your logins & tools, first), self.claude, not accounts.manage |
The ids stay profiles / accounts so saved panel and drawer orders keep
their place; a person's old computers key maps to profiles (RENAMED in
SettingsPanel.tsx, GUEST_RENAMED in BottomBar.tsx).
Who sees what
| Role | You | Your logins & tools | Workspace | People & security | This machine |
|---|---|---|---|---|---|
| Operator | all | plugin pages only (their own variants elsewhere) | all | all | Machines (+ People's computers), Logins |
| Admin (team mode) | all | My logins, Budget, Jobs, My computers, Projects | all | all | – |
| Member | all | My logins, Budget, Jobs, My computers, Projects | – | – | – |
| Guest | all | My logins, Budget, Jobs, My computers, Projects | – | – | – |
| Viewer | all | Projects | – | – | – |
registry.test.ts holds this table. Two differences from the approved table,
left on purpose: viewers see Projects (they hold projects.read; the page
lists their grants), and all of You — its pages call only self routes.
You lists Drafts (/drafts) for everyone but the operator, whose Drafts
are under Files. My computers is listed to whoever may pair or run (whether
they still have computers isn't in /api/me): with computers switched off it
lists the ones they keep, removable, with no Add. AI apps left the
registry on 2026-11-28: it is the hub-mcp plugin's nav: "settings" page
(group Your logins & tools), listed for the owner and the guests the plugin
is granted to; /settings/ai-apps forwards there.
On a phone a guest's Settings drawer has five slots: My logins, Budget, Jobs, My computers and one more — Projects is in its stash (the bottom bar's own Projects tab is the projects list).
Permissions per entry
Each entry needs the permission(s) of the routes its page calls
(backend/authz/routes.py); several when the page needs several (allPerms),
so it shows only where the page works:
- You — Profile, Display, Notifications, Extras, Drafts:
self(Drafts: not the operator). - A plugin's Settings page (
ui.pages[].nav: "settings"since 2026-11-27 — Keyboard, Prompt shortcuts, What's new and the What's new editor, their plugins'): listed whenever the plugin is active for the caller and they hold the page'spermif it names one (/api/plugins/uilists only those; the editor's isusers.manage), in itsgroupafter itsafter(business/settings/pluginEntries.tsx,visibleEntries(a, extra)), at/settings/p/<plugin>/<page>. - Skills & agents (
/settings/setup, Your logins & tools):workers.managelab.read+users.manage— the lab sync, the catalog, what every guest gets.
- My logins
self.claude· Budget: not the operator, andself.claude, orruns.startwith a budget on their runs · Scheduled jobs: the cron-jobs plugin'sminepage (its grant; hidden fromautomation.manage, whose Cron jobs page is the plugin'sjobs) · My computersself(listed:computers.pairorruns.start) · AI apps: the hub-mcp plugin'sai-appspage (its grant) · Projectsprojects.read, not the operator. - Models, Tags:
lab.settings(Fresh context is thefresh-contextplugin's page since 2026-12-01) · Users, Roles:users.manage· Security, Approvals:security.manage. - Machines:
workers.read+accounts.manage(a row lists its logins) · Logins:accounts.manage· a plugin's hub key (spend, key settings):plugins.manage· Cron jobs:automation.manage. Claude Code hooks was removed (2026-12-01;/settings/hooksredirects to Settings). Browser left for thelab-chromeplugin's page (/settings/browserredirects there, 2026-11-26) andlab.integrationswith it.
Operator variants. Jobs (unless: automation.manage), Projects and
Budget (when: not the operator) are a person's pages; the operator's are Cron
jobs and their Profile, and those pages forward them there. unless / when only hide the entry — the guard checks
the permission alone, so the forward still works. operator: { label, hint }
is what the operator reads instead (Push notifications).
Machines and Logins
Settings → Machines (/settings/machines, business/machines/) and
Logins (/settings/logins, business/logins/) replaced Profiles and
Accounts; every old URL redirects, query and hash kept
(/settings/profiles/…, /settings/workers/…, /settings/accounts/…,
/settings/computers, /settings#subscription, /settings#claude).
- Operator (
hub): every machine by profile —MachineRow(name, up/down, default, login chips, one "N to fix" badge) — and, in the built-in Guests group, People's computers: every guest's own computer, the same row (ComputerMachineRow), opening the same machine page. A machine page (/settings/machines/<profile>/<runner>):MachineHeader(name in place, status, ⋯), the Needs you strip, tabs Logins · Tools · Details. Add machine (?pair) is the 3-stepPairWizard. Logins: every hub login by harness; a login page starts with its state, Plan & cost folded. - A person (
mine): My computers is the same frame, list row, header, strip and tabs on/api/me/computers(pages/MyMachines.tsx,pages/Computer.tsx, a computer at/settings/machines/computers/<id>— the operator opens anyone's there too). No profile, no default; ⋯ Pause / Remove, rename in place; Logins tab = which Claude a run there bills + the terminal sessions (Ask at start, Sync); Tools = the Setup checklist; Details = system, start dir, spend. The waiting banner and the limits (a fold) stay on the list;?pairopens the guest Add a computer wizard.business/machines/computer.tsis the one adapter between the two API shapes (computerSummary,computerNeeds— the sameneedsYourules);NeedsYouStriptakes the person's own buttons (actions). - My logins (
pages/MyLogins.tsx): one row per login of their own (myLogins(me)— their Claude today; their opencode / MCP logins, a later backend round, only add rows), a login page with the sameSignInblock (GuestClaudeCard,guestClaudeApi) and their 5-hour / week gauges. Budget keeps spend and budget and links there.
The text rule (these pages, and any new settings page): no intro
paragraph — a subtitle of at most 8 words; the long explanation behind How it
works (technical/HowItWorks.tsx) or an ⓘ (InfoHint); a control has a label
and at most one short line; no terminal command in the page flow (a button
does it; the command sits behind From a terminal instead or an ⓘ); a
section with nothing to say is one line. Folds (technical/Fold.tsx) keep
their summary visible — under the title on a phone. Everything a non-operator
reaches is in French too; the operator's own help stays English (the owner's
UI is always English).
The hub's name. The local runner is never written "Homelab" in the UI:
useHubName() (lib/hubName.ts) reads /api/me hubName — backend
HUB_LABEL (default: HUB_NAME capitalised, so "Homelab" here; "Devbox" on
a standalone hub) — { name, the } ("the Homelab" / "le Homelab").
runnerLabel(workers, runner, hub) and setupRows(…, hub) take it. The mock
takes ?mockHub=Devbox.
Search
The panel's box (pinned at the top) and the palette share
business/settings/search.ts: fuse.js over the visible pages (label, hint,
keywords, group) and the visible SETTING_ROWS (rows.ts; a row is offered
when its page is visible and its who fits), shown as Display › Timezone
and opening page?row=<id> (the row scrolls into view and rings), and —
for whoever sees Settings → Plugins — the live plugins' nav: "tools" pages
(GET /api/plugins → ui.pages, shown under Plugins: "mcp" finds the MCP
servers plugin's page). ↑ ↓ ↵ in
the box; Esc clears, a second Esc leaves it. / focuses it — the
settings.search action (lib/keyboard/actions.ts, context settings): it
answers only while the panel is mounted and wins there over Search
conversations, so both keep /; rebindable in Settings → Keyboard.
Saved layouts
- The panel: one order
settings-panel(hold an entry to move it within its group; no stash — hiding a page is what permissions do now). The old idscomposer/pet/clarifier/miscexpand toextras,pushtonotifications,computerstoprofiles. - The owner's bar:
nav-sub, keyssettings/<id>.baron an entry is its slot in the pre-registry drawer, so a saved drawer keeps its five slots and the new pages land behind them; hidden pages keep their place on a reorder. - Others' bar:
guest-you,settings/misc→settings/extras,settings/whats-newandsettings/news→settings/p:whats-new:news(the plugin's page since 2026-11-27); Drafts is the registry'sdraftsentry (You → the Me drawer, keysettings/draftsas before).
Adding a settings page
- The page under
business/<area>/pages/(lazy, like the others) and its route inroot.tsxinside<RequiresSettings>. - An entry in
registry.ts: its group, the permission its API calls need (the narrowest catalog id; checkauthz/routes.py), a hint, keywords,matchwith any detail-page prefix. Nothing else to list: the panel, the drawers, the palette and the guard pick it up. - Rows on it: a
setting="<page>.<row>"anchor each and aSETTING_ROWSentry (rows.test.tschecks both ways). - Every new string through
t()(UPDATE_I18N_KEYS=1 npx vitest run src/i18nrefreshes the key list); its French goes in thetranslation-frplugin (ai-agent-plugins), not here. registry.test.tschecks the route exists, the permission is a catalog id (mock/rolesCatalog.json) and the role table.
Renaming a page (Profiles → Machines): change the entry's label, to and
match (keep the old path in match and add a redirect route), and keep its
id unless saved layouts may lose it — or map the old id in RENAMED
(SettingsPanel.tsx) / GUEST_RENAMED (BottomBar.tsx).
The mock shows any role: ?mock=1&mockRole=member|viewer|admin (sticky,
=0 clears), &mockGuest=1 for the Guest (frontend/src/mock/README.md).