Skip to content

feat(one-page-inputs): prototype - not for merge - fill the form from the clipboard - #1966

Draft
chhoumann wants to merge 2 commits into
masterfrom
prototype/fill-form-from-text
Draft

chhoumann wants to merge 2 commits into
masterfrom
prototype/fill-form-from-text

Conversation

@chhoumann

@chhoumann chhoumann commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Prototype - not for merge. Built to test whether AI can feel native in QuickAdd rather than bolted on. See the proposal doc for the evidence and ranking.

The one-page input form gets a Fill from clipboard button. It sends the clipboard text, the field list, and the choice's destination (the Capture format, or the Template's file name and body) to the AI Assistant's default model. It asks for one string per field using the existing schema-constrained Agent.generate, then types each answer into its field. The form's own parsing, date handling, and file-name preview apply as usual. Nothing is written until the user clicks Submit.

Why

  • Using AI with a template or capture takes a macro, a prompt-template note, an output variable, and for several fields a user script. The AI Assistant docs say structured output "is a User Script workflow, not the plain Macro AI Assistant command". Discussions asking for this: discussions 536 (JSON output into template fields), 730 (AI titles) and 759 (where did the AI output go).
  • Public vaults (284 pushed in 2026): 13 turned AI on, and 2 use an AI Assistant macro step. Meanwhile {{VALUE}} appears in 196 of 404 vaults with choices. Scripts that fetch metadata to fill a template are among the most common user scripts (movies.js, bookfromdouban.js, Google Books).
  • This puts AI where users already are, in the form, and uses the fields they already defined as the schema. No prompt-template folder, macro, or output variable is needed.

Behavior

  • The button shows only when AI features are on, a Default model is set (not Ask me), and the form has fillable fields. Vault file pickers and sliders stay manual.

  • It fills empty fields and fields still showing their default. Text the user typed is kept.

  • A field used in a file name gets a "no : / \ # ^ [ ] |" hint. Before that hint, the model produced a title with a colon, and the existing file-name preview flagged it before anything was written:

    The form preview flags an AI-filled title with a colon as an invalid file name

Demo (real Obsidian 1.13.7, real gpt-6-luna call through the OpenAI provider)

Run Source note, click Fill from clipboard, six fields fill from an article, Submit, the note opens

A pasted chat filling a Meeting note (2-4 s per fill in my runs):

Meeting note form filled from a pasted chat

Try it

  1. gh pr checkout <this PR> && pnpm install && pnpm run build, then reload QuickAdd.
  2. Settings → QuickAdd: turn off Disable AI & online features. Under AI Assistant, link a provider key and set Default model.
  3. Make a Template or Capture with a few {{VALUE:name}} fields. Set its One-page input override to Always, or turn on one-page input globally.
  4. Copy an article, email, or chat. Run the choice, click Fill from clipboard, review the fields, and click Submit.

What's faked or unfinished

  • Nothing in the recordings is faked. The clipboard was set programmatically before the take, since there is no browser in the recording.
  • Everything variable goes into the system message, because Agent.generate runs prompt through the QuickAdd formatter. That formatter would expand the destination's {{VALUE:...}} placeholders (it opened date prompts in testing) and any tokens in the clipboard (the same class as issue 1927). A real version needs an internal literal-prompt path on Agent.
  • Single-line fields hold single-line answers, so a "key points" list arrives as one line.
  • Output quality depends on the model. Across 5 task fills, one produced "Review my PR" instead of "Review Bo's PR", and the tag field varied between quickadd and quickadd-cli. The review-before-submit step exists for this.
  • The AI Assistant's own "Assistant is finished" notice shows next to the fill notice when Show assistant is on.
  • The button only exists in the one-page form, and one-page input is off by default: 4 of 589 public vaults turn it on globally. Shipping this likely means offering the form whenever the button would apply, or putting the button on the single-field prompt too. That is a product decision.

Note

Add clipboard-based AI form filling to one-page preflight inputs

  • Adds a "Fill from clipboard" button to OnePageInputModal that sends clipboard text to the configured default AI model and fills only fields that are empty or still at their default value
  • Adds createFillFromText.ts which builds a string-valued JSON schema from fillable fields (text, textarea, number, dropdown, date, suggester; excluding internal __-prefixed and file-picker fields) and includes Capture/Template destination context, capped at 4000 characters
  • Returned values are written through the control's normal input/change events, so existing parsing, validation, and preview run as if typed; non-targeted fields are untouched and file pickers must be handled manually
  • Filling is only enabled when online AI features are on and a concrete default model is set; AI-disabled, "Ask me", and unset-model configurations get no fill button
  • Risk: OnePageInputModal.ts typeIntoField uses the nonstandard input.instanceOf(HTMLSelectElement) property, which may fail TypeScript compilation or runtime checks before event dispatch; marked as a prototype not for merge in the PR title
📊 Macroscope summarized eae4cd5. 5 files reviewed, 5 issues evaluated, 2 issues filtered, 3 comments posted

🗂️ Filtered Issues

src/preflight/OnePageInputModal.ts — 3 comments posted, 4 evaluated, 1 filtered
  • line 265: A dropdown with no options is included in empty and sent to the model, but its renderer disables the select and never installs an onChange handler. When the model returns a nonempty value, typeIntoField cannot publish it to result, while filled still counts it and the success notice incorrectly says that field was filled. Exclude disabled/optionless dropdowns from the fill request/count. [ Out of scope (post-validation triage) ]
src/preflight/createFillFromText.ts — 0 comments posted, 1 evaluated, 1 filtered
  • line 47: defaultModelRef is used whenever it exists, without confirming that its name still equals defaultModel. A persisted stale ref is explicitly supported elsewhere as inert; here it instead sends the request to the stale provider/model even after the user has changed the visible default model. [ Previously rejected ]

@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: eae4cd5
Status: ✅  Deploy successful!
Preview URL: https://14a83b0a.quickadd.pages.dev
Branch Preview URL: https://prototype-fill-form-from-tex.quickadd.pages.dev

View logs

Comment thread src/preflight/OnePageInputModal.ts Outdated
Comment thread src/preflight/OnePageInputModal.ts Outdated
Comment thread src/preflight/OnePageInputModal.ts Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant