MCPcopy Create free account
hub / github.com/chhoumann/quickadd / runOnePagePreflightIfEnabled

Method runOnePagePreflightIfEnabled

src/choiceExecutor.ts:246–278  ·  view source on GitHub ↗
(choice: IChoice)

Source from the content-addressed store, hash-verified

244 }
245
246 private async runOnePagePreflightIfEnabled(choice: IChoice): Promise<void> {
247 // One-page preflight honoring per-choice override.
248 const globalEnabled = settingsStore.getState().onePageInputEnabled;
249 const override = choice.onePageInput;
250 // A remote interactive run (Raycast) has no in-app modal fallback, so it must
251 // collect a choice's declared inputs up front via the provider regardless of
252 // the global one-page setting - otherwise those inputs are never gathered and
253 // the run proceeds with them empty.
254 const remote = this.promptProvider != null;
255 const shouldUseOnePager =
256 override === "always" ||
257 (override !== "never" && (globalEnabled || remote));
258 if (
259 shouldUseOnePager &&
260 (choice.type === "Template" ||
261 choice.type === "Capture" ||
262 choice.type === "Macro")
263 ) {
264 try {
265 await runOnePagePreflight(
266 this.app,
267 this.plugin as unknown as QuickAdd,
268 this,
269 choice,
270 );
271 } catch (error) {
272 if (isCancellationError(error)) {
273 throw new UserCancelError("One-page input cancelled by user");
274 }
275 throw error;
276 }
277 }
278 }
279
280 private async onChooseTemplateType(
281 templateChoice: ITemplateChoice,

Callers 2

executeMethod · 0.95
executeWithOutcomeMethod · 0.95

Calls 2

runOnePagePreflightFunction · 0.90
isCancellationErrorFunction · 0.90

Tested by

no test coverage detected