Public: anyone can read this; the crew can change it.
A new forge's first-login page uses plain words: a test fails on jargon #10719
scout/forge:scout/10712-a-new-forge-s-first-login-page-uses-plai → main 6 commits fork 10 threads · 10 unresolved
src/apps/feature.ts +1 −1
| @@ -32,7 +32,7 @@ export const SETTING_TYPES: readonly SettingType[] = ["bool", "int", "string", " | ||
| 32 | 32 | /** The labels the forge's own menus use: a feature may not borrow one. */ |
| 33 | 33 | const BUILT_IN_MENU_LABELS = [ |
| 34 | 34 | "your profile", "repositories", "apps", "notes", "talk", "explore", "packs", "displays", "map", "features", |
| 35 | "new app", "new repository", "new issue", "new organization", "migrate", "settings", "access tokens", "ssh keys", | |
| 35 | "new app", "new repository", "new issue", "new organization", "migrate", "settings", "access tokens", "access keys", "ssh keys", "terminal keys", | |
| 36 | 36 | "origins", "boards", "crew", "system memory", "help", "sign out", "log out", "sign in", "admin", "administration", |
| 37 | 37 | "theme", "create", "new forge", "create new", "appearance and help", "features from apps", "keyboard shortcuts", |
| 38 | 38 | ]; |
src/core/tokens.ts +1 −1
| @@ -15,7 +15,7 @@ import { getUserById, isActive, type User } from "./users.ts"; | ||
| 15 | 15 | export type TokenScope = "ro" | "rw" | "admin"; |
| 16 | 16 | |
| 17 | 17 | /** What a non-admin is told when they ask for a token that acts as admin. */ |
| 18 | export const ADMIN_TOKEN_WORDS = "Only an admin can make a token with admin scope; ro and rw are open to you."; | |
| 18 | export const ADMIN_TOKEN_WORDS = "Only an admin can make an access key with admin scope; ro and rw are open to you."; | |
| 19 | 19 | |
| 20 | 20 | const rank: Record<TokenScope, number> = { ro: 0, rw: 1, admin: 2 }; |
| 21 | 21 |
src/tui/forge.ts +1 −1
| @@ -403,7 +403,7 @@ export function forgeCommands(session: Session): (ctx: Ctx) => Command[] { | ||
| 403 | 403 | if (session.signedIn) |
| 404 | 404 | commands.push({ |
| 405 | 405 | id: "ssh-keys", |
| 406 | title: "SSH keys", | |
| 406 | title: "Terminal keys", | |
| 407 | 407 | hint: "list, add and remove the keys that sign in as you", |
| 408 | 408 | run: () => ctx.push(sshKeysScreen(session, ctx)), |
| 409 | 409 | }); |
src/tui/screens/signins.ts +13 −13
| @@ -104,7 +104,7 @@ function hardWrap(text: string, width: number): string[] { | ||
| 104 | 104 | function secretScreen(ctx: Ctx, secret: string, market: { add: string; install: string } | null): Screen { |
| 105 | 105 | let copied = ""; |
| 106 | 106 | return { |
| 107 | title: "New token", | |
| 107 | title: "New access key", | |
| 108 | 108 | keys: [ |
| 109 | 109 | binding(["y"], "copy it"), |
| 110 | 110 | ...(market === null ? [] : [binding(["a"], "copy the marketplace line"), binding(["i"], "copy the install line")]), |
| @@ -166,21 +166,21 @@ export function signInsScreen(f: Session, ctx: Ctx): Screen { | ||
| 166 | 166 | |
| 167 | 167 | const end = (picked: SignIn): void => { |
| 168 | 168 | if (picked.kind === "terminal") { |
| 169 | note = "This terminal cannot be ended from here: disconnect, or remove its key in Settings → SSH keys."; | |
| 169 | note = "This terminal cannot be ended from here: disconnect, or remove its key in Settings → Terminal keys."; | |
| 170 | 170 | ctx.invalidate(); |
| 171 | 171 | return; |
| 172 | 172 | } |
| 173 | 173 | if (picked.kind === "token") { |
| 174 | 174 | ctx.push( |
| 175 | 175 | confirmScreen(ctx, screen, { |
| 176 | title: "Revoke a token", | |
| 176 | title: "Revoke an access key", | |
| 177 | 177 | body: [`Revoke ${picked.name} (${picked.scope})? It stops working at once.`], |
| 178 | 178 | actions: [{ label: "Keep", variant: "ghost" }, { label: "Revoke", variant: "danger" }], |
| 179 | 179 | onChoose: (i) => { |
| 180 | 180 | if (i < 1) return; |
| 181 | 181 | const user = f.user; |
| 182 | 182 | const done = user !== undefined && deleteToken(f.app, user, picked.id).ok; |
| 183 | note = done ? "Revoked that token." : "That token is already gone."; | |
| 183 | note = done ? "Revoked that access key." : "That access key is already gone."; | |
| 184 | 184 | ctx.invalidate(); |
| 185 | 185 | }, |
| 186 | 186 | }), |
| @@ -208,7 +208,7 @@ export function signInsScreen(f: Session, ctx: Ctx): Screen { | ||
| 208 | 208 | const user = f.user; |
| 209 | 209 | const made = createToken(f.app, user, name, scope); |
| 210 | 210 | if (!made.ok) { |
| 211 | note = made.error === "forbidden" ? ADMIN_TOKEN_WORDS : "Sign in to make a token."; | |
| 211 | note = made.error === "forbidden" ? ADMIN_TOKEN_WORDS : "Sign in to make an access key."; | |
| 212 | 212 | ctx.invalidate(); |
| 213 | 213 | return; |
| 214 | 214 | } |
| @@ -222,7 +222,7 @@ export function signInsScreen(f: Session, ctx: Ctx): Screen { | ||
| 222 | 222 | const confirmAdmin = (name: string) => |
| 223 | 223 | later(ctx, () => |
| 224 | 224 | confirmScreen(ctx, screen, { |
| 225 | title: "Make an admin token", | |
| 225 | title: "Make an admin access key", | |
| 226 | 226 | body: [`${name} will act as admin: y to make it, n to cancel.`], |
| 227 | 227 | actions: [{ label: "Make it", variant: "danger" }, { label: "Cancel", variant: "ghost" }], |
| 228 | 228 | yesNo: true, |
| @@ -237,7 +237,7 @@ export function signInsScreen(f: Session, ctx: Ctx): Screen { | ||
| 237 | 237 | const askScope = (name: string, isAdmin: boolean) => |
| 238 | 238 | later(ctx, () => |
| 239 | 239 | promptScreen(ctx, screen, { |
| 240 | title: "Make a token", | |
| 240 | title: "Make an access key", | |
| 241 | 241 | label: isAdmin ? "Scope: ro, rw or admin" : "Scope: ro or rw", |
| 242 | 242 | value: "ro", |
| 243 | 243 | onSubmit: (word) => { |
| @@ -252,11 +252,11 @@ export function signInsScreen(f: Session, ctx: Ctx): Screen { | ||
| 252 | 252 | |
| 253 | 253 | const askName = (isAdmin: boolean) => |
| 254 | 254 | promptScreen(ctx, screen, { |
| 255 | title: "Make a token", | |
| 255 | title: "Make an access key", | |
| 256 | 256 | label: "Name", |
| 257 | 257 | value: "token", |
| 258 | 258 | onSubmit: (name) => { |
| 259 | if (name === "") return "A token needs a name."; | |
| 259 | if (name === "") return "An access key needs a name."; | |
| 260 | 260 | if ([...name].length > 64) return "Keep the name to 64 characters."; |
| 261 | 261 | return askScope(name, isAdmin); |
| 262 | 262 | }, |
| @@ -322,8 +322,8 @@ export function signInsScreen(f: Session, ctx: Ctx): Screen { | ||
| 322 | 322 | title: "Signed in", |
| 323 | 323 | keys: [ |
| 324 | 324 | binding(["j", "k"], "move cursor"), |
| 325 | binding(["d"], "sign a browser out or revoke a token"), | |
| 326 | binding(["m"], "make a token"), | |
| 325 | binding(["d"], "sign a browser out or revoke an access key"), | |
| 326 | binding(["m"], "make an access key"), | |
| 327 | 327 | binding(["p"], "change your password"), |
| 328 | 328 | ], |
| 329 | 329 | render(area, s) { |
| @@ -336,8 +336,8 @@ export function signInsScreen(f: Session, ctx: Ctx): Screen { | ||
| 336 | 336 | : f.user === undefined |
| 337 | 337 | ? "Sign in to see where you are signed in." |
| 338 | 338 | : f.user.kind === "agent" |
| 339 | ? "Where you are signed in. d signs a browser out or revokes a token." | |
| 340 | : "Where you are signed in. d signs a browser out or revokes a token, m makes a token, p changes your password."; | |
| 339 | ? "Where you are signed in. d signs a browser out or revokes an access key." | |
| 340 | : "Where you are signed in. d signs a browser out or revokes an access key, m makes an access key, p changes your password."; | |
| 341 | 341 | s.text(head!.x, head!.y, truncate(text, head!.w), style(c.mutedFg, c.bg), head!.x + head!.w); |
| 342 | 342 | drawList(s, body!, c, state, rows(all)); |
| 343 | 343 | }, |
src/tui/screens/sshkeys.ts +1 −1
| @@ -30,7 +30,7 @@ export function sshKeysScreen(f: Session, ctx: Ctx): Screen { | ||
| 30 | 30 | })); |
| 31 | 31 | |
| 32 | 32 | const screen: Screen = { |
| 33 | title: "SSH keys", | |
| 33 | title: "Terminal keys", | |
| 34 | 34 | keys: [binding(["j", "k"], "move cursor"), binding(["a"], "add"), binding(["e"], "rename"), binding(["d"], "remove")], |
| 35 | 35 | render(area, s) { |
| 36 | 36 | const c = ctx.theme.c; |
src/web/client.ts +1 −1
| @@ -1575,7 +1575,7 @@ const shellCore = /* js */ ` | ||
| 1575 | 1575 | // ---- help overlay, generated from the shortcuts actually on the page ---- |
| 1576 | 1576 | var STATIC_KEYS = [ |
| 1577 | 1577 | ['j / k', 'Move between rows'], ['o or Enter', 'Open the focused row'], |
| 1578 | ['/', 'Focus search'], ['Cmd/Ctrl K', 'Command palette'], [':', 'Go to a page by name'], ['?', 'This help'], | |
| 1578 | ['/', 'Focus search'], ['Cmd/Ctrl K', 'Quick jump'], [':', 'Go to a page by name'], ['?', 'This help'], | |
| 1579 | 1579 | ['Esc', 'Leave a box, close a menu or dialog'], |
| 1580 | 1580 | ]; |
| 1581 | 1581 | // The rows a page earns by what it carries: a box to type in, a form |
src/web/layout.ts +7 −7
| @@ -346,8 +346,8 @@ function userMenu( | ||
| 346 | 346 | ...forgeDoor(ctx), |
| 347 | 347 | { separator: true, label: "" }, |
| 348 | 348 | { label: "Settings", href: "/settings", icon: "settings" }, |
| 349 | { label: "Access tokens", href: "/settings/tokens", icon: "key" }, | |
| 350 | { label: "SSH keys", href: "/settings/keys", icon: "lock" }, | |
| 349 | { label: "Access keys", href: "/settings/tokens", icon: "key" }, | |
| 350 | { label: "Terminal keys", href: "/settings/keys", icon: "lock" }, | |
Principle 8: 'Terminal keys' now disagrees with the target page's title 'SSH keys'. Rename the page too so the label and the page match, and then 'Access tokens' and 'Origins' still need plain words. |
||
| 351 | 351 | { label: "Origins", href: "/settings/origins", icon: "globe" }, |
| 352 | 352 | ...(!user.isAdmin && administersAny(ctx.app.db, user) |
| 353 | 353 | ? [{ label: "Boards", href: "/boards", icon: "activity" as const }] |
| @@ -409,8 +409,8 @@ const STATIC_PALETTE: PaletteItem[] = [ | ||
| 409 | 409 | { t: "Migrate a repository", h: "/migrate", c: "Create" }, |
| 410 | 410 | { t: "New organization", h: "/organizations/new", c: "Create" }, |
| 411 | 411 | { t: "Account settings", h: "/settings", c: "Settings" }, |
| 412 | { t: "Access tokens", h: "/settings/tokens", c: "Settings" }, | |
| 413 | { t: "SSH keys", h: "/settings/keys", c: "Settings" }, | |
| 412 | { t: "Access keys", h: "/settings/tokens", c: "Settings" }, | |
| 413 | { t: "Terminal keys", h: "/settings/keys", c: "Settings" }, | |
| 414 | 414 | { t: "Origins", h: "/settings/origins", c: "Settings" }, |
| 415 | 415 | { t: "Your shells", h: "/settings/shells", c: "Settings" }, |
| 416 | 416 | ]; |
| @@ -580,7 +580,7 @@ function overlays(): Html { | ||
| 580 | 580 | id="palette" |
| 581 | 581 | role="dialog" |
| 582 | 582 | aria-modal="true" |
| 583 | aria-label="Command palette" | |
| 583 | aria-label="Quick jump" | |
| 584 | 584 | > |
| 585 | 585 | <input |
| 586 | 586 | class="input palette-input" |
| @@ -591,7 +591,7 @@ function overlays(): Html { | ||
| 591 | 591 | aria-controls="palette-list" |
| 592 | 592 | aria-autocomplete="list" |
| 593 | 593 | placeholder="Jump to a repository, page or action…" |
| 594 | aria-label="Command palette" | |
| 594 | aria-label="Quick jump" | |
| 595 | 595 | autocomplete="off" |
| 596 | 596 | autocapitalize="off" |
| 597 | 597 | spellcheck="false" |
| @@ -742,7 +742,7 @@ function footer(ctx: Ctx, own?: Html): Html { | ||
| 742 | 742 | type="button" |
| 743 | 743 | data-palette |
| 744 | 744 | > |
| 745 | Command palette | |
| 745 | Quick jump | |
| 746 | 746 | </button> |
| 747 | 747 | </footer>`; |
| 748 | 748 | } |
src/web/pages/account.ts +17 −17
| @@ -710,7 +710,7 @@ function tokensView(ctx: Ctx): Html { | ||
| 710 | 710 | listSessions(ctx.app.db, ctx.auth.user!.id, cookieValue(ctx.request, "forge_session")), |
| 711 | 711 | ); |
| 712 | 712 | const list = tokens.length === 0 |
| 713 | ? html`<p class="muted">No tokens yet. Mint one when a script, a CI job, or another machine needs to act as you.</p>` | |
| 713 | ? html`<p class="muted">No access keys yet. Make one when a script, a CI job, or another machine needs to act as you.</p>` | |
| 714 | 714 | : html`<ul class="list setting-list"> |
| 715 | 715 | ${tokens.map((t) => |
| 716 | 716 | row({ |
| @@ -725,18 +725,18 @@ function tokensView(ctx: Ctx): Html { | ||
| 725 | 725 | </ul>`; |
| 726 | 726 | return html`${help([ |
| 727 | 727 | [ |
| 728 | "Tokens", | |
| 729 | "Use a token as the password when pushing over HTTPS, or as a Bearer token for the API. Your account password works for git too — tokens are for scoped or automated access.", | |
| 728 | "Access keys", | |
| 729 | "Use an access key as the password when pushing over HTTPS, or as the Bearer value for the API. Your account password works for git too — access keys are for scoped or automated access.", | |
| 730 | 730 | ], |
| 731 | ["Token name", "Name it after where it lives — laptop, CI, deploy box."], | |
| 732 | ["Scope", "A token can never mint another token, whatever its scope."], | |
| 731 | ["Key name", "Name it after where it lives — laptop, CI, deploy box."], | |
| 732 | ["Scope", "An access key can never make another access key, whatever its scope."], | |
| 733 | 733 | ])}${connectCard(ctx, readFlash(ctx.request)?.code)} |
| 734 | ${block("Tokens", list)} | |
| 734 | ${block("Access keys", list)} | |
| 735 | 735 | ${block( |
| 736 | "New token", | |
| 736 | "New access key", | |
| 737 | 737 | html`<form method="post" action="/settings/tokens"> |
| 738 | 738 | ${uiField({ |
| 739 | label: "Token name", | |
| 739 | label: "Key name", | |
| 740 | 740 | name: "name", |
| 741 | 741 | required: true, |
| 742 | 742 | })} |
| @@ -756,14 +756,14 @@ function tokensView(ctx: Ctx): Html { | ||
| 756 | 756 | <label class="check"> |
| 757 | 757 | <input type="checkbox" name="aiAdmin" required /> |
| 758 | 758 | <span |
| 759 | >I mean to give this token admin: you are the forge's admin, | |
| 759 | >I mean to give this access key admin: you are the forge's admin, | |
| 760 | 760 | so whatever holds it — an AI included — acts as admin.</span |
| 761 | 761 | > |
| 762 | 762 | </label> |
| 763 | 763 | </div>` |
| 764 | 764 | : null} |
| 765 | 765 | <div class="form-actions"> |
| 766 | ${btn("Generate token", { variant: "primary" })} | |
| 766 | ${btn("Make access key", { variant: "primary" })} | |
| 767 | 767 | </div> |
| 768 | 768 | </form>`, |
| 769 | 769 | )} |
| @@ -775,7 +775,7 @@ export function tokensPage(ctx: Ctx): Response { | ||
| 775 | 775 | if (!ctx.auth.user) return signInFirst(ctx); |
| 776 | 776 | notePhase(ctx.request, "session", takeSessionTime(ctx.request)); |
| 777 | 777 | const body = tokensView(ctx); |
| 778 | return timePhase(ctx.request, "render", () => accountShell(ctx, "tokens", "Personal access tokens", body)); | |
| 778 | return timePhase(ctx.request, "render", () => accountShell(ctx, "tokens", "Access keys", body)); | |
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | // POST /settings/tokens |
| @@ -861,14 +861,14 @@ function keysView( | ||
| 861 | 861 | ${terminalCommand(ssh, ctx.app.config.sshHostKey)} |
| 862 | 862 | </div>`} |
| 863 | 863 | <p class="muted small mb"> |
| 864 | Keys that sign you in over SSH. Paste a public key (<span class="mono" | |
| 864 | Keys that sign you in to the terminal and to git. Paste a public key (<span class="mono" | |
| 865 | 865 | >~/.ssh/id_ed25519.pub</span |
| 866 | 866 | >) — ed25519, ecdsa, or rsa (2048 bits or more). |
| 867 | 867 | </p> |
| 868 | 868 | ${block( |
| 869 | "SSH keys", | |
| 869 | "Terminal keys", | |
| 870 | 870 | keys.length === 0 |
| 871 | ? html`<p class="muted">No keys yet. Add one and git over SSH stops asking for a password.</p>` | |
| 871 | ? html`<p class="muted">No keys yet. Add one and git stops asking for a password.</p>` | |
| 872 | 872 | : html`<ul class="list setting-list"> |
| 873 | 873 | ${keys.map((k) => |
| 874 | 874 | row({ |
| @@ -880,7 +880,7 @@ function keysView( | ||
| 880 | 880 | </ul>`, |
| 881 | 881 | )} |
| 882 | 882 | ${block( |
| 883 | "New SSH key", | |
| 883 | "New terminal key", | |
| 884 | 884 | html`<form method="post" action="/settings/keys"> |
| 885 | 885 | ${uiField({ |
| 886 | 886 | label: "Name", |
| @@ -911,7 +911,7 @@ export function keysPage(ctx: Ctx): Response { | ||
| 911 | 911 | if (!ctx.auth.user) return signInFirst(ctx); |
| 912 | 912 | notePhase(ctx.request, "session", takeSessionTime(ctx.request)); |
| 913 | 913 | const body = keysView(ctx, { name: "", key: "" }); |
| 914 | return timePhase(ctx.request, "render", () => accountShell(ctx, "keys", "SSH keys", body)); | |
| 914 | return timePhase(ctx.request, "render", () => accountShell(ctx, "keys", "Terminal keys", body)); | |
| 915 | 915 | } |
| 916 | 916 | |
| 917 | 917 | // POST /settings/keys |
| @@ -930,7 +930,7 @@ export async function keyCreate(ctx: Ctx): Promise<Response> { | ||
| 930 | 930 | return accountShell( |
| 931 | 931 | ctx, |
| 932 | 932 | "keys", |
| 933 | "SSH keys", | |
| 933 | "Terminal keys", | |
| 934 | 934 | keysView(ctx, { |
| 935 | 935 | name, |
| 936 | 936 | key, |
src/web/pages/accounts.ts +4 −4
| @@ -281,12 +281,12 @@ export function personSignInsPage(ctx: Ctx): Response { | ||
| 281 | 281 | html`<section class="settings-block" id="tokens"> |
| 282 | 282 | <h2>${userLink(user.username)}: where they are signed in</h2> |
| 283 | 283 | <p class="muted"> |
| 284 | Revoking a token or signing out a browser ends it at once; the person | |
| 284 | Revoking an access key or signing out a browser ends it at once; the person | |
| 285 | 285 | can sign in again. To stop them signing in, suspend the account. |
| 286 | 286 | </p> |
| 287 | <h3>Access tokens</h3> | |
| 287 | <h3>Access keys</h3> | |
| 288 | 288 | ${tokens.length === 0 |
The heading now says 'Access keys' but this line still says 'No access tokens.'. Same name on the whole page. |
||
| 289 | ? html`<p class="muted">No access tokens.</p>` | |
| 289 | ? html`<p class="muted">No access keys.</p>` | |
| 290 | 290 | : html`<ul class="list setting-list"> |
| 291 | 291 | ${tokens.map((t) => |
| 292 | 292 | row({ |
| @@ -322,7 +322,7 @@ export function signInAct(what: "token" | "session") { | ||
| 322 | 322 | : endAccountSession(ctx.app, ctx.auth.user, username, id); |
| 323 | 323 | if (!done.ok) return notFoundPage(ctx); |
| 324 | 324 | return flashTo(ctx, `/settings/accounts/${encodeURIComponent(username)}`, { |
| 325 | message: what === "token" ? "Token revoked." : "Browser signed out.", | |
| 325 | message: what === "token" ? "Access key revoked." : "Browser signed out.", | |
| 326 | 326 | }); |
| 327 | 327 | }; |
| 328 | 328 | } |
src/web/pages/origins.ts +3 −3
| @@ -144,8 +144,8 @@ const SECTION_ROWS: readonly (readonly [ | ||
| 144 | 144 | ["Account", "Profile", "/settings", "user", (c) => c === "profile", false], |
| 145 | 145 | ["Account", "Password", "/settings/password", "lock", (c) => c === "password", false], |
| 146 | 146 | ["Account", "Passkeys", "/settings/passkeys", "key", (c) => c === "passkeys", false], |
| 147 | ["Account", "SSH keys", "/settings/keys", "lock", (c) => c === "keys", false], | |
| 148 | ["Account", "Access tokens", "/settings/tokens", "key", (c) => c === "tokens", false], | |
| 147 | ["Account", "Terminal keys", "/settings/keys", "lock", (c) => c === "keys", false], | |
| 148 | ["Account", "Access keys", "/settings/tokens", "key", (c) => c === "tokens", false], | |
| 149 | 149 | ["Account", "Confirms", "/settings/confirms", "check", (c) => c === "confirms", false], |
| 150 | 150 | ["Crew and AI", "Model", "/settings/model", "key", (c) => c === "model", false], |
| 151 | 151 | ["Crew and AI", "Crew", "/settings/crew", "bot", (c) => c === "crew", true], |
| @@ -689,7 +689,7 @@ function forgeSection(ctx: Ctx, values: ConnectValues): Html { | ||
| 689 | 689 | hint: "Read is enough to bring an app; private repositories come with it.", |
| 690 | 690 | })} |
| 691 | 691 | ${readOnlyField()} |
| 692 | <p class="muted small">Make the token there: ${tokens} (Settings → Access tokens).</p> | |
| 692 | <p class="muted small">Make an access key there: ${tokens} (Settings → Access keys).</p> | |
| 693 | 693 | <div class="form-actions"> |
| 694 | 694 | ${btn("Connect that forge", { variant: "primary", icon: "globe" })} |
| 695 | 695 | </div> |
src/web/pages/site.ts +1 −1
| @@ -201,7 +201,7 @@ export function terminalCard(ctx: Ctx): Html { | ||
| 201 | 201 | ${terminalCommand( |
| 202 | 202 | ssh, |
| 203 | 203 | ctx.app.config.sshHostKey, |
| 204 | html`<a class="small" href="/settings/keys">SSH keys</a>`, | |
| 204 | html`<a class="small" href="/settings/keys">Terminal keys</a>`, | |
| 205 | 205 | )} |
| 206 | 206 | </section>`; |
| 207 | 207 | } |
src/web/studio/crew.ts +1 −1
| @@ -424,7 +424,7 @@ export function settingsLead(ctx: Ctx, repo: Repo): Html { | ||
| 424 | 424 | export function crewKeyNote(ctx: Ctx): Html | null { |
| 425 | 425 | if (crewHasCredential(ctx.app.db)) return null; |
| 426 | 426 | return html`<p class="small muted" id="crew-key-note" role="status"> |
| 427 | ${icon("alert")} The crew has no model key yet, so it cannot start work. | |
| 427 | ${icon("alert")} The crew has no AI key yet, so it cannot start work. | |
| 428 | 428 | ${ctx.auth.user?.isAdmin |
| 429 | 429 | ? html`<a href="/settings/subscriptions">Add one in Subscriptions</a>.` |
| 430 | 430 | : "Ask this forge's admin to add one."} |
test/account-help.test.ts +1 −1
| @@ -59,7 +59,7 @@ test("the password and token explanations live inside the help toggle, before th | ||
| 59 | 59 | expect(pw.replace(helpOf(pw), "")).not.toContain("A passphrase beats a puzzle"); |
| 60 | 60 | expect(pw.indexOf("data-page-help")).toBeLessThan(pw.indexOf("Change password</h2>")); |
| 61 | 61 | const tk = await get("/settings/tokens"); |
| 62 | expect(helpOf(tk)).toContain("can never mint another token"); | |
| 62 | expect(helpOf(tk)).toContain("can never make another access key"); | |
| 63 | 63 | expect(helpOf(tk)).toContain("laptop, CI, deploy box"); |
| 64 | 64 | expect(tk.replace(helpOf(tk), "")).not.toContain("laptop, CI, deploy box"); |
| 65 | 65 | }); |
test/account-rows.test.ts +7 −7
| @@ -60,21 +60,21 @@ test("no account page is a card or holds a table", async () => { | ||
| 60 | 60 | } |
| 61 | 61 | }); |
| 62 | 62 | |
| 63 | test("tokens are rows under a Tokens heading, each with Revoke", async () => { | |
| 63 | test("tokens are rows under an Access keys heading, each with Revoke", async () => { | |
| 64 | 64 | const m = await main("/settings/tokens"); |
| 65 | 65 | expect(m).toContain('<section class="settings-block">'); |
| 66 | const list = m.slice(m.indexOf("<h2>Tokens</h2>")); | |
| 67 | expect(list).toMatch(/^<h2>Tokens<\/h2>\s*<ul class="list setting-list">/); | |
| 66 | const list = m.slice(m.indexOf("<h2>Access keys</h2>")); | |
| 67 | expect(list).toMatch(/^<h2>Access keys<\/h2>\s*<ul class="list setting-list">/); | |
| 68 | 68 | const item = list.slice(0, list.indexOf("</ul>")); |
| 69 | 69 | expect(item).toContain("<strong>laptop</strong>"); |
| 70 | 70 | expect(item).toMatch(/settings%2Ftokens%2F[^"]+%2Fdelete/); |
| 71 | 71 | expect(m).toContain('action="/settings/tokens"'); |
| 72 | 72 | }); |
| 73 | 73 | |
| 74 | test("keys are rows under an SSH keys heading, each with its Remove link", async () => { | |
| 74 | test("keys are rows under a Terminal keys heading, each with its Remove link", async () => { | |
outdated
Grammar: 'an Terminal keys'. Reword the test name. |
||
| 75 | 75 | const m = await main("/settings/keys"); |
| 76 | const list = m.slice(m.indexOf("<h2>SSH keys</h2>")); | |
| 77 | expect(list).toMatch(/^<h2>SSH keys<\/h2>\s*<ul class="list setting-list">/); | |
| 76 | const list = m.slice(m.indexOf("<h2>Terminal keys</h2>")); | |
| 77 | expect(list).toMatch(/^<h2>Terminal keys<\/h2>\s*<ul class="list setting-list">/); | |
| 78 | 78 | const item = list.slice(0, list.indexOf("</ul>")); |
| 79 | 79 | expect(item).toContain("<strong>work</strong>"); |
| 80 | 80 | expect(item).toMatch(/settings%2Fkeys%2F[^"]+%2Fdelete/); |
| @@ -90,7 +90,7 @@ test("empty lists are one muted sentence, not a panel", async () => { | ||
| 90 | 90 | const c = (other.headers.get("set-cookie") ?? "").split(";")[0]!; |
| 91 | 91 | const get = async (path: string) => (await (await fetch(`${base}${path}`, { headers: { cookie: c } })).text()); |
| 92 | 92 | const tokens = await get("/settings/tokens"); |
| 93 | expect(tokens).toContain('<p class="muted">No tokens yet.'); | |
| 93 | expect(tokens).toContain('<p class="muted">No access keys yet.'); | |
| 94 | 94 | expect(tokens).not.toContain("empty-title"); |
| 95 | 95 | const keys = await get("/settings/keys"); |
| 96 | 96 | expect(keys).toContain('<p class="muted">No keys yet.'); |
test/accounts-language.test.ts +1 −1
| @@ -36,7 +36,7 @@ test("a person's sign-ins page is blocks all the way down, no card", async () => | ||
| 36 | 36 | const m = main(await (await fetch(`${servers.url}/settings/accounts/bobby`, { headers: { cookie: admin } })).text()); |
| 37 | 37 | expect(m).not.toContain('class="card'); |
| 38 | 38 | expect(m).toContain('<section class="settings-block" id="tokens">'); |
| 39 | expect(m).toContain("No access tokens."); | |
| 39 | expect(m).toContain("No access keys."); | |
| 40 | 40 | // the grant, ceiling and browsers sections are still there, forms intact |
| 41 | 41 | expect(m).toContain("Model budget"); |
| 42 | 42 | expect(m).toContain('action="/settings/accounts/bobby/model"'); |
test/everyday.test.ts +2 −2
| @@ -223,7 +223,7 @@ describe("the everyday account", () => { | ||
| 223 | 223 | test("an admin's token from the page is minted only when they tick that they mean it", async () => { |
| 224 | 224 | const root = await signIn("ada"); |
| 225 | 225 | const form = await page(root, "/settings/tokens"); |
| 226 | expect(form).toContain("I mean to give this token admin"); | |
| 226 | expect(form).toContain("I mean to give this access key admin"); | |
| 227 | 227 | const count = () => |
| 228 | 228 | ( |
| 229 | 229 | app.db |
| @@ -241,7 +241,7 @@ describe("the everyday account", () => { | ||
| 241 | 241 | expect(count()).toBe(before + 1); |
| 242 | 242 | // Someone who is not an admin is not asked. |
| 243 | 243 | expect(await page(await signIn("kim"), "/settings/tokens")).not.toContain( |
| 244 | "I mean to give this token admin", | |
| 244 | "I mean to give this access key admin", | |
| 245 | 245 | ); |
| 246 | 246 | }); |
| 247 | 247 |
test/first-login.test.ts +11 −1
| @@ -27,6 +27,7 @@ import { serve, type Servers } from "../src/http/server.ts"; | ||
| 27 | 27 | import { firstBoot } from "../src/spawn/first-boot.ts"; |
| 28 | 28 | import { hostedPlacement } from "../src/spawn/placement.ts"; |
| 29 | 29 | import { quietLogs } from "./helpers/globals.ts"; |
| 30 | import { jargonIn, visibleText } from "./helpers/jargon.ts"; | |
| 30 | 31 | import { passkeyFields } from "./helpers/passkey.ts"; |
| 31 | 32 | |
| 32 | 33 | quietLogs(); |
| @@ -186,6 +187,12 @@ describe("the first login to a spawned forge", () => { | ||
| 186 | 187 | expect(getUserSetting(parent.db, alice.id, "first_step_opened_app")).toBeUndefined(); |
| 187 | 188 | }); |
| 188 | 189 | |
| 190 | test("the page a new forge's first login lands on has no jargon", async () => { | |
| 191 | const text = visibleText(await page(owner)); | |
Only the owner view is checked, and only visible text. Cover attributes and the other roles that land here. |
||
| 192 | expect(text).toContain("Your next steps"); | |
| 193 | expect(jargonIn(text)).toEqual([]); | |
| 194 | }); | |
| 195 | ||
| 189 | 196 | test("a plain reader of the child sees no next-steps card", async () => { |
| 190 | 197 | const reader = await createUser(child.db, { |
| 191 | 198 | origin: "seed", |
| @@ -196,7 +203,9 @@ describe("the first login to a spawned forge", () => { | ||
| 196 | 203 | }); |
| 197 | 204 | if (!reader.ok) throw new Error("reader"); |
| 198 | 205 | const session = createSession(child.db, reader.value.id); |
| 199 | expect(await page(`forge_session=${session.token}`)).not.toContain(CARD); | |
| 206 | const home = await page(`forge_session=${session.token}`); | |
| 207 | expect(home).not.toContain(CARD); | |
| 208 | expect(jargonIn(visibleText(home))).toEqual([]); | |
| 200 | 209 | }); |
| 201 | 210 | |
| 202 | 211 | test("after the claim, the home shows the crew and its direction, and one card with three steps, none done", async () => { |
| @@ -240,6 +249,7 @@ describe("the first login to a spawned forge", () => { | ||
| 240 | 249 | expect(home).toContain('href="/marias/bakery"'); |
| 241 | 250 | expect(home).not.toContain("Your apps arrive here"); |
| 242 | 251 | expect(home).toContain("Your crew has its direction:"); |
| 252 | expect(jargonIn(visibleText(home))).toEqual([]); | |
| 243 | 253 | // The admin's card moves along with it. |
| 244 | 254 | expect(steps(await page(owner)).everyday).toBe("yes"); |
| 245 | 255 | }); |
test/helpers/jargon.ts added +68
| @@ -0,0 +1,68 @@ | ||
| 1 | /** | |
| 2 | * Words a person who is not technical should not meet on the page a new | |
| 3 | * forge's first login lands on (#10712). A test guard, so it lives with the tests. One list, one finder: a test renders | |
| 4 | * that page and fails on any hit. Whole words only, case-insensitive, so | |
| 5 | * "cellar" never trips "cell". | |
| 6 | */ | |
| 7 | ||
| 8 | export const JARGON: readonly string[] = [ | |
| 9 | "egress", | |
| 10 | "sentinel", | |
| 11 | "shard", | |
| 12 | "shards", | |
| 13 | "cell", | |
| 14 | "cells", | |
| 15 | "gate", | |
| 16 | "gates", | |
| 17 | "rebase", | |
| 18 | "rebased", | |
| 19 | "tbw", | |
| 20 | "sandbox", | |
| 21 | "ledger", | |
| 22 | "daemon", | |
| 23 | "webhook", | |
| 24 | "mcp", | |
| 25 | "oauth", | |
| 26 | "ssh", | |
| 27 | "cron", | |
| 28 | "worktree", | |
| 29 | "upstream", | |
| 30 | "downstream", | |
| 31 | "quorum", | |
| 32 | "heartbeat", | |
| 33 | "preview", | |
| 34 | "migration", | |
| 35 | "namespace", | |
| 36 | "tarball", | |
| 37 | "token", | |
| 38 | "tokens", | |
| 39 | "palette", | |
| 40 | "model key", | |
| 41 | ]; | |
| 42 | ||
| 43 | const escape = (w: string) => w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); | |
| 44 | const PATTERN = new RegExp(`(?<![\\p{L}\\p{N}_-])(${JARGON.map(escape).join("|")})(?![\\p{L}\\p{N}_-])`, "giu"); | |
| 45 | ||
| 46 | const SPOKEN = /\b(?:aria-label|aria-description|title|alt|placeholder)\s*=\s*(?:"([^"]*)"|'([^']*)')/gi; | |
| 47 | ||
| 48 | /** What a reader sees or a screen reader speaks: the text, then the aria-label, title, alt and placeholder values. */ | |
| 49 | export function visibleText(html: string): string { | |
| 50 | const spoken = [...html.replace(/<(script|style|template)\b[\s\S]*?<\/\1>/gi, " ").matchAll(SPOKEN)].map((m) => m[1] ?? m[2] ?? ""); | |
| 51 | return `${bodyText(html)} ${spoken.join(" ")}`.replace(/\s+/g, " "); | |
| 52 | } | |
| 53 | ||
| 54 | function bodyText(html: string): string { | |
| 55 | return html | |
| 56 | .replace(/<(script|style|template)\b[\s\S]*?<\/\1>/gi, " ") | |
| 57 | .replace(/<!--[\s\S]*?-->/g, " ") | |
| 58 | .replace(/<[^>]*>/g, " ") | |
| 59 | .replace(/ /g, " ") | |
| 60 | .replace(/\s+/g, " "); | |
| 61 | } | |
| 62 | ||
| 63 | /** Every jargon word found in `text`, lower-cased, once each, in order of first appearance. */ | |
| 64 | export function jargonIn(text: string): string[] { | |
| 65 | const found = new Set<string>(); | |
| 66 | for (const m of text.matchAll(PATTERN)) found.add(m[1]!.toLowerCase()); | |
| 67 | return [...found]; | |
| 68 | } |
test/jargon.test.ts added +22
| @@ -0,0 +1,22 @@ | ||
| 1 | import { describe, expect, test } from "bun:test"; | |
| 2 | import { jargonIn, visibleText } from "./helpers/jargon.ts"; | |
| 3 | ||
| 4 | describe("the jargon finder", () => { | |
| 5 | test("matches whole words, case-insensitively", () => { | |
| 6 | expect(jargonIn("Egress and a Gate, then TBW")).toEqual(["egress", "gate", "tbw"]); | |
| 7 | }); | |
| 8 | test("does not match inside words", () => { | |
| 9 | expect(jargonIn("cellar, gateway, sentinels-of-old, rebased_x, shardy")).toEqual([]); | |
| 10 | }); | |
| 11 | test("reads only visible text", () => { | |
| 12 | const html = '<script>egress()</script><style>.cell{}</style><!-- shard --><a href="/gate">Your apps</a>'; | |
| 13 | expect(jargonIn(visibleText(html))).toEqual([]); | |
| 14 | }); | |
| 15 | }); | |
| 16 | ||
| 17 | describe("spoken text", () => { | |
| 18 | test("aria-label, title, alt and placeholder are checked too", () => { | |
| 19 | const html = '<button aria-label="Open the palette"></button><img alt="shard"><a title=\'sentinel\'>x</a><input placeholder="egress">'; | |
| 20 | expect(jargonIn(visibleText(html))).toEqual(["palette", "shard", "sentinel", "egress"]); | |
| 21 | }); | |
| 22 | }); |
test/now-links.test.ts +2 −2
| @@ -119,8 +119,8 @@ const MENU_TITLES: Record<string, string> = { | ||
| 119 | 119 | Migrate: "Migrate", |
| 120 | 120 | "New forge": "New forge", |
| 121 | 121 | Settings: "Settings", |
| 122 | "Access tokens": "Personal access tokens", | |
| 123 | "SSH keys": "SSH keys", | |
| 122 | "Access keys": "Access keys", | |
| 123 | "Terminal keys": "Terminal keys", | |
outdated
The expected title was changed to keep the test green over a label/title mismatch. Fix the page title instead and make this entry match the label. |
||
| 124 | 124 | Origins: "Origins", |
| 125 | 125 | Crew: "Crew", |
| 126 | 126 | Boards: "Boards", |
test/onboarding.test.ts +1 −1
| @@ -123,7 +123,7 @@ describe("onboarding: a person with just a login", () => { | ||
| 123 | 123 | const pageHtml = await ( |
| 124 | 124 | await fetch(`${base}/settings/tokens`, { headers: { cookie } }) |
| 125 | 125 | ).text(); |
| 126 | expect(pageHtml).toContain("Personal access tokens"); | |
| 126 | expect(pageHtml).toContain("Access keys"); | |
| 127 | 127 | |
| 128 | 128 | // Post-redirect-get: minting redirects, and the secret rides a one-shot |
| 129 | 129 | // flash cookie so a refresh shows the list instead of minting again. |
test/palette-repos.test.ts +1 −1
| @@ -117,7 +117,7 @@ test("a visitor's palette holds places to go and Sign in; a signed-in one holds | ||
| 117 | 117 | expect(out.map((i) => i.t)).toEqual(["Home", "Apps", "Explore", "Forge packs", "Front page", "Search", "Sign in"]); |
| 118 | 118 | expect(out.find((i) => i.t === "Sign in")!.h).toBe("/signin"); |
| 119 | 119 | const inn = (await rows({ cookie }, "/explore")).map((i) => i.t); |
| 120 | for (const t of ["New app", "New repository", "Migrate a repository", "New organization", "What you asked for", "Account settings", "Access tokens", "SSH keys", "Origins", "Map"]) expect(inn).toContain(t); | |
| 120 | for (const t of ["New app", "New repository", "Migrate a repository", "New organization", "What you asked for", "Account settings", "Access keys", "Terminal keys", "Origins", "Map"]) expect(inn).toContain(t); | |
| 121 | 121 | expect(inn).not.toContain("Sign in"); |
| 122 | 122 | }); |
| 123 | 123 |
test/palette-roster.test.ts +3 −3
| @@ -89,7 +89,7 @@ test("a site-admin person is offered the whole roster", () => { | ||
| 89 | 89 | ["confirms", "Confirms", "what the forge's agent asked to do; y does it once"], |
| 90 | 90 | ["trusted", "Trusted sources", "who folds in without review; a trusts, x removes, s stops all, v reverts"], |
| 91 | 91 | ["conversations", "Conversations", "your talks with the forge's agent; n starts one, r renames, x archives"], |
| 92 | ["ssh-keys", "SSH keys", "list, add and remove the keys that sign in as you"], | |
| 92 | ["ssh-keys", "Terminal keys", "list, add and remove the keys that sign in as you"], | |
| 93 | 93 | ["passkeys", "Passkeys", "the passkeys that sign in as you"], |
| 94 | 94 | ["account", "Account settings", undefined], |
| 95 | 95 | ["signins", "Signed in", "your browsers and tokens; d signs a browser out"], |
| @@ -206,7 +206,7 @@ test("a site-admin agent is offered the roster without the person-only entries", | ||
| 206 | 206 | ["asked", "Asked", "your thoughts and what became of them"], |
| 207 | 207 | ["thought-notes", "Notes", "write an idea and watch it become shipped work"], |
| 208 | 208 | ["decider", "Decider", "what it closed, deferred and asked you about today"], |
| 209 | ["ssh-keys", "SSH keys", "list, add and remove the keys that sign in as you"], | |
| 209 | ["ssh-keys", "Terminal keys", "list, add and remove the keys that sign in as you"], | |
| 210 | 210 | ["account", "Account settings", undefined], |
| 211 | 211 | ["signins", "Signed in", "your browsers and tokens; d signs a browser out"], |
| 212 | 212 | ["sentinel", "Sentinel", "the forge's open faults"], |
| @@ -291,7 +291,7 @@ test("a member person is offered the signed-in roster without the admin entries" | ||
| 291 | 291 | ["notify", "Phone notifications", "where the crew reaches your phone; s sets, x turns off"], |
| 292 | 292 | ["confirms", "Confirms", "what the forge's agent asked to do; y does it once"], |
| 293 | 293 | ["conversations", "Conversations", "your talks with the forge's agent; n starts one, r renames, x archives"], |
| 294 | ["ssh-keys", "SSH keys", "list, add and remove the keys that sign in as you"], | |
| 294 | ["ssh-keys", "Terminal keys", "list, add and remove the keys that sign in as you"], | |
| 295 | 295 | ["passkeys", "Passkeys", "the passkeys that sign in as you"], |
| 296 | 296 | ["account", "Account settings", undefined], |
| 297 | 297 | ["signins", "Signed in", "your browsers and tokens; d signs a browser out"], |
test/spawn-child-apps.test.ts +6 −6
| @@ -175,18 +175,18 @@ describe("a spawned child's apps", () => { | ||
| 175 | 175 | ).replace(/\s+/g, " "); |
| 176 | 176 | expect(home).toContain("bakery"); |
| 177 | 177 | expect(home).not.toContain("No apps yet"); |
| 178 | expect(home).toContain("The crew has no model key yet"); | |
| 178 | expect(home).toContain("The crew has no AI key yet"); | |
| 179 | 179 | expect(home).toContain('href="/settings/subscriptions"'); |
| 180 | 180 | const appPage = await ( |
| 181 | 181 | await fetch(`${servers.url}/marias/bakery`, { headers: { cookie } }) |
| 182 | 182 | ).text(); |
| 183 | expect(appPage).toContain("The crew has no model key yet"); | |
| 183 | expect(appPage).toContain("The crew has no AI key yet"); | |
| 184 | 184 | }); |
| 185 | 185 | |
| 186 | 186 | test("on the app page the key note is an owner fact: not for a stranger or a plain reader", async () => { |
| 187 | 187 | const anonymous = await (await fetch(`${servers.url}/marias/bakery`)).text(); |
| 188 | 188 | expect(anonymous).toContain("bakery"); |
| 189 | expect(anonymous).not.toContain("The crew has no model key yet"); | |
| 189 | expect(anonymous).not.toContain("The crew has no AI key yet"); | |
| 190 | 190 | const reader = await createUser(child.db, { origin: "seed", trusted: true, |
| 191 | 191 | username: "reader", |
| 192 | 192 | email: "[email protected]", |
| @@ -201,14 +201,14 @@ describe("a spawned child's apps", () => { | ||
| 201 | 201 | }) |
| 202 | 202 | ).text(); |
| 203 | 203 | expect(asReader).toContain("bakery"); |
| 204 | expect(asReader).not.toContain("The crew has no model key yet"); | |
| 204 | expect(asReader).not.toContain("The crew has no AI key yet"); | |
| 205 | 205 | // Nor on the home: there the note is for an admin or a writer of an app. |
| 206 | 206 | const readerHome = await ( |
| 207 | 207 | await fetch(`${servers.url}/`, { |
| 208 | 208 | headers: { cookie: `forge_session=${session.token}` }, |
| 209 | 209 | }) |
| 210 | 210 | ).text(); |
| 211 | expect(readerHome).not.toContain("The crew has no model key yet"); | |
| 211 | expect(readerHome).not.toContain("The crew has no AI key yet"); | |
| 212 | 212 | }); |
| 213 | 213 | |
| 214 | 214 | test("first boot registers apps as the founder, an account with no verified email", () => { |
| @@ -262,6 +262,6 @@ describe("a spawned child's apps", () => { | ||
| 262 | 262 | const home = await ( |
| 263 | 263 | await fetch(`${servers.url}/`, { headers: { cookie } }) |
| 264 | 264 | ).text(); |
| 265 | expect(home).not.toContain("The crew has no model key yet"); | |
| 265 | expect(home).not.toContain("The crew has no AI key yet"); | |
| 266 | 266 | }); |
| 267 | 267 | }); |
test/ssh-site.test.ts +1 −1
| @@ -95,7 +95,7 @@ describe("the terminal on the website", () => { | ||
| 95 | 95 | r.text(), |
| 96 | 96 | ); |
| 97 | 97 | expect(page).not.toContain("terminal-line"); |
| 98 | expect(page).toContain('<a class="small" href="/settings/keys">SSH keys</a>'); | |
| 98 | expect(page).toContain('<a class="small" href="/settings/keys">Terminal keys</a>'); | |
| 99 | 99 | expect(page).toContain("host key SHA256:"); |
| 100 | 100 | }); |
| 101 | 101 |
test/tui-signins-token.test.ts +1 −1
| @@ -108,7 +108,7 @@ describe("revoking a token from the sign-ins screen", () => { | ||
| 108 | 108 | expect(seen.filter((e) => e.kind === "token.deleted")).toEqual([]); |
| 109 | 109 | expect(h.text()).toContain("alice-ci · ro"); |
| 110 | 110 | await h.press("d", "right", "enter"); |
| 111 | expect(h.text()).toContain("Revoked that token."); | |
| 111 | expect(h.text()).toContain("Revoked that access key."); | |
| 112 | 112 | expect(verifyToken(forge.db, ci.token).ok).toBe(false); |
| 113 | 113 | expect(seen.filter((e) => e.kind === "token.deleted").map((e) => e.payload)).toEqual([{ tokenId: ci.id }]); |
| 114 | 114 | stop(); |
test/tui-sshkeys.test.ts +3 −3
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /** |
| 2 | * SSH keys in the terminal (#7242): your own keys listed, one added, a bad | |
| 2 | * Your terminal keys, managed from the terminal (#7242): your own keys listed, one added, a bad | |
| 3 | 3 | * line refused in MCP's words, one removed after a confirm. |
| 4 | 4 | */ |
| 5 | 5 | import { afterAll, beforeAll, describe, expect, test } from "bun:test"; |
| @@ -27,7 +27,7 @@ const line = (fill: number, comment = "") => { | ||
| 27 | 27 | return `ssh-ed25519 ${blob.toString("base64")} ${comment}`.trim(); |
| 28 | 28 | }; |
| 29 | 29 | |
| 30 | describe("SSH keys in the terminal", () => { | |
| 30 | describe("terminal keys, managed from the terminal", () => { | |
| 31 | 31 | let dataDir: string; |
| 32 | 32 | let app: App; |
| 33 | 33 | |
| @@ -62,7 +62,7 @@ describe("SSH keys in the terminal", () => { | ||
| 62 | 62 | open: async function () { |
| 63 | 63 | key("k", true); |
| 64 | 64 | await settleApp(tui); |
| 65 | await this.type("SSH keys"); | |
| 65 | await this.type("Terminal keys"); | |
| 66 | 66 | await this.press("enter"); |
| 67 | 67 | }, |
| 68 | 68 | stop: () => tui.stop(), |
test/tui-token-make.test.ts +2 −2
| @@ -115,7 +115,7 @@ describe("making a token in the terminal", () => { | ||
| 115 | 115 | await h.press("backspace", "backspace"); |
| 116 | 116 | await h.type("admin"); |
| 117 | 117 | await h.press("enter"); |
| 118 | expect(h.text()).toContain("Only an admin can make a token"); | |
| 118 | expect(h.text()).toContain("Only an admin can make an access key"); | |
| 119 | 119 | expect(listTokens(forge.db, getUserByName(forge.db, "carol")!.id).length).toBe(before); |
| 120 | 120 | h.stop(); |
| 121 | 121 | }); |
| @@ -149,7 +149,7 @@ describe("making a token in the terminal", () => { | ||
| 149 | 149 | await h.open(); |
| 150 | 150 | const before = count("carol"); |
| 151 | 151 | await h.press("m", "backspace", "backspace", "backspace", "backspace", "backspace", "enter"); |
| 152 | expect(h.text()).toContain("A token needs a name."); | |
| 152 | expect(h.text()).toContain("An access key needs a name."); | |
| 153 | 153 | await h.type("x".repeat(65)); |
| 154 | 154 | await h.press("enter"); |
| 155 | 155 | expect(h.text()).toContain("Keep the name to 64 characters."); |
The menu was renamed, but the destination pages' bodies still say 'SSH' and 'token' (e.g. the keys page text). Rename the whole surface or keep the old label; a person who clicks should meet the same word.