Repository navigation
Act on the site and repo review in discussion #28 - #29
Merged
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
Test on live phone has been done. |
|
Awesome! |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsandexplorer-state.tsimported airflow helpers fromlib/airflow.ts, which imports three at the top, so the whole engine shipped in the first download.airflowLevels,hasAirflow,AirflowModeandairflowShownnow live in a three-freelib/airflow-policy.ts, andairflow.tsre-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 withstage-runtime. A newnpm run sizestep 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 isOpening 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.xmlnow lists every scale and part (446 addresses), built from the catalogue byscripts/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 lintnpm test: 94 passing (84 before, plus 10 intests/discovery.test.ts)npm run build,npm run sizenpm ciNot verified
contextmenu, but someone should try it on a device.Closes the actionable points in #28.