M1: phone app shell, settings, profile, dev login

Everything now renders inside a phone illustration on the entry screen,
with a five-tab bar. The frame lives in the root layout rather than one
page, so sign-in, onboarding and the job form are inside it too.

- Entry screen is the product running, not a marketing page: a live
  swipeable deck of real verified pros with a trade-filter strip above
  the card. deck.showcase is the only public procedure in that router
  and writes nothing, so an anonymous right swipe reaches no one.

- Settings: notification preferences (new table, defaults returned when
  no row exists), signed-in devices, GDPR export, deletion request.

  Closes the setEmail finding: an unverified address is no longer
  written to users.email, which is UNIQUE -- claiming a stranger's
  address used to block them from ever signing up with Google, and the
  uniqueness error leaked whether an address was registered. Now parked
  in email_change_requests until a token proves ownership.

- Profile: for a pro it leads with their REAL deck card, rendered by the
  same exported <Card> clients swipe, so the two cannot drift. Adds
  pro.previewCard (works at draft/pending, where publicProfile 404s) and
  pro.reorderMedia (photo position 0 is the deck card). Warns before an
  edit that would send a verified pro back for review, rather than after
  it silently drops them off the deck. Clients get a thin profile plus a
  route into pro onboarding -- supply is the launch blocker.

- Dev login: +34600000000 / 000000, behind THREE guards (NODE_ENV,
  an explicit ALLOW_DEV_LOGIN flag, and an exact number match). It
  overwrites the stored code rather than skipping verification, so the
  real expiry, attempt cap and single-use consumption still apply.

- Seed uses portrait photos. The cards previously showed picsum stock
  scenery -- a locksmith standing on a railway track.

Fixes found along the way: the card's name rendered ink-950 navy on a
dark photo because globals.css sets h1..h6 colour in @layer base, which
beat the inherited text-white; and the card referenced --color-go-500,
--border and --card, none of which exist, so the SEND JOB stamp had no
colour.

Also adds public/sw.js as a kill-switch: a service worker left
registered on localhost:3000 by a different project was intercepting
this app's chunks.

typecheck, lint clean; 186 tests pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
serfowi
2026-08-21 03:16:27 -04:00
co-authored by Claude Opus 5
parent 582f13fa99
commit 176ba187c8
51 changed files with 15622 additions and 85 deletions
+70 -2
View File
@@ -39,7 +39,15 @@ function offset(lat: number, lng: number, metres: number, bearingDeg: number) {
};
}
/**
* The trade taxonomy, in display order — the picker and the landing-page trade
* strip both render it top-to-bottom, so the order is the demand order: the
* trades a city marketplace sees most first, the long tail after. Slugs are the
* stable key (pros, jobs and tests reference them); names and icons are cosmetic.
* Icons are lucide names, kebab-case.
*/
const CATEGORIES = [
// Core trades — the eight that carry most of the volume.
{ slug: 'plumber', name: 'Plumber', icon: 'shower-head' },
{ slug: 'electrician', name: 'Electrician', icon: 'zap' },
{ slug: 'handyman', name: 'Handyman', icon: 'wrench' },
@@ -48,6 +56,60 @@ const CATEGORIES = [
{ slug: 'locksmith', name: 'Locksmith', icon: 'key-round' },
{ slug: 'appliance-repair', name: 'Appliance Repair', icon: 'washing-machine' },
{ slug: 'hvac', name: 'Heating & Cooling', icon: 'thermometer' },
// Home upkeep and renovation.
{ slug: 'cleaner', name: 'House Cleaning', icon: 'sparkles' },
{ slug: 'gardener', name: 'Gardening & Landscaping', icon: 'sprout' },
{ slug: 'mover', name: 'Removals & Moving', icon: 'truck' },
{ slug: 'builder', name: 'Builder & Renovation', icon: 'brick-wall' },
{ slug: 'tiler', name: 'Tiling', icon: 'grid-2x2' },
{ slug: 'plasterer', name: 'Plastering & Drywall', icon: 'layers' },
{ slug: 'roofer', name: 'Roofing', icon: 'house' },
{ slug: 'flooring', name: 'Flooring & Parquet', icon: 'grid-3x3' },
{ slug: 'window-fitter', name: 'Windows & Glazing', icon: 'app-window' },
{ slug: 'blinds-curtains', name: 'Blinds & Curtains', icon: 'blinds' },
{ slug: 'kitchen-fitter', name: 'Kitchen Fitting', icon: 'cooking-pot' },
{ slug: 'bathroom-fitter', name: 'Bathroom Fitting', icon: 'bath' },
{ slug: 'gas-engineer', name: 'Gas & Boilers', icon: 'flame' },
{ slug: 'solar', name: 'Solar & Batteries', icon: 'sun' },
{ slug: 'drain-unblocking', name: 'Drains & Unblocking', icon: 'droplets' },
{ slug: 'pest-control', name: 'Pest Control', icon: 'bug' },
{ slug: 'waste-removal', name: 'Waste & Junk Removal', icon: 'trash-2' },
{ slug: 'window-cleaner', name: 'Window Cleaning', icon: 'spray-can' },
{ slug: 'pool-maintenance', name: 'Pool Maintenance', icon: 'waves' },
{ slug: 'upholstery', name: 'Upholstery & Furniture Repair', icon: 'sofa' },
{ slug: 'alarms-cctv', name: 'Alarms & CCTV', icon: 'cctv' },
// Devices and vehicles.
{ slug: 'it-support', name: 'Computer & IT Support', icon: 'laptop' },
{ slug: 'phone-repair', name: 'Phone & Tablet Repair', icon: 'smartphone' },
{ slug: 'car-mechanic', name: 'Car Mechanic', icon: 'car' },
{ slug: 'car-detailing', name: 'Car Wash & Detailing', icon: 'car-front' },
// People care.
{ slug: 'babysitter', name: 'Childcare & Nannies', icon: 'baby' },
{ slug: 'elderly-care', name: 'Elderly Care', icon: 'heart-handshake' },
{ slug: 'pet-care', name: 'Pet Care & Dog Walking', icon: 'dog' },
{ slug: 'massage', name: 'Massage & Physio', icon: 'hand-heart' },
{ slug: 'hairdresser', name: 'Hairdresser & Barber', icon: 'scissors' },
{ slug: 'beautician', name: 'Beauty & Nails', icon: 'gem' },
{ slug: 'personal-trainer', name: 'Personal Trainer', icon: 'dumbbell' },
// Lessons.
{ slug: 'tutor', name: 'Private Tutor', icon: 'graduation-cap' },
{ slug: 'music-teacher', name: 'Music Lessons', icon: 'music' },
// Events and creative.
{ slug: 'photographer', name: 'Photographer', icon: 'camera' },
{ slug: 'videographer', name: 'Video & Drone', icon: 'video' },
{ slug: 'dj', name: 'DJ & Live Music', icon: 'disc-3' },
{ slug: 'catering', name: 'Catering & Private Chefs', icon: 'chef-hat' },
{ slug: 'event-planner', name: 'Events & Parties', icon: 'party-popper' },
// Professional services.
{ slug: 'accountant', name: 'Accounting & Tax', icon: 'calculator' },
{ slug: 'lawyer', name: 'Legal Services', icon: 'scale' },
{ slug: 'architect', name: 'Architect & Surveyor', icon: 'drafting-compass' },
];
interface SeedPro {
@@ -189,11 +251,17 @@ async function main() {
await db.insert(schema.proCategories).values({ proId: user.id, categoryId: catId });
const slug = encodeURIComponent(p.name.toLowerCase().replace(/\s+/g, '-'));
// The first photo is the deck card, so it has to be a FACE. picsum returns
// landscape stock scenery — a locksmith on a railway track — which makes the
// deck unreadable as a people-picker no matter what the layout does.
// pravatar serves ~70 portraits; i is 0-based and img is 1-based.
const portrait = (i % 70) + 1;
await db.insert(schema.proMedia).values([
{ proId: user.id, url: `https://picsum.photos/seed/${slug}-1/800/1000`, position: 0 },
{ proId: user.id, url: `https://i.pravatar.cc/800?img=${portrait}`, position: 0 },
{
// The second slot is genuinely for work: scenery is fine here.
proId: user.id,
url: `https://picsum.photos/seed/${slug}-2/800/1000`,
url: `https://picsum.photos/seed/${slug}-work/800/1000`,
kind: 'work_sample' as const,
position: 1,
},