Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4260880
List shared phrases once in the combined Phrase Bank, Quick Lookup an…
claude Nov 21, 2026
052814a
Refresh README features and routes
claude Nov 21, 2026
b7547fe
Protect saved data on iPhone and tidy PWA phone details
claude Nov 21, 2026
6ec6226
Merge branch 'wt/pwa-phone' into claude/project-thread-kog66v
claude Nov 21, 2026
2ab6a46
Drill: 1/3/7-day review spacing and a progress section
claude Nov 21, 2026
400a4ba
Merge branch 'wt/drill' into claude/project-thread-kog66v
claude Nov 21, 2026
f1267e0
Give dead ends a way forward and tidy card navigation on phones
claude Nov 21, 2026
227a9dd
Add iPhone WebKit smoke tests, CI job and manual iPhone checklist
claude Nov 21, 2026
5eacbc8
Merge branch 'wt/e2e-tests' into claude/project-thread-kog66v
claude Nov 21, 2026
d22ec87
Merge branch 'wt/design' into claude/project-thread-kog66v
claude Nov 21, 2026
e3912a6
README: add the iPhone, drill, design and smoke test notes
claude Nov 21, 2026
a0a8a7f
e2e: centre the Library row before tapping; check the offline precach…
claude Nov 21, 2026
c7ea067
Keep shared lines findable by situation and by every tone they carry
claude Nov 21, 2026
18a747c
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 21, 2026
9b76d94
Fit drill gap labels on one line, title unknown cards plainly, tidy H…
claude Nov 21, 2026
7a95239
Add iOS launch screens, clear landscape notches, allow rotation
claude Nov 21, 2026
c7dff69
Polish segmented controls, sheets, docks and desktop alignment
claude Nov 21, 2026
682d9c0
Merge branch 'worktree-agent-a5e981185e90ef8cb' into claude/project-t…
claude Nov 21, 2026
842d738
Match accessible names to visible labels and speed up first load
claude Nov 21, 2026
4c3ebe0
Merge branch 'worktree-agent-a7167fa20d8b54a2b' into claude/project-t…
claude Nov 21, 2026
c795d1d
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 21, 2026
01df28b
Merge pull request #137 from BigSimmo/claude/project-thread-jd5e60
BigSimmo Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/e2e-webkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: iPhone Safari smoke tests

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
group: e2e-webkit-${{ github.ref }}
cancel-in-progress: true

jobs:
webkit:
name: Playwright (WebKit, iPhone 15)
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout Codebase
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

# Version comes from packageManager in package.json
- name: Setup pnpm
uses: pnpm/action-setup@v6

- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Install WebKit
working-directory: artifacts/tc-reference
run: pnpm exec playwright install --with-deps webkit

- name: Build production app
run: pnpm --filter @workspace/tc-reference build

- name: Run smoke tests in WebKit
working-directory: artifacts/tc-reference
env:
E2E_SKIP_BUILD: "1"
run: pnpm run test:e2e --project iphone-webkit

- name: Upload failure report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-webkit-results
path: artifacts/tc-reference/test-results/
retention-days: 7
if-no-files-found: ignore
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ Thumbs.db
/artifacts/tc-reference/public/cards/TC*/TC*_Phrase_Bank.csv
/artifacts/tc-reference/public/cards/TC*/TC*_Anki_Flashcards.csv
!/artifacts/tc-reference/public/cards/TC001/**

# Playwright output
test-results/
playwright-report/
56 changes: 41 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ A mobile-first reference app for 107 communication techniques. It runs entirely

- 107 technique cards (voice/presence, influence/framing, clarity/direction, connection/warmth, resilience/recovery)
- Library with category, impact and difficulty filters, sort controls and a live result count
- Phrase Bank (4,000+ phrases, filterable by tone and full-text searchable)
- **Start here**: a guided path through the 15 core cards, with progress kept on the device
- **Help me right now**: pick what is happening (eight common situations) and get one move, three lines to say, what to do next and one thing to avoid, without loading a full card
- Phrase Bank (about 4,500 lines, filterable by tone and length and searchable); a line that several cards share is listed once, under its first card
- Daily drill: pick a track (Core 15, one category, a playbook or everything) and a pace, rate each technique Not yet, Getting there or Confident, and review it again when it comes due; streak tracking and undo included
- Playbooks: chain techniques into your own step-by-step guides
- Favourites for cards and phrases via localStorage persistence
- Playbooks: chain techniques into your own step-by-step guides, or start from a template
- Saved: keep cards and phrases (a line saved from any card that lists it shows as saved everywhere)
- Quick Lookup overlay for fast in-conversation phrase recall, scoped to the open card with one tap to widen to all cards
- Full-screen search at `/search` (the search button, or `Cmd+K` / `Ctrl+K`) across techniques, phrases and playbooks: it matches as you type, keeps the search in the address so Back returns to your results, forgives typos and word forms, and maps everyday words to card vocabulary through a hand-kept synonym list (`artifacts/tc-reference/src/lib/search-synonyms.ts`), and left/right arrow keys to step between cards
- Light/dark theme persistence
- Back up and restore your data: export favourites, drill progress, playbooks and settings to a JSON file from the Favourites page, and import it on any device
- Full-screen search at `/search` (the search button, or `Cmd+K` / `Ctrl+K`) across techniques, phrases and playbooks: it matches as you type, keeps the search in the address so Back returns to your results, forgives typos and word forms, and maps everyday words to card vocabulary through a hand-kept synonym list (`artifacts/tc-reference/src/lib/search-synonyms.ts`); left/right arrow keys step between cards
- Settings (from the Saved page): light/dark theme, larger phrase text, drill track, offline status and backup
- Back up and restore your data: export saved items, drill progress, playbooks and settings to a JSON file, and import it on any device
- Mobile-first navigation with a bottom tab bar, 44px touch targets and safe-area (notch) support
- Installable PWA: the app shell, global search, the Phrase Bank and Quick Lookup work offline after the first visit (a slim card text index is precached); full card pages and downloads work offline once they have been opened while online, and **Save all cards for offline** on the Favourites page saves every card (about 4 MB) in one step; downloads stay on demand
- Installable PWA: the app shell, global search, the Phrase Bank and Quick Lookup work offline after the first visit (a slim card text index is precached); full card pages and downloads work offline once they have been opened while online, and **Save all cards for offline** in Settings saves every card (about 4 MB) in one step; downloads stay on demand

- On iPhone, add the app to your Home Screen so Safari doesn't clear your saved progress. The app asks the browser to keep its storage, shows a one-time Add to Home Screen hint in Safari, and reminds you to export a backup if you haven't for 30 days
- Daily Drill reviews come back after 1, 3 or 7 days (Not yet, Getting there, Confident) and then grow further apart; the Drill page's **Your progress** section counts techniques by status, overall and per category
- Each card's Use it tab ends with related techniques; missing pages, unknown cards and cards that fail to load offer a way forward (Try again, search, Help me right now)

---

Expand Down Expand Up @@ -122,6 +128,14 @@ node --test scripts/code-reviewer.test.mjs scripts/local-process-identity.test.m
pnpm --filter @workspace/tc-reference test
```

Browser smoke tests (Playwright, iPhone 15 emulation). CI runs the WebKit project; locally only Chromium may be installed:

```bash
pnpm --filter @workspace/tc-reference run test:e2e --project iphone-chromium
```

The manual iPhone pass (VoiceOver, larger text, offline, install) is in [docs/iphone-test-checklist.md](docs/iphone-test-checklist.md).

Before installing dependencies, run agent instruction and skill packaging checks directly:

```bash
Expand Down Expand Up @@ -182,14 +196,26 @@ This is what Railway runs. For a quick local check, `serve` still runs

## Routes

| Path | Screen |
| --------------- | ---------------------------------------- |
| `/` | Library |
| Path | Screen |
| --------------- | ----------------------------------------------------- |
| `/` | Library |
| `/start` | Start here: the core cards in order |
| `/help` | Help me right now: pick a situation |
| `/help/:id` | One situation's move and lines |
| `/card/:cardId` | Full technique card (e.g. `/card/TC001`) |
| `/phrases` | Phrase Bank |
| `/drill` | Daily drill |
| `/playbooks` | Your playbooks and templates |
| `/favourites` | Saved cards and phrases (tab label "Saved"), Settings |
| `/search` | Full-screen search (`?q=` keeps the query) |

--------------- | ---------------------------------------- |
| `/` | Library |
| `/card/:cardId` | Full technique card (e.g. `/card/TC001`) |
| `/phrases` | Phrase browser |
| `/drill` | Daily drill screen |
| `/favourites` | Saved cards and phrases |
| `/playbooks` | Your saved technique playbooks |
| `/phrases` | Phrase browser |
| `/drill` | Daily drill screen |
| `/favourites` | Saved cards and phrases |
| `/playbooks` | Your saved technique playbooks |

---

Expand All @@ -198,5 +224,5 @@ This is what Railway runs. For a quick local check, `serve` still runs
TC Reference is a fully client-side SPA with no backend:

- Core card, phrase and drill data lives in `artifacts/tc-reference/src/lib`
- User state uses `localStorage` (favourites, drill progress, playbooks under `tc_playbooks`, theme)
- User state uses `localStorage` (saved items under `tc_favourites`, drill progress, playbooks under `tc_playbooks`, preferences under `tc_preferences`, theme)
- No backend or credentials are required
48 changes: 48 additions & 0 deletions artifacts/tc-reference/e2e/fixtures.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { expect, test as base, type Page } from "@playwright/test";

/** Main routes every smoke pass visits. */
export const MAIN_ROUTES = [
"/",
"/card/TC028",
"/help",
"/help/say-no",
"/search",
"/phrases",
"/drill",
"/playbooks",
"/favourites",
"/start",
] as const;

/**
* Grant clipboard access where the engine supports the permission names.
* Chromium needs them for navigator.clipboard; WebKit has no such permission
* and allows writes from a user gesture on a secure (localhost) origin.
*/
export const test = base.extend<{ clipboard: boolean }>({
clipboard: async ({ context, browserName }, use) => {
const granted = browserName === "chromium";
if (granted) {
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
}
await use(granted);
},
});

export { expect };

/**
* Wait until the service worker has installed its precache and controls the
* page. The worker is in "prompt" mode (no clients.claim), so the first
* visit is only controlled after one reload, as on a real phone.
*/
export async function waitForServiceWorker(page: Page) {
await page.evaluate(async () => {
await navigator.serviceWorker.ready;
});
if (await page.evaluate(() => !!navigator.serviceWorker.controller)) return;
await page.reload();
await expect
.poll(() => page.evaluate(() => !!navigator.serviceWorker.controller))
.toBe(true);
}
168 changes: 168 additions & 0 deletions artifacts/tc-reference/e2e/layout.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
import { test, expect, MAIN_ROUTES } from "./fixtures";

/** Wait for the route's content (lazy chunks, card loader) to settle. */
async function settle(page: import("@playwright/test").Page) {
await expect(page.getByRole("heading", { level: 1 }).first()).toBeVisible();
await expect(page.locator('[aria-busy="true"]')).toHaveCount(0);
}

for (const route of MAIN_ROUTES) {
test(`${route} has no console errors and no sideways scroll`, async ({
page,
}) => {
const errors: string[] = [];
page.on("console", (msg) => {
if (msg.type() === "error") errors.push(msg.text());
});
page.on("pageerror", (err) => errors.push(err.message));

const response = await page.goto(route);
expect(response?.status(), "HTTP status").toBe(200);
await settle(page);

expect(page.viewportSize()?.width).toBe(393);
const overflow = await page.evaluate(() => {
const root = document.documentElement;
return {
scrollWidth: root.scrollWidth,
clientWidth: root.clientWidth,
bodyScrollWidth: document.body.scrollWidth,
};
});
expect(overflow.scrollWidth).toBeLessThanOrEqual(overflow.clientWidth);
expect(overflow.bodyScrollWidth).toBeLessThanOrEqual(overflow.clientWidth);

expect(errors).toEqual([]);
});
}

test("tab bar sits on the bottom edge and pads for the home indicator", async ({
page,
}) => {
await page.goto("/");
const viewport = await page.evaluate(() => ({
fit: document
.querySelector('meta[name="viewport"]')
?.getAttribute("content"),
height: window.innerHeight,
}));
// viewport-fit=cover is what makes env(safe-area-inset-*) non-zero on iPhone
expect(viewport.fit).toContain("viewport-fit=cover");

const bar = page.getByRole("navigation", { name: "Main navigation" });
await expect(bar).toBeVisible();
const box = await bar.boundingBox();
expect(box).not.toBeNull();
expect(Math.round(box!.y + box!.height)).toBe(viewport.height);

const padding = await bar.evaluate((el) => {
// Resolve the same expression the bar uses with a known inset, to prove
// the gap follows env(safe-area-inset-bottom) rather than a fixed value.
const probe = document.createElement("div");
probe.style.paddingBottom = "var(--tabbar-gap)";
el.appendChild(probe);
const resolved = getComputedStyle(probe).paddingBottom;
probe.remove();
const rules = [...document.styleSheets].flatMap((sheet) => {
try {
return [...sheet.cssRules].map((rule) => rule.cssText);
} catch {
return [];
}
});
return {
actual: parseFloat(getComputedStyle(el).paddingBottom),
resolved: parseFloat(resolved),
usesInset: rules.some((text) =>
/--tabbar-gap:[^;]*env\(safe-area-inset-bottom/.test(text),
),
};
});
expect(padding.usesInset).toBe(true);
// Emulators report a zero inset, so the 8px floor applies; on a real
// iPhone the home indicator inset (34px) is larger and wins.
expect(padding.actual).toBeGreaterThanOrEqual(8);
expect(padding.actual).toBe(padding.resolved);

// Every destination is reachable with one tap
for (const name of ["Library", "Phrases", "Drill", "Playbooks", "Saved"]) {
await expect(
bar.getByRole("link", { name: new RegExp(`^${name}`) }),
).toBeVisible();
}
});

test.describe("landscape iPhone with a notch", () => {
// iPhone 15 turned sideways: 852pt wide, so the sidebar layout. iOS reports
// a 59pt inset on both sides and 21pt for the home indicator.
const INSET = 59;
test.use({ viewport: { width: 852, height: 393 } });

for (const route of ["/", "/card/TC028", "/phrases", "/search"]) {
test(`${route} keeps content out of the side safe areas`, async ({
page,
browserName,
}) => {
// Only Chromium can emulate safe-area insets (via CDP).
test.skip(browserName !== "chromium", "needs CDP safe-area override");
const cdp = await page.context().newCDPSession(page);
await cdp.send("Emulation.setSafeAreaInsetsOverride", {
insets: { top: 0, left: INSET, right: INSET, bottom: 21 },
});
await page.goto(route);
await expect(page.locator("h1").first()).toBeVisible();
await expect(page.locator('[aria-busy="true"]')).toHaveCount(0);

const intruders = await page.evaluate((inset) => {
const found: string[] = [];
const selector = "h1, h2, h3, p, a, button, input, [role=tab]";
for (const el of document.querySelectorAll<HTMLElement>(selector)) {
const r = el.getBoundingClientRect();
if (!r.width || !r.height) continue;
// Rows that scroll sideways may run under the edges by design.
if (el.closest("[class*='overflow-x-auto']")) continue;
if (r.left < inset - 0.5 || r.right > innerWidth - inset + 0.5) {
const text = (el.textContent ?? "").trim().slice(0, 30);
found.push(
`${el.tagName} "${text}" ${Math.round(r.left)}-${Math.round(r.right)}`,
);
}
}
return found;
}, INSET);
expect(intruders).toEqual([]);
});
}
});

test("iOS gets a launch screen for this iPhone, and the manifest allows rotation", async ({
page,
request,
}) => {
await page.goto("/");
const links = await page.evaluate(() =>
[
...document.querySelectorAll<HTMLLinkElement>(
'link[rel="apple-touch-startup-image"]',
),
].map((link) => ({ href: link.href, media: link.media })),
);
expect(links.length).toBeGreaterThan(5);
// Exactly one image is for the iPhone 15 screen (393x852pt @3x). The test
// runner's emulated screen is the viewport, so match the query text rather
// than asking matchMedia.
const iphone15 = links.filter(
(l) =>
l.media.includes("(device-width: 393px)") &&
l.media.includes("(device-height: 852px)") &&
l.media.includes("(-webkit-device-pixel-ratio: 3)"),
);
expect(iphone15).toHaveLength(1);
expect(iphone15[0].href).toMatch(/\/splash\/launch-1179x2556\.png$/);
const image = await request.get(iphone15[0].href);
expect(image.status()).toBe(200);
expect(image.headers()["content-type"]).toContain("image/png");

const manifest = await (await request.get("/manifest.webmanifest")).json();
expect(manifest.orientation ?? "any").toBe("any");
});
Loading
Loading