Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002) | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| 4 | import { isPhone } from "./phone.ts"; | |
| 5 | ||
| 6 | const headers = (values: Record<string, string>) => ({ get: (name: string) => values[name] ?? null }); | |
| 7 | ||
| 8 | test("a phone is told by its client hint, else its user agent", () => { | |
| 9 | assert.equal(isPhone(headers({ "sec-ch-ua-mobile": "?1" })), true); | |
| 10 | assert.equal(isPhone(headers({ "sec-ch-ua-mobile": "?0", "user-agent": "iPhone" })), false); | |
| 11 | assert.equal(isPhone(headers({ "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)" })), true); | |
| 12 | assert.equal(isPhone(headers({ "user-agent": "Mozilla/5.0 (Linux; Android 15; Pixel 9) Mobile Safari" })), true); | |
| 13 | assert.equal(isPhone(headers({ "user-agent": "Mozilla/5.0 (iPad; CPU OS 18_0)" })), false); | |
| 14 | assert.equal(isPhone(headers({ "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_0)" })), false); | |
| 15 | }); |
This file's history is long; its oldest lines are credited to the oldest commit read.