Skip to content

Act on the site and repo review in discussion #28 - #29

Merged
Yoosseph merged 1 commit into
mainfrom
discussion-28-feedback
Oct 13, 2026
Merged

Yoosseph merged 1 commit into
mainfrom
discussion-28-feedback

Conversation

@Yoosseph

Copy link
Copy Markdown
Owner

Works through the review in #28, in the order it was written. Thanks to @Drimdave for it.

three.js out of the entry chunk. stage-tools.tsx, use-explorer.ts and explorer-state.ts imported airflow helpers from lib/airflow.ts, which imports three at the top, so the whole engine shipped in the first download. airflowLevels, hasAirflow, AirflowMode and airflowShown now live in a three-free lib/airflow-policy.ts, and airflow.ts re-exports them so the builders don't change. Entry chunk: 1,208 KB / 340 KB gzipped → 623 KB / 192 KB gzipped, and three now loads with stage-runtime. A new npm run size step in CI fails if three.js shows up in the entry chunk again or the chunk grows past 220 KB. I checked that it fails when the old import is put back.

Phone header. Below 900px the header's outer columns now size to their contents, so the "Created by Yoseph" pill can't cover "Toggle systems" any more. Under 400px it shortens to "Yoseph". I measured it at 320, 375, 414, 600, 620, 680, 768 and 900px, and there's no overlap at any of them.

Touch. A mouse still opens on left-click and inspects on right-click. A tap now selects the part and shows its card, and the card's Take apart button opens it. Where the card doesn't cover the part (a tablet's side panel), tapping the selected part again also opens it. The rule lives in lib/pointer-intent.ts.

Deep links. The address now records the place being shown:

  • ?scale= for the scale
  • &part= for the part being described, plus &n= when it's one of several identical parts
  • &open= for how far apart the hardware is

Opening a link lands on that place. A scale change is a history step, so the back button climbs back out. Selecting a part or moving the slider replaces the current history entry instead, and the slider is only written once it stops moving. The page title and the canonical link follow the place. Links that make no sense fall back to the nearest place that does: an unknown scale opens the home page, and a part on the wrong scale opens that scale without it. public/sitemap.xml now lists every scale and part (446 addresses), built from the catalogue by scripts/generate-sitemap.mjs, and a test fails if the committed sitemap falls behind.

First visit. A one-time line under the heading says what clicking does: "Click a part to open it, right-click to inspect it, or press Auto." On touch screens it says "Tap a part to see what it is and take it apart, or press Auto." It goes away as soon as the visitor picks a part, moves the slider, changes scale or closes it, and it only appears once per browser.

Inventory labels. At 100%, the laid-out parts carry their names. Bigger parts are named first, each part is named once, and names never overlap or run off the stage. Clicking or tapping a name describes that part. Rendered and checked on the tower at desktop size.

Also fixed: "Loading components for you…" no longer draws on top of the WebGL error card.

Checks

  • npm run check, npm run lint
  • npm test: 94 passing (84 before, plus 10 in tests/discovery.test.ts)
  • npm run build, npm run size
  • the same steps from a clean clone with npm ci
  • headless Chromium, with WebGL and without:
    • deep links, back and forward
    • a desktop click still dives, and back returns
    • a tap on the phone layout opens the card instead of diving
    • inventory names on the tower
    • header layout across the widths above

Not verified

  • I couldn't test on a real iPhone. The touch change no longer relies on contextmenu, but someone should try it on a device.
  • The address now changes as people move around. I haven't checked whether Vercel Analytics counts these as page views, or how it treats query strings.

Closes the actionable points in #28.

Keep three.js out of the entry chunk. Three interface modules imported
airflow helpers from lib/airflow.ts, which imports three at the top, so
the whole engine shipped in the first download. The policy now lives in
lib/airflow-policy.ts; the entry chunk drops from 340 KB to 192 KB gzipped
and three.js loads with the stage runtime. `npm run size`, run in CI after
the build, fails if three reappears there or the chunk passes 220 KB.

Fix the phone header. Below 900px the outer columns size to their
contents, so the byline can no longer cover "Toggle systems"; under 400px
it shortens to the name.

Make a tap describe instead of open. iOS does not fire contextmenu on a
long press, so the detail card was out of reach on a phone. A tap now
selects the part and shows the card, whose "Take apart" button opens it.
Mouse behaviour is unchanged.

Put the place in the address bar. ?scale=, &part=, &n= and &open= open
a shared link where it points, scale changes are history steps so back
climbs out, and the title and canonical link follow. The sitemap now
lists every scale and part (446 addresses) and a test keeps it current.

Say what clicking does on a first visit, once, and name the laid-out
parts at 100% so the inventory can be read without hovering.

Also stop "Loading components for you" drawing over the WebGL error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UxpcFUpEsA1MjbtRrFmwzx
@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pc-anatomy Ready Ready Preview Oct 13, 2026 2:21pm UTC

@Yoosseph

Copy link
Copy Markdown
Owner Author

Test on live phone has been done.

@Yoosseph
Yoosseph merged commit a51c74e into main Oct 13, 2026
4 checks passed
@Yoosseph
Yoosseph deleted the discussion-28-feedback branch October 13, 2026 14:44
@Drimdave

Copy link
Copy Markdown

Awesome!

This branch was successfully deployed

1 active deployment
Preview — 9fdeb688 Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants