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

Account form errors draw the shared danger component, and the page-local .error-note class is gone #9101

Merged opened this

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

Merged

When the notify URL, profile or new-SSH-key form in Settings is refused, the message now shows in the shared danger toast (`.toast[data-tone=danger] role="alert"`) that browse.ts already uses for a failed mirror. The page-local `.error-note` class is retired.

shipped production is serving it deploy 47e6991

opened this

When the notify URL, profile or new-SSH-key form in Settings is refused, the message now shows in the shared danger toast (.toast[data-tone=danger] role="alert") that browse.ts already uses for a failed mirror. The page-local .error-note class is retired.

  • src/web/pages/account.ts: a small refusal(message) helper draws the toast. The words are unchanged and still escaped. The toast sits under each form's actions, not above its first field. When it appears, it pushes nothing in the form down: only content below the form moves. The old note sat at the top and moved every field. Messages tied to one field (display name, email) still use the field's .error, as before.
  • src/web/style/components.ts: the .error-note rule is deleted.
  • docs/design/sections/5d-page-local-classes.md: its entry is deleted. That leaves the style/components.ts bullet with an intro line and no class under it; the design check accepts that.
  • test/account-refusals.test.ts (new): posts one refused form to each of the three — an http: notify URL, a bogus commitEmail (which falls back to the form-level profile message), and a malformed SSH key. Each test checks for a 422, the words inside the danger toast with role="alert", and no error-note. The profile test also checks that the HTML-looking commitEmail value never comes back unescaped. All three fail on main.

grep -rn error-note src docs finds nothing. bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. Because the diff touches the shared stylesheet, scripts/fast.ts named 1,089 test files (an estimated 95 minutes), so I ran the 44 files that cover this change instead: the account, notify, keys, settings and passkeys suites and the design-lint tests, with 0 failures. The forge's check runs the rest on this push.

To try it on the preview, go to Settings and save http://example.test/t as the notify URL. The red alert appears under the Save button.

🤖 Generated with Claude Code

Closes #9085

commented

When the notify URL, profile or new-SSH-key form in Settings is refused, the message now shows in the shared danger toast (.toast[data-tone=danger] role="alert") that browse.ts already uses for a failed mirror. The page-local .error-note class is retired.

  • src/web/pages/account.ts: a small refusal(message) helper draws the toast. The words are unchanged and still escaped. The toast sits under each form's actions, not above its first field. When it appears, it pushes nothing in the form down: only content below the form moves. The old note sat at the top and moved every field. Messages tied to one field (display name, email) still use the field's .error, as before.
  • src/web/style/components.ts: the .error-note rule is deleted.
  • docs/design/sections/5d-page-local-classes.md: its entry is deleted. That leaves the style/components.ts bullet with an intro line and no class under it; the design check accepts that.
  • test/account-refusals.test.ts (new): posts one refused form to each of the three — an http: notify URL, a bogus commitEmail (which falls back to the form-level profile message), and a malformed SSH key. Each test checks for a 422, the words inside the danger toast with role="alert", and no error-note. The profile test also checks that the HTML-looking commitEmail value never comes back unescaped. All three fail on main.

grep -rn error-note src docs finds nothing. bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. Because the diff touches the shared stylesheet, scripts/fast.ts named 1,089 test files (an estimated 95 minutes), so I ran the 44 files that cover this change instead: the account, notify, keys, settings and passkeys suites and the design-lint tests, with 0 failures. The forge's check runs the rest on this push.

To try it on the preview, go to Settings and save http://example.test/t as the notify URL. The red alert appears under the Save button.

🤖 Generated with Claude Code

commented

When the notify URL, profile or new-SSH-key form in Settings is refused, the message now shows in the shared danger toast (.toast[data-tone=danger] role="alert") that browse.ts already uses for a failed mirror. The page-local .error-note class is retired.

  • src/web/pages/account.ts: a small refusal(message) helper draws the toast. The words are unchanged and still escaped. The toast sits under each form's actions, not above its first field. When it appears, it pushes nothing in the form down: only content below the form moves. The old note sat at the top and moved every field. Messages tied to one field (display name, email) still use the field's .error, as before.
  • src/web/style/components.ts: the .error-note rule is deleted.
  • docs/design/sections/5d-page-local-classes.md: its entry is deleted. That leaves the style/components.ts bullet with an intro line and no class under it; the design check accepts that.
  • test/account-refusals.test.ts (new): posts one refused form to each of the three — an http: notify URL, a bogus commitEmail (which falls back to the form-level profile message), and a malformed SSH key. Each test checks for a 422, the words inside the danger toast with role="alert", and no error-note. The profile test also checks that the HTML-looking commitEmail value never comes back unescaped. All three fail on main.

The first check failed because no commit message had a Try: line. An empty follow-up commit now carries one.

grep -rn error-note src docs finds nothing. bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. Because the diff touches the shared stylesheet, scripts/fast.ts named 1,089 test files (an estimated 95 minutes), so I ran the 44 files that cover this change instead: the account, notify, keys, settings and passkeys suites and the design-lint tests, with 0 failures. The forge's check runs the rest on this push.

Try: open /settings on the preview, save http://example.test/t as the Notify URL, and the red alert appears under "Save notify URL".

🤖 Generated with Claude Code

Approved

Approved. The three refusals in Settings now use the shared danger toast with role=alert. The words are unchanged and still escaped. The .error-note rule and its 5d entry are gone, and the new test covers all three forms. I read the diff and the base's toast CSS and markup. I did not run the preview or the tests. Next, two things I would do: (1) On a 360px phone the profile form is long, so a refusal drawn under Save can land below the fold on re-render. The role=alert announces it to a screen reader, but a sighted thumb user sees only a reloaded form. Give the toast an id and link the page to it (or scroll/focus it) so the error is in view. (2) Put the icon import in sorted order beside the other ui.ts imports instead of after field as uiField.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs