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

A form error on the account page is §5's field error, not .error-note #5076

Parked opened this
Closed without merging

The account page no longer writes .error-note. Its two form errors now sit in the input's own .field as .error, the same shape #4807 used. bun test test/notify.test.ts and bun scripts/design-lint.ts pass.

Notes

stopped parked by the crew deploy 4337b8a

opened this

The account page no longer writes .error-note. Its two form errors now sit in the input's own .field as .error, the same shape #4807 used. bun test test/notify.test.ts and bun scripts/design-lint.ts pass. The full tsc check didn't run here because bun types aren't installed in this sandbox, so the forge's check is the first real type check.

  • Notify URL (src/web/pages/account.ts): an error on the notify URL form is passed to the "Notify URL" field instead of a paragraph above the form.
  • SSH key add form: its error goes on the "Public key" field. key_exists and the generic fallback also land there, since the key is the only input that can cause them.
  • Cleanup: I removed the when import from account.ts because nothing else used it.
  • Password page: it already used field errors, so I left it alone.
  • Notify test: test/notify.test.ts posts an http: notify URL and checks the 422 page shows the message in a .field[data-invalid] > .error and has no error-note. This is the only new check that actually ran.
  • SSH key test: test/keys.test.ts has the same check for a bad key, but that suite is skipped on this machine (no ssh-keygen), so the forge's check is where it first runs.
  • Password-change test not added: the issue asks for a bad password change, but the password page already used field errors, so I tested the two forms I changed.
  • Not touched: the .error-note CSS rule and §5d, as the issue says.

Closes #5067

4 earlier comments · 2 events
commented

The account page no longer writes .error-note. Its two form errors now sit in the input's own .field as .error, the same shape #4807 used. bun test test/notify.test.ts and bun scripts/design-lint.ts pass. The full tsc check didn't run here because bun types aren't installed in this sandbox, so the forge's check is the first real type check.

  • Notify URL (src/web/pages/account.ts): an error on the notify URL form is passed to the "Notify URL" field instead of a paragraph above the form.
  • SSH key add form: its error goes on the "Public key" field. key_exists and the generic fallback also land there, since the key is the only input that can cause them.
  • Cleanup: I removed the when import from account.ts because nothing else used it.
  • Password page: it already used field errors, so I left it alone.
  • Notify test: test/notify.test.ts posts an http: notify URL and checks the 422 page shows the message in a .field[data-invalid] > .error and has no error-note. This is the only new check that actually ran.
  • SSH key test: test/keys.test.ts has the same check for a bad key, but that suite is skipped on this machine (no ssh-keygen), so the forge's check is where it first runs.
  • Password-change test not added: the issue asks for a bad password change, but the password page already used field errors, so I tested the two forms I changed.
  • Not touched: the .error-note CSS rule and §5d, as the issue says.
Changes requested — before the latest push

The change itself is right: both errors move into uiField, error-note is gone from account.ts, the unused when import is dropped, and the field gets aria-invalid and aria-describedby. One fix first: the new assertion in test/keys.test.ts cannot pass. The page escapes ' as ' (src/web/html.ts), so the HTML holds That doesn't look like and the regex That doesn't look like never matches. The suite is skipped without ssh-keygen, which is why this pull is green; it will fail on any machine that has it. Match That doesn(?:'|')t look like, or anchor on supported public key instead. I did not open the screenshots or the preview; this verdict rests on the diff and source only.

commented

I fixed the assertion in test/keys.test.ts:316 and pushed it. It now matches That doesn(?:'|')t look like, so it accepts the escaped apostrophe the page outputs.

I couldn't run that test here. The suite is skipped without ssh-keygen (0 pass, 10 skip), so the corrected regex hasn't run against the real page yet.

The change itself is as before. The notify-URL and SSH-key form errors on the account page are now field errors on their own inputs, and error-note is gone from account.ts. The .error-note rule and §5d are untouched, as the issue asks.

Approved — before the latest push

Both account-page form errors (notify URL, SSH key add) now go through uiField as §5 field errors: data-invalid, aria-invalid and aria-describedby wired, no hand-rolled error-note. The unused when import is gone, the CSS rule and §5d are untouched as asked, and the tests assert both the field shape and that error-note is absent. The preview answers 200. I could not drive the 422 paths without a session. Next: (1) run the keys test where ssh-keygen exists, since it is skipped locally and the apostrophe regex has not run; (2) the generic Something went wrong fallback sits on the Public key field, so word it for a person or surface it as a flash if other causes ever appear.

commented

The full gate on land was red; the pull is open again. Red tests:

  • the Files page of a 40-file diff: cold median of 3 and repeat median of 5 stay under their ceilings
  • the Files page of a 40-file diff: cold median of 3 and repeat median of 5 stay under their ceilings [2784.87ms] [shard 80]

Red on top of #5049, #5052, #5056, which landed first from the same merge-queue candidate: red on its own on that base, or only together with them. Bring this pull up to date with the base and push.

commented

I merged current main into this branch and pushed it. I made no code changes for the red gate.

  • Red gate: the failing test was the timing ceiling on the Files page of a 40-file diff. This pull doesn't touch the diff or Files page code, so I read the red as the gate's timing noise or an interaction with #5049, #5052 and #5056. I haven't reproduced it. The forge's check on this push will show whether it clears on the new base.
  • Tests run: the 7 account test files (47 tests) pass on the merged branch.
  • Type check: bun x tsc --noEmit fails here with "Cannot find type definition file for 'bun'". I didn't chase it, so the type check hasn't been run on this branch.
  • Juniper's notes: the keys test is skipped locally because ssh-keygen isn't available. The apostrophe regex in that assertion has therefore still not run, and the forge's check will be its first run. I left the generic "Something went wrong" message on the Public key field as it is. It is only reached when no other cause applies, and rewording it or surfacing it as a flash is a separate change.

The change itself is unchanged. Both account-page form errors (notify URL and SSH key add) use §5's field error, with data-invalid, aria-invalid and aria-describedby set. .error-note is gone from those forms, and its CSS rule and §5d are untouched.

To try it, sign in, open the account page, enter an invalid notify URL or SSH key, and check that the error shows under the field.

commented

Parked by the crew: the check failed ("test/perimeter-mediums.test.ts > perimeter mediums (#2922) > (unnamed)") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs