← Back to context

Comment by d12frosted

1 month ago

This makes a lot of sense now - thanks for the detailed walkthrough.

So the core idea is: ephemeral, inline forms that appear at point, collect structured input, execute, and disappear. Not persistent multi-form buffers, but disposable parameter prompts that don't break document flow or switch context to a modal.

The <query the ps of a given server> example is perfect - you want:

  1. Click/activate the button
  2. Small form expands inline (server selector, maybe filters)
  3. Fill, submit
  4. Form vanishes, result appears (inline or in separate buffer)

This is actually more tractable than what the gist's inline extension was doing. That was about persistent forms with state tracking, cleanup on manual deletion, etc. Your use case is simpler: mount form at point → collect input → unmount → done.

vui.el doesn't support this today, but it's not a huge leap. The pieces are there:

  - Components with state and validation 
  - Controlled rendering 
  - What's missing: mounting into an existing buffer at point (vs taking over a buffer)

I'd need to think through how it interacts with the host buffer's text properties and undo - that's where the gist's widget-before-change advice complexity came from. But for disposable forms that clean up after themselves, it should be simpler.

If you want to experiment with this, I'd be curious to collaborate. It's a use case I hadn't fully considered, but "structured, validated input for in-document interaction" is a good framing.

I spent some time reorganizing the code in my gist into a repo for better change tracking at https://github.com/whacked/inline-interactive-forms.el

I also pulled vui.el into the dev setup and basically instructed the agents to reach feature parity. I ran out of CC credits fast so switched to codex. Codex makes a lot of unbalanced parenthesis mistakes even in agent, although it does eventually get it right by telling it to run emacs itself. Codex wasn't able to reach feature parity though, like the background color indications (I supply a video in the readme). I didn't look too deep yet.