Automations and webhooks for the AT Protocol airglow.run

NSID input in record actions loses focus while typing #46

Closed there-hugo.dev
Closed opened by there-hugo.dev

Problem #

In the "Create a record" and "Update a record" actions, the Target Lexicon NSID input loses focus in the middle of typing. Keystrokes after that go nowhere, so the user has to click back into the field. The form below the input also re-renders with a "Not found" error while the NSID is still incomplete.

Seen in the session #

In https://www.youtube.com/watch?v=5MnT-ZgbBIc, at 1:08:30 the user says "it interrupted my typing. That's rude." (also around 0:48:30 and 1:25). The feedback report put this down to the datalist (https://tangled.org/exosphere.site/airglow/issues/20), but focus loss is the real cause.

Reproduction (dev server, verified 2026-10-17) #

  1. New automation, add "Create a record".
  2. Type app.bsky.graph.listitem at a normal pace, pausing briefly after app.bsky.graph.list.
  3. About 0.5s after the pause, the schema for app.bsky.graph.list loads, the record form builder replaces the template textarea, and the input is blurred.

Clearing the field (the template block disappears) blurs it too.

Root cause #

A MutationObserver shows the input's fieldGroup div being removed from the action card and inserted again. Moving a focused element in the DOM blurs it.

  • RecordActionEditor (app/islands/action-editors/record.tsx) and the patch-record editor return a fragment: the NSID field group, then two conditional blocks (RecordFormBuilder when a schema is loading or loaded, the raw template textarea otherwise).
  • The fragment has no DOM node of its own, so its children share the action card with the surrounding step fields.
  • When one conditional sibling switches to the other, hono/jsx 4.13 (applyNodeObject in hono/dist/jsx/dom/render.js) recomputes the insertion offset and calls insertBefore on the unchanged field group.

Fix direction #

  • Give the toggling region a stable container, for example a wrapper element (display: contents keeps the card's flex gap) around the schema/template blocks, so the switch happens inside it and never touches the input's siblings.
  • Do the same in patch-record.tsx (same useNsidSchema pattern).
  • Check other inputs followed by conditional siblings in a fragment, starting with the trigger lexicon input in AutomationForm.tsx.
  • Separately, don't show "Not found" for a partial NSID until typing settles (moved here from https://tangled.org/exosphere.site/airglow/issues/28).

Related: https://tangled.org/exosphere.site/airglow/issues/20, https://tangled.org/exosphere.site/airglow/issues/28.

Fixed in 404fddf and 135b7c4: the record action editors no longer move the NSID input in the DOM, and stale schema errors are dropped while typing.

Sign up or Sign in to add to the discussion.