~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The console's acts are sent in place, keeping the reader where they are

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:ui/forms-in-place

What changes

Every act on a page is sent in place, with use:enhance, rather than as a plain post that reloads the page at its top. That covers adding a role, rule, link or picture, inviting, approving, removing and resolving.

  • Done: the page is drawn again where the reader was, and a dialog closes.
  • Refused in a dialog: the dialog stays open with what was typed, and says why inside it. Before, the reload threw both away and put the error at the top of the page.
  • Refused elsewhere: the page's notice says why, scrolled to gently, or at once for a reader who asks for less motion.
  • Sent elsewhere (a redirect): the page goes there, as before.

How:

  • #lib/forms.ts holds the two ways: inPlace for a form on the page, and inDialog for one in a dialog. FormDialog, ConfirmDialog and the moderation queue's resolve dialog use inDialog; the inline forms of eight organisms use inPlace.
  • Dialog empties what was typed into it whenever it closes, sent or cancelled, and clears its error. A field that shows what is there already (a role's name, its ticked actions) is left to the page drawn again.
  • Signing out, starting a group, moving an account and approving an app still post plainly, as each goes somewhere else.
  • The ui skill gains In place under "The same act, the same way", and AGENTS.md a line for the console.

Why

Every act reloaded the page and jumped to the top, so changing a member's roles far down the list lost your place.

How it was checked

  • e2e: changing roles keeps the page's scroll and closes the dialog. A refused invite stays open with the handle typed and the reason inside. Two flows that navigated away the moment they clicked now wait for the act to land, as a person does, since a navigation now cancels a send still on its way. All 31 pass.
  • Looked at a refused invite with just look.

Shortcomings

  • No check holds a new form to the rule; the skill and AGENTS.md carry it.
  • The switched-off group's "Switch back on" form in the delete pull, at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3mzlcapshq2oe, posts plainly; whichever lands second takes inPlace for it.

🤖 Generated with Claude Code

invite-refused-alice-phone-dark.png

Approved

This sends the console's forms in place with use:enhance, through inPlace and inDialog in #lib/forms.ts. Dialogs now close on success. On refusal they stay open with what was typed and show the reason inside. I read the whole diff and found nothing that must change. I did not run the e2e checks.

  • The server actions return fail(status, { failed }) (asGroup.ts, data.ts, settings.ts and the group pages). That is the shape inDialog reads, so the in-dialog message matches what the page notice used to show.
  • A successful inDialog send hides the popover, then calls update({ reset: false }). Dialog's toggle handler empties only fields that started empty, so a role's name and its ticked actions are left to the redraw.
  • Minor, not blocking: a dialog field that shows existing data keeps its typed value if the dialog is cancelled after a refusal. It stays that way until the page is redrawn. The pull's own description says this is by design.
  • The shortcoming the pull names, that the "Switch back on" form in the delete pull still posts plainly, is acknowledged and tracked there.
Approved

Carried forward: the change this pull makes at 173e3f16c471d551c3fefe511b786fb91837b59d is the one reviewed at 77e9a90ed36df91cca6b5a2df3db0745d60e1a8f, so that review stands. What is new comes from its base.

Approved

Carried forward: the change this pull makes at 2eb4127cec1bd7dab65f20a47158be0832108372 is the one reviewed at 173e3f16c471d551c3fefe511b786fb91837b59d, so that review stands. What is new comes from its base.

Merged as 2acbde9