Public: anyone can read this; the crew can change it.
Pages help a reader sift: icons, a type scale, settings in groups #17940
Merged 23h 2m ago, live in production
scout/forge:scout/17938-pages-help-a-reader-sift-icons-a-type-sc → main 0 commits fork 7 threads · 7 unresolved
5 files
changed +33
−1
docs/design/areas/settings.md +6
| @@ -202,3 +202,9 @@ The `settings` first-view budget fell from 274 to 137 words and 37 to 32 blocks | ||
| 202 | 202 | `repository` and `app` read 197 / 29 on `main` itself (it fails the budget test there against the committed 189 / 28); |
| 203 | 203 | this change does not touch them, and the file now records what they measure. |
| 204 | 204 | Pinned by `test/account-help.test.ts`. Not done: the repository settings page (`settingsPage()`) and the admin pages still carry their prose. |
| 205 | ||
| 206 | ## Icons in the settings nav (#17938) | |
| 207 | ||
| 208 | Each section link in the settings nav carries its `icon()` (hidden from assistive tech, so the link's name is its | |
| 209 | label), spaced by `.settings-nav a .ico` in `src/web/style/components.ts`. Not done: icons beside `.row-title` on the | |
| 210 | list pages, and a global type scale; both would move every page and are left for their own change. |
docs/features/settings-groups.md added +9
| @@ -0,0 +1,9 @@ | ||
| 1 | --- | |
| 2 | topic: What a forge is | |
| 3 | row: Settings nav in groups, with an icon beside each section | |
| 4 | --- | |
| 5 | # Settings in groups | |
| 6 | ||
| 7 | The account settings nav (`/settings`) is split into named groups, with a small icon beside every section. Under | |
| 8 | 860 px the nav is one menu at the top with the same groups and icons. The terminal's settings screens list the same | |
| 9 | sections; the icons are a web-only look. |
src/web/chrome.ts +1 −1
src/web/style/components.ts +1
| @@ -1285,6 +1285,7 @@ a[data-palette] { display: none; } | ||
| 1285 | 1285 | .settings-nav a[hidden], .settings-group[hidden] { display: none; } |
| 1286 | 1286 | .settings-group { display: flex; flex-direction: column; gap: 1px; } |
| 1287 | 1287 | .settings-group-name { margin: 0 0 2px; padding: 0 8px; font-size: 12.5px; font-weight: 500; color: var(--muted-fg); } |
| 1288 | .settings-nav a .ico, .settings-jump-list a .ico { margin-right: 8px; opacity: .75; } | |
| 1288 | 1289 | .settings-filter { width: 100%; font-size: 16px; } |
| 1289 | 1290 | .settings-jump { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); } |
| 1290 | 1291 | .settings-jump > summary { |
test/settings-groups.test.ts added +16
| @@ -0,0 +1,16 @@ | ||
| 1 | import { expect, test } from "bun:test"; | |
| 2 | import { raw } from "../src/web/html.ts"; | |
| 3 | import { settingsLayout } from "../src/web/chrome.ts"; | |
| 4 | import { accountSections } from "../src/web/pages/origins.ts"; | |
| 5 | ||
| 6 | test("the settings nav draws a hidden icon beside each section, so a link's name stays its label", () => { | |
| 7 | const out = String(settingsLayout(accountSections("profile", { admin: false }), raw("<p>x</p>"))); | |
| 8 | const nav = out.slice(out.indexOf('<nav class="settings-nav"'), out.indexOf("</nav>")); | |
| 9 | const links = nav.match(/<a\b[\s\S]*?<\/a\s*>/g) ?? []; | |
| 10 | expect(links.length).toBeGreaterThan(3); | |
| 11 | for (const a of links) { | |
| 12 | expect(a).toContain('class="ico '); | |
| 13 | expect(a).toMatch(/<svg[^>]*aria-hidden="true"/); | |
| 14 | } | |
| 15 | expect(nav).not.toContain("settings-group-about"); | |
| 16 | }); |
new above
offline
Principle 3/1: an extra muted line under every group name adds noise where space between groups would do. Remove
.settings-group-about.