fix: lock lighthouse launch flow to auto sampling (#80)

* fix: lock lighthouse launch flow to auto sampling

* save
This commit is contained in:
Ben Senescu 2026-04-04 18:46:56 -04:00 committed by Ben Senescu
parent f75a1d4156
commit bbed7c760a
3 changed files with 9 additions and 29 deletions

View File

@ -132,9 +132,9 @@ function LighthouseOptions({ launchForm }: Pick<Props, "launchForm">) {
</launchForm.Field> </launchForm.Field>
<span <span
className="text-sm font-medium text-base-content/80" className="text-sm font-medium text-base-content/80"
title="Run Lighthouse checks through DataForSEO during this audit" title="Lighthouse measures the performance of your pages and identifies issues."
> >
Include Lighthouse checks Include Lighthouse
</span> </span>
</label> </label>
@ -143,27 +143,11 @@ function LighthouseOptions({ launchForm }: Pick<Props, "launchForm">) {
> >
{(runLighthouse) => {(runLighthouse) =>
runLighthouse ? ( runLighthouse ? (
<div className="flex flex-wrap items-center gap-2"> <div className="space-y-1">
<span className="text-xs text-base-content/60">Audit scope</span> <p className="text-xs text-base-content/60">
<launchForm.Field name="lighthouseMode"> We choose a sample of 20 pages to audit, removing pages from
{(field) => ( duplicate templates.
<select </p>
className="select select-bordered select-xs"
value={field.state.value}
onChange={(event) =>
field.handleChange(
event.target.value === "all" ? "all" : "auto",
)
}
>
<option value="auto">Auto sample (recommended)</option>
<option value="all">All crawled pages</option>
</select>
)}
</launchForm.Field>
<span className="text-xs text-base-content/50">
Powered by DataForSEO Lighthouse
</span>
</div> </div>
) : null ) : null
} }

View File

@ -5,12 +5,10 @@ export type LaunchFormValues = {
url: string; url: string;
maxPagesInput: string; maxPagesInput: string;
runLighthouse: boolean; runLighthouse: boolean;
lighthouseMode: "auto" | "all";
}; };
export const DEFAULT_LAUNCH_FORM_VALUES: LaunchFormValues = { export const DEFAULT_LAUNCH_FORM_VALUES: LaunchFormValues = {
url: "", url: "",
maxPagesInput: "50", maxPagesInput: "50",
runLighthouse: false, runLighthouse: false,
lighthouseMode: "auto",
}; };

View File

@ -81,9 +81,7 @@ export function useLaunchController({
projectId, projectId,
startUrl: value.url, startUrl: value.url,
maxPages: effectiveMaxPages, maxPages: effectiveMaxPages,
lighthouseStrategy: value.runLighthouse lighthouseStrategy: value.runLighthouse ? "auto" : "none",
? value.lighthouseMode
: "none",
}); });
toast.success("Audit started!"); toast.success("Audit started!");
onAuditStarted(result.auditId); onAuditStarted(result.auditId);
@ -117,7 +115,7 @@ function useLaunchMutations({
projectId: string; projectId: string;
startUrl: string; startUrl: string;
maxPages: number; maxPages: number;
lighthouseStrategy: "auto" | "all" | "none"; lighthouseStrategy: "auto" | "none";
}) => startAudit({ data }), }) => startAudit({ data }),
}); });