Skip to content

Support inline/ephemeral forms in existing buffers #8

@d12frosted

Description

@d12frosted

Use Case

Support mounting vui components inline within an existing buffer (at point), rather than taking over a dedicated buffer. The primary use case is ephemeral, disposable forms for interactive documents.

Example Workflow

From a discussion on HN:

Say the devops document says "". That button is simple enough. You can evaluate this and get a buffer, or like org-babel, insert the output into a block inline. Now we want to extend the functionality: we want parameterization, but without breaking flow. So here I'm thinking of injecting a disposable form at cursor.

The flow would be:

  1. User activates a button/link in a document
  2. Small form expands inline at point (e.g., server selector, filters)
  3. User fills in parameters, submits
  4. Form vanishes, action executes, result appears (inline or in separate buffer)

Why This Matters

"Structured, validated input for in-document interaction" — combining the power of org-mode/Jupyter-style interactive documents with proper form validation, without breaking text flow or switching to modals.

Current State

vui.el currently mounts to a dedicated buffer via vui-mount. This feature would add something like:

(vui-insert-at-point component
  :on-submit (lambda (data) 
               (vui-unmount-inline)
               (do-something-with data)))

Considerations

  • Interaction with host buffer's text properties
  • Undo handling
  • Widget protection (the gist's widget-before-change advice complexity)
  • Cleanup when form is dismissed

For ephemeral forms that clean up after themselves, this should be simpler than persistent multi-form scenarios.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions