settings
Read before adding an app's settings to Settings, or when someone asks where a setting is.
Files10
View on GitHubSKILL.mdapps/settings/SKILL.md
GitHubSettings is one app where every app brings its settings, as macOS's System Settings has its panes. Its sidebar has whoever's looking (Sign In & Security under their name), the sections apps add, in three groups, then every app they have, A to Z, each with its own page: who it's for, whether it's trusted, its notifications, its update, and Remove App. Updates is its own: Software Update for the network's servers, this device, and each app with an update ready.
sectionslists what the apps you have add, as below, each with its app's title and icon and its red count.appslists the apps you have as the sidebar shows them; One Core'sappssays the rest of each.badgeis the red count on Settings' icon: what waits in its sections, together.
Each of its screens is a tool that only reads and its arguments, which a link names and a browser's address shows:
section (one:settings#section&app=sign-in§ion=devices, /settings/sign-in/devices), updates
(/settings/updates), or app, an app's page (one:settings#app&name=<name>&for=<who it's for>, /settings/apps/<name>).
A link's other arguments are the section's own, which its component reads from link(): Vault's request
(one:settings#section&app=vault§ion=accounts&request=<id>).
Sections
An app adds to Settings by hooking into settings.sections, answering with its list of what it adds:
@impl true
def hooks, do: ["settings.sections"]
@impl true
def hook("settings.sections", _about, _call),
do: [
%{in: "settings", name: "Devices", component: "devices", icon: "client/icon.svg", group: "network", order: 1},
%{in: "device", component: "awake", service: true}
]
componentis what draws it: a Solid component the app's client exports (client/package.json:{"exports": {"./devices": "./devices.tsx"}}), the module's default export. A trusted app's is drawn in Settings' page and acts with what Settings' page may do. An untrusted app's is its pageclient/<component>.htmlinstead, in a frame of Settings' page (the UI library'sFrame), the device after#, where it keeps what its own app may do; it says how tall it is (sizeChanged({ height })), which its group grows to, and is 150 points otherwise. It draws its own card, as a trusted one's is drawn in Settings' (<ListStyle value="insetGrouped">).inis where."settings"is a section of the sidebar, for the apps a network starts with, which are trusted (an untrusted app's is left out): itsname, itsicon(a file of the app'sclient/), itsgroup,"you"(the row with the person's name, which is Sign-In's),"network","general"or"system", itsorderin the group, and abadge, if it has one: a tool of the app's that only reads, whose answer'scountis the red count on its row and, added up, on Settings' icon. A section that has nothing to show on some devices saysneeds, a field of whatclient()says of the device (login): it's listed only where that isn'tnull, as a phone has no login to open the app at. Its component draws a wholeScreen, withback, and is givengroups, a component that draws what other apps add to a place it offers:<props.groups in="device" device={id} />.- Any other
inis a group in a page a section offers, headed by the adding app's icon and name, so it's clear which app brings what:"device", a device's page in Devices, whose component is givendevice, the device's id, andserver, the server it is or runs on, if any; or"app", the app's own page in Settings' Apps. A device's group says where it applies, so no heading shows over nothing:kinds, the kinds of device it's for (app,browser,assistant,server), andservice: truefor only a server where the app's service runs (Stay Awake, on a Mac). A group's component draws only its rows (aList), never aScreen.
An app that can't answer is left out, as one whose answer doesn't say what it must is.