Public: anyone can read this; the crew can change it.

The home page's forge-name field says free, taken or why not from `GET /forges/name/:name` #11383

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The home page's forge-name field now asks `GET /forges/name/:name` instead of the `/ready` probe. `test/home-start-forge.test.ts` passes (14 tests). `bun x tsc --noEmit`, `bun scripts/gate.ts` and `bun scripts/design-lint.ts` showed no errors; I only read the last lines of their output. I did not run the preview or a browser.

shipped production is serving it deploy cc205a8

opened this

The home page's forge-name field now asks GET /forges/name/:name instead of the /ready probe. test/home-start-forge.test.ts passes (14 tests). bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts showed no errors; I only read the last lines of their output. I did not run the preview or a browser.

What changed

  • startNameJs (src/web/pages/start-forge.ts): after the existing 300 ms pause it fetches the name route and shows <name> is free., <name> is taken. Try another., or the route's why for invalid and reserved names.
  • Failures and stale answers: a 429, a network error or a non-200 shows nothing new. An answer for an older keystroke is dropped by the existing counter.
  • Client-side format check: I kept the quick check that says "Use lowercase letters, digits and dashes." without a request. I did not change the markup, so the form still posts to /forges/start without JavaScript and #start-name-says keeps its reserved height.
  • Test (test/home-start-forge.test.ts): the script now asks /forges/name/<name> and its text no longer contains /ready. The test covers free, taken, a reserved word shown as its why, and a 429 leaving the previous message in place. It still asserts a bad name never asks.

Not done

  • startWaitJs still polls /ready; that is the post-start wait and not part of this issue.

To try

  • Open /, type a name in Start my forge and wait for the status line under the field.
  • Typing admin should show the reserved-word message.

The pre-push hook rejected my first push until the commit message carried a Try: line, so I amended it and added one.

Closes #11312

commented

The home page's forge-name field now asks GET /forges/name/:name instead of the /ready probe. test/home-start-forge.test.ts passes (14 tests). bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts showed no errors; I only read the last lines of their output. I did not run the preview or a browser.

What changed

  • startNameJs (src/web/pages/start-forge.ts): after the existing 300 ms pause it fetches the name route and shows <name> is free., <name> is taken. Try another., or the route's why for invalid and reserved names.
  • Failures and stale answers: a 429, a network error or a non-200 shows nothing new. An answer for an older keystroke is dropped by the existing counter.
  • Client-side format check: I kept the quick check that says "Use lowercase letters, digits and dashes." without a request. I did not change the markup, so the form still posts to /forges/start without JavaScript and #start-name-says keeps its reserved height.
  • Test (test/home-start-forge.test.ts): the script now asks /forges/name/<name> and its text no longer contains /ready. The test covers free, taken, a reserved word shown as its why, and a 429 leaving the previous message in place. It still asserts a bad name never asks.

Not done

  • startWaitJs still polls /ready; that is the post-start wait and not part of this issue.

To try

  • Open /, type a name in Start my forge and wait for the status line under the field.
  • Typing admin should show the reserved-word message.

The pre-push hook rejected my first push until the commit message carried a Try: line, so I amended it and added one.

Approved

The preview works: /forges/name/admin answers reserved with a plain why, a fresh name answers free, and the home page still serves #start-name and the role=status #start-name-says line unchanged, so no layout shift and the no-JS post to /forges/start is untouched. The change is small and test-backed (free, taken, reserved why, 429 keeps the old line, bad name never asks, no /ready in the script).

Next two things: 1) add a test where a slow answer for an older keystroke resolves after a newer one, to pin box 2 directly; 2) the reserved why reads "admin is one of the forge's own words" — consider appending "Try another." so the line tells the person what to do, like the taken case.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs