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

Errors on the origins and migrate pages are §5's field error, not .error-note #5090

Merged opened this

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

Merged

The three `error-note` paragraphs on the origins and migrate pages are gone. Each is now §5's field error: a `.field[data-invalid]` holding a `<span class="error" role="alert">`. The `.error-note` rule and §5d are untouched, as the issue asks.

shipped production is serving it deploy 740aa94

opened this

The three error-note paragraphs on the origins and migrate pages are gone. Each is now §5's field error: a .field[data-invalid] holding a <span class="error" role="alert">. The .error-note rule and §5d are untouched, as the issue asks.

  • src/web/pages/origins.ts: an origin's lastError and the "this forge does not know its own public URL" notice both use the new markup.
  • src/web/pages/migrate.ts: a failed migration job shows its reason the same way.
  • Tests: in test/web-origins.test.ts, a refused token now has to appear in a .error span with no error-note. In test/migrate.test.ts, a failed job page has to show its reason in the same span, again with no error-note.
  • Checks: test/web-origins.test.ts, test/migrate.test.ts and test/origins.test.ts pass (85 tests). bun scripts/design-lint.ts is clean.
  • Not run: bun x tsc --noEmit couldn't run here because the bun type definitions weren't found (TS2688), so the type check is left to the forge's check.

Only the refused-token page and the failed migration job have new assertions. The lastError line and the missing-public-URL notice are changed but not asserted.

I left every other error-note in the codebase for other issues.

Closes #5072

commented

The three error-note paragraphs on the origins and migrate pages are gone. Each is now §5's field error: a .field[data-invalid] holding a <span class="error" role="alert">. The .error-note rule and §5d are untouched, as the issue asks.

  • src/web/pages/origins.ts: an origin's lastError and the "this forge does not know its own public URL" notice both use the new markup.
  • src/web/pages/migrate.ts: a failed migration job shows its reason the same way.
  • Tests: in test/web-origins.test.ts, a refused token now has to appear in a .error span with no error-note. In test/migrate.test.ts, a failed job page has to show its reason in the same span, again with no error-note.
  • Checks: test/web-origins.test.ts, test/migrate.test.ts and test/origins.test.ts pass (85 tests). bun scripts/design-lint.ts is clean.
  • Not run: bun x tsc --noEmit couldn't run here because the bun type definitions weren't found (TS2688), so the type check is left to the forge's check.

Only the refused-token page and the failed migration job have new assertions. The lastError line and the missing-public-URL notice are changed but not asserted.

I left every other error-note in the codebase for other issues.

Changes requested — before the latest push

The markup matches the edit.ts field-error pattern and the two asserted paths are right. Two of the three changed sites have no test that would fail without the change, and the list is strict on that.

Fix first: add an assertion for an origin card whose lastError is set (a .field[data-invalid] with span.error holding the text, and no error-note), and one for the missing-public-URL notice (render with no FORGE_URL or FORGE_HOST and match the same markup).

Also consider: the callback notice is static configuration guidance, not a failed input. With role=alert it is announced on every load of the page, and .field .error sets it to 12.5px, so a long paragraph gets small. Either drop role=alert there or keep it a muted note instead of an error. The preview /origins answered 404 to me unauthenticated, so I could not see the rendered result.

commented

I've pushed the follow-up to the same branch. test/web-origins.test.ts and test/origins.test.ts pass (61 tests), and bun scripts/design-lint.ts is clean. I didn't re-run test/migrate.test.ts, since this round doesn't touch migrate. The tsc type check still can't run in this sandbox, so the forge's check covers it.

  • Missing-public-URL notice: I agreed with @juniper that this is configuration guidance, not a failed input. It is now a muted note (<p class="muted small" id="origin-callback-note">) with no role="alert" and no error-note. It no longer gets the small .error text size or an announcement on every page load. The existing test for a forge that doesn't know its own URL now asserts this markup and that no error markup is present.
  • Origin card lastError: a new test in test/web-origins.test.ts records a failed sync on an origin. It expects the .field[data-invalid] with a span.error holding the text on the origins page, and no error-note. The test then clears the error.
  • Unchanged: the failed-migration job still uses the .field plus .error markup, and the connect-form errors are as before.
Approved

Approved. The three error-note paragraphs on origins and migrate become the design system field error (.field[data-invalid] with span.error role=alert), as in edit.ts. The missing-public-URL notice is now a muted note, not an alert, which is the right call for configuration guidance. It works without JavaScript, the escaping is unchanged, and tests cover all three sites and fail without the change. Preview answers 200. Next: (1) sweep the remaining error-note uses, then remove the rule and DESIGN 5d; (2) give each error span aria-describedby wiring if these ever sit beside an input.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs