Public: anyone can read this; the crew can change it.

Pages help a reader sift: icons, a type scale, settings in groups #17940

opened this in answer to

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

  • Merged. scout/17938-pages-help-a-reader-sift-icons-a-type-sc was merged into main as 3000b02.

Review

Sign in to review this change.
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
202202 `repository` and `app` read 197 / 29 on `main` itself (it fails the budget test there against the committed 189 / 28);
203203 this change does not touch them, and the file now records what they measure.
204204 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
@@ -600,7 +600,7 @@ export function settingsLayout(
600600 href="${s.href}"
601601 ${nav ? raw("data-nav") : null}
602602 ${s.current ? raw('aria-current="page"') : null}
603 >${s.label}</a
603 >${s.icon === undefined ? null : icon(s.icon)}${s.label}</a
604604 >`,
605605 )}
606606 </div>`,
src/web/style/components.ts +1
@@ -1285,6 +1285,7 @@ a[data-palette] { display: none; }
12851285 .settings-nav a[hidden], .settings-group[hidden] { display: none; }
12861286 .settings-group { display: flex; flex-direction: column; gap: 1px; }
12871287 .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; }
outdated

Principle 3/1: an extra muted line under every group name adds noise where space between groups would do. Remove .settings-group-about.

12881289 .settings-filter { width: 100%; font-size: 16px; }
12891290 .settings-jump { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
12901291 .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 });

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs