Skip to content

Commit 4a1d70f

Browse files
committed
Polish hosted showcase and image handling
1 parent 283d036 commit 4a1d70f

32 files changed

Lines changed: 5036 additions & 1163 deletions

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Summary
22

3-
-
3+
-
44

55
## Verification
66

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ jobs:
2424
- name: Install dependencies
2525
run: npm ci
2626

27-
- name: Typecheck and test
27+
- name: Check formatting
28+
run: npm run format:check
29+
30+
- name: Typecheck, lint, and test
2831
run: npm run verify
2932

3033
- name: Expo dependency compatibility

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.expo
3+
dist
4+
coverage
5+
docs
6+
package-lock.json
7+
*.hbc

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 80,
5+
"tabWidth": 2,
6+
"semi": true
7+
}

AGENTS.md

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
1-
# Project Instructions
1+
# Agent Guide
22

3-
- Use Node 22 via `nvm use`; `.nvmrc` intentionally tracks the latest Node 22 line.
4-
- Use the Expo SDK 56 docs at https://docs.expo.dev/versions/v56.0.0/ before changing Expo or React Native behavior.
5-
- Keep the take-home focused: typed mock API boundaries, accessible React Native UI, and tests for order and sharing behavior.
3+
Instructions for AI agents and contributors working in this repository. Keep
4+
changes small, typed, tested, and consistent with the patterns described below.
5+
6+
## Setup and commands
7+
8+
- Use **Node 22** via `nvm use` (`.nvmrc` tracks the latest Node 22 line, and
9+
`engines` pins `>=22.13.0 <23`). Install dependencies with `npm ci`.
10+
- Consult the **Expo SDK 56** documentation
11+
(https://docs.expo.dev/versions/v56.0.0/) before modifying any Expo or React
12+
Native behavior. Add native dependencies with `npx expo install` rather than a
13+
bare `npm install`, so versions remain SDK-compatible.
14+
- Run the application with `npm run ios`, `npm run android`, or `npm run web`.
15+
- Keep the following commands green before every pull request or material change:
16+
- `npm run verify` — strict `tsc --noEmit` followed by Jest with coverage.
17+
- `make expo-check` — confirms installed versions match Expo SDK 56.
18+
- Coverage thresholds are enforced (branches 80, functions 90, lines and
19+
statements 95). Add tests to meet them rather than lowering the thresholds.
20+
21+
## Architecture and layering
22+
23+
Dependencies point downward only; a layer must not reference the layers above it.
24+
25+
```
26+
App.tsx (QueryClientProvider + error boundary)
27+
OrdersExperience navigation.ts — NavigationContainer + native stack
28+
Container components connect TanStack Query hooks and navigation params
29+
Screen components presentational, props-in, no data fetching
30+
features/orders/queries.ts server-state hooks (useOrders / useOrder)
31+
services/ordersApi.ts mock API boundary that validates with Zod
32+
domain/orders/* pure: schema, inferred types, selectors, formatters
33+
components/ + theme/ UI primitives and design tokens
34+
```
35+
36+
- The `domain/` layer is pure: it contains no React and no I/O, so business
37+
logic remains unit-testable without a renderer.
38+
- Zod is the single source of truth. `schema.ts` defines the runtime contract
39+
and `types.ts` infers the domain types from it. Edit the schema, not the types.
40+
- Validate at the boundary. `ordersApi` parses responses through the schema so
41+
untrusted data never enters the domain untyped.
42+
- Server data is not component state. Fetching, caching, retry, and refetch are
43+
owned by TanStack Query (`queries.ts`); screens receive data through container
44+
props.
45+
- Screens are presentational. Containers own data and navigation, while screens
46+
own layout and interaction, which keeps screens straightforward to test.
47+
- Pass identifiers as typed route params, not globals. `orderId` travels through
48+
the navigation route defined in `navigation.ts`, which also enables `gametime://`
49+
deep links.
50+
51+
## Conventions
52+
53+
- Use the design tokens in `src/theme/tokens.ts` rather than hardcoded
54+
per-screen colors.
55+
- Store and pass monetary values as integer cents, and format them only at the
56+
edge with `formatMoney`. Represent dates as ISO strings.
57+
- Accessibility is required: provide meaningful `accessibilityLabel` and
58+
`accessibilityRole` values on interactive elements, and maintain touch targets
59+
of at least 44pt.
60+
- Follow the testing pyramid: cover pure logic in `domain/` with unit tests for
61+
each path, and cover hooks, containers, and screens with behavior tests using
62+
React Testing Library. Mock only at the API and native-module boundaries, never
63+
internal modules.
64+
- Keep the project focused on its purpose: typed mock API boundaries, accessible
65+
React Native UI, and tests for order and sharing behavior.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ make verify
9292
make expo-check
9393
```
9494

95-
`make verify` runs TypeScript in strict mode plus the Jest suite with coverage
96-
thresholds: 95% statements, 95% lines, 90% functions, and 80% branches.
95+
`make verify` runs TypeScript in strict mode, ESLint, and the Jest suite with
96+
coverage thresholds: 95% statements, 95% lines, 90% functions, and 80% branches.
9797
`make expo-check` verifies Expo SDK package compatibility.
9898

9999
## Architecture
@@ -147,7 +147,7 @@ and responsive layouts that also hold up in Expo's web preview.
147147
flowchart LR
148148
Rules[AGENTS.md + Node 22] --> Build[Expo React Native implementation]
149149
Build --> Verify[make verify]
150-
Verify --> Coverage[43 tests + coverage gate]
150+
Verify --> Coverage[46 tests + coverage gate]
151151
Coverage --> ExpoCheck[make expo-check]
152152
ExpoCheck --> Screens[Native iOS portrait + landscape screenshots]
153153
Screens --> CI[GitHub Actions CI]

app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"web": {
2525
"favicon": "./assets/favicon.png"
26-
}
26+
},
27+
"plugins": ["expo-image"]
2728
}
2829
}

docs/index.html

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
img {
5353
display: block;
54+
height: auto;
5455
max-width: 100%;
5556
}
5657

@@ -726,8 +727,8 @@ <h1>Built like a production GameTime mobile feature.</h1>
726727
/>
727728
</div>
728729
<div class="proof-row">
729-
<div class="proof"><strong>41</strong><span>Passing tests</span></div>
730-
<div class="proof"><strong>13</strong><span>Jest suites</span></div>
730+
<div class="proof"><strong>46</strong><span>Passing tests</span></div>
731+
<div class="proof"><strong>14</strong><span>Jest suites</span></div>
731732
<div class="proof"><strong>95</strong><span>Line coverage gate</span></div>
732733
</div>
733734
</aside>
@@ -753,9 +754,9 @@ <h2>Why this shape wins the review.</h2>
753754
<h3>Mobile first, not web disguised as mobile.</h3>
754755
<p>
755756
The React Native app uses safe areas, React Navigation native
756-
stack behavior, native share APIs, accessible press targets,
757-
and orientation-aware layouts. The web preview exists only as a
758-
reviewer convenience.
757+
stack behavior, cached event artwork, native share APIs,
758+
accessible press targets, and orientation-aware layouts. The
759+
web preview exists only as a reviewer convenience.
759760
</p>
760761
</article>
761762
<article class="card metric-card">
@@ -832,7 +833,7 @@ <h2>Layered to make tradeoffs obvious.</h2>
832833
<div class="layer-nodes">
833834
<div class="node">Runtime schemas with inferred TypeScript types</div>
834835
<div class="node">Selectors, receipt formatters, and ICS generation</div>
835-
<div class="node">FlashList timeline, receipt detail, and GameTime tokens</div>
836+
<div class="node">FlashList timeline, cached event artwork, and GameTime tokens</div>
836837
</div>
837838
</div>
838839
</div>
@@ -985,9 +986,10 @@ <h2>Portrait and landscape are first-class.</h2>
985986
<div class="eyebrow"><span class="spark" aria-hidden="true"></span> Quality Gates</div>
986987
<h2>Evidence before claims.</h2>
987988
<p>
988-
The implementation is backed by strict typing, tests around the
989-
highest-risk business behavior, enforced coverage thresholds,
990-
Expo compatibility checks, and native simulator screenshots.
989+
The implementation is backed by formatting checks, linting,
990+
strict typing, tests around the highest-risk business behavior,
991+
enforced coverage thresholds, Expo compatibility checks, and
992+
native simulator screenshots.
991993
</p>
992994
</div>
993995
<div class="grid grid-2">
@@ -1046,9 +1048,9 @@ <h2>Professional before the first file opens.</h2>
10461048
<span class="number">CI</span>
10471049
<h3>Verification is automated.</h3>
10481050
<p>
1049-
GitHub Actions installs with Node 22, runs strict TypeScript,
1050-
executes Jest with coverage thresholds, and checks Expo SDK
1051-
package compatibility.
1051+
GitHub Actions installs with Node 22, checks formatting, runs
1052+
strict TypeScript, lints the source, executes Jest with
1053+
coverage thresholds, and checks Expo SDK package compatibility.
10521054
</p>
10531055
</article>
10541056
<article class="card metric-card">
@@ -1119,9 +1121,9 @@ <h2>How Codex was used without losing engineering control.</h2>
11191121
<small>Verification</small>
11201122
<strong>Evidence before claims</strong>
11211123
<p>
1122-
The workflow runs typecheck, Jest coverage gates, Expo package
1123-
compatibility, native screenshots, CI, and Pages checks before
1124-
presenting the work as review-ready.
1124+
The workflow runs formatting checks, lint, typecheck, Jest
1125+
coverage gates, Expo package compatibility, native screenshots,
1126+
CI, and Pages checks before presenting the work as review-ready.
11251127
</p>
11261128
</article>
11271129
</div>

eslint.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ESLint flat config (ESLint 9). Expo's rules + Prettier compatibility.
2+
const expoConfig = require('eslint-config-expo/flat');
3+
const eslintConfigPrettier = require('eslint-config-prettier');
4+
5+
module.exports = [
6+
...expoConfig,
7+
eslintConfigPrettier,
8+
{
9+
ignores: [
10+
'node_modules/**',
11+
'dist/**',
12+
'.expo/**',
13+
'docs/**',
14+
'coverage/**',
15+
],
16+
},
17+
];

0 commit comments

Comments
 (0)