Repository navigation
feat(api): allow custom title and description in requestInputs - #2294
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Deploying quickadd with
|
| Latest commit: |
c9d8fcf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://91f1b4b8.quickadd.pages.dev |
| Branch Preview URL: | https://issue-2293.quickadd.pages.dev |
Independent verification: PASS+NOTESHead The PR does what #2293 asks. A script can name the Automated runs
Manual runs in the isolated Obsidian 1.14.4 instanceEach probe called
The title stayed the same after returning from Peek. Escape rejected with Layout. I tested a long title with a 3-sentence, 2-line description.
Notes (non-blocking)
|
Why
Scripts calling
quickAddApi.requestInputscould not change the hardcoded "Provide inputs" heading to give users guidance while filling out a form. Closes #2293.What changed
src/preflight/formHeader.ts(DEFAULT_ONE_PAGE_FORM_TITLE,OnePageFormHeader,sanitizeOnePageFormHeader) to parse script-supplied header options at the API boundary.OnePageInputModal's trailing optional constructor arguments intoOnePageInputModalOptions, rendering customtitleand optional multi-linedescriptionwhile keepingInputPromptPeekin sync withtitle.quickAddApi.requestInputs(inputs, options?)to accept{ title?: string; description?: string }, nametitlein non-interactive abort errors, and forward the header on the remote interactivetype: "form"wire spec (PromptProtocolandRemotePromptProvider)..qa-onepage-titleand.qa-onepage-descriptioninsrc/styles.css.options.titleandoptions.descriptioninQuickAddAPI.mdandonePageInputs.md.Scope
Runtime
quickAddApi.requestInputsforms andOnePageInputModaloptions. Choice preflight forms (runOnePagePreflight) keep the default "Provide inputs" heading.Tradeoffs
requestInputs(inputs, { title, description })) instead of a bare string or union to matchpickChoice,datePrompt,executeChoice, andapplyTemplateToActiveFileand leave one way to pass form-level options.descriptionalongsidetitleso scripts can keep headings short while giving multi-line guidance underneath.Blast Radius
Backwards-compatible optional second argument on
quickAddApi.requestInputsand additive optionaltitle/descriptionkeys on the remoteformprompt spec (omitted when unset or blank). No migration or settings impact.Verification
pnpm run lintpassed with 0 errors and 0 warnings (oxlint,svelte-policy,tsc,svelte-check).pnpm run buildpassed.request-inputs-header.test.ts,apply-template-one-page.test.ts, andone-page-alignment.test.ts).dev:errorsin isolated Obsidian.Note
Low Risk
Backward-compatible optional second argument on requestInputs and additive UI/wire fields; no changes to choice preflight or core execution paths.
Overview
Adds an optional second
optionsargument toquickAddApi.requestInputs, so scripts can set a custom form title (replacing the default "Provide inputs") and an optional multi-line description shown under the heading.Header values are sanitized at the API boundary (
sanitizeOnePageFormHeader), rendered inOnePageInputModal(including Peek chip title), forwarded to remote interactivetype: "form"prompts, and used in non-interactive abort messages when a title is set. Choice preflight forms are unchanged and still use the default heading.Documentation and styles for
.qa-onepage-title/.qa-onepage-descriptionare included; this is a backwards-compatible optional API extension.Reviewed by Cursor Bugbot for commit c9d8fcf. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add optional
titleanddescriptionoptions torequestInputsrequestInputsaccepts an optional second argument withtitleanddescriptionfor the one-page input form, sanitized in formHeader.ts (trimmed, blank values dropped)OnePageInputModalrenders the header, falling back toProvide inputsfor a missing title; descriptions render with pre-line line breaksformprompt spec via promptProvider.tsOnePageInputModalconstructor to an options object (computePreview,discoveryForm); call sites in runOnePagePreflight.ts and tests updatedMacroscope summarized c9d8fcf.
Summary by CodeRabbit
requestInputsforms can now display a custom title and description. Blank or omitted values retain the default heading and omit the description.