From 19316197819ef3d22765a631aab484b236ea3f3f Mon Sep 17 00:00:00 2001 From: Nicolas Lenepveu Date: Sun, 31 May 2026 19:58:48 +0200 Subject: [PATCH] feat(web): add "(use step default)" reset to watcher profile selects (#1124) --- .../components/github/issue-watch-dialog.tsx | 35 ++++++++------ .../components/github/review-watch-dialog.tsx | 33 +++++++------ .../jira/jira-issue-watch-dialog.tsx | 31 ++++++++----- .../linear/linear-issue-watch-dialog.tsx | 31 ++++++++----- .../integrations/linear-settings.spec.ts | 5 ++ .../mobile-linear-watcher-profile.spec.ts | 8 ++++ .../watcher-profile-default-flow.ts | 46 +++++++++++++++++++ apps/web/lib/watcher-profile-default.test.ts | 17 +++++++ apps/web/lib/watcher-profile-default.ts | 14 ++++++ 9 files changed, 169 insertions(+), 51 deletions(-) create mode 100644 apps/web/e2e/tests/integrations/mobile-linear-watcher-profile.spec.ts create mode 100644 apps/web/e2e/tests/integrations/watcher-profile-default-flow.ts create mode 100644 apps/web/lib/watcher-profile-default.test.ts create mode 100644 apps/web/lib/watcher-profile-default.ts diff --git a/apps/web/components/github/issue-watch-dialog.tsx b/apps/web/components/github/issue-watch-dialog.tsx index e14c78e4c4..ec2d148ef2 100644 --- a/apps/web/components/github/issue-watch-dialog.tsx +++ b/apps/web/components/github/issue-watch-dialog.tsx @@ -31,6 +31,7 @@ import { DEFAULT_ISSUE_WATCH_PROMPT, } from "@/components/github/issue-watch-placeholders"; import { RepoFilterSelector } from "@/components/github/repo-filter-selector"; +import { STEP_DEFAULT, STEP_DEFAULT_LABEL, resolveProfileId } from "@/lib/watcher-profile-default"; import type { RepoFilter, IssueWatch, @@ -300,23 +301,29 @@ function IssueAutomationFields({
setForm((prev) => ({ ...prev, agentProfileId: v }))} - placeholder="Select agent profile" - items={agentProfiles.map((p) => ({ - id: p.id, - label: p.label, - icon: p.cli_passthrough ? : undefined, - }))} + description="Optional — falls back to step default." + value={form.agentProfileId || STEP_DEFAULT} + onChange={(v) => setForm((prev) => ({ ...prev, agentProfileId: resolveProfileId(v) }))} + placeholder={STEP_DEFAULT_LABEL} + items={[ + { id: STEP_DEFAULT, label: STEP_DEFAULT_LABEL }, + ...agentProfiles.map((p) => ({ + id: p.id, + label: p.label, + icon: p.cli_passthrough ? : undefined, + })), + ]} /> setForm((prev) => ({ ...prev, executorProfileId: v }))} - placeholder="Select executor profile" - items={allExecutorProfiles.map((p) => ({ id: p.id, label: p.name }))} + description="Optional — falls back to step default." + value={form.executorProfileId || STEP_DEFAULT} + onChange={(v) => setForm((prev) => ({ ...prev, executorProfileId: resolveProfileId(v) }))} + placeholder={STEP_DEFAULT_LABEL} + items={[ + { id: STEP_DEFAULT, label: STEP_DEFAULT_LABEL }, + ...allExecutorProfiles.map((p) => ({ id: p.id, label: p.name })), + ]} />
diff --git a/apps/web/components/github/review-watch-dialog.tsx b/apps/web/components/github/review-watch-dialog.tsx index e6b5211e14..b78e3a0791 100644 --- a/apps/web/components/github/review-watch-dialog.tsx +++ b/apps/web/components/github/review-watch-dialog.tsx @@ -29,6 +29,7 @@ import { import { DEFAULT_REVIEW_WATCH_PROMPT } from "@/components/github/review-watch-placeholders"; import { ReviewWatchPromptField } from "@/components/github/review-watch-prompt-field"; import { RepoFilterSelector } from "@/components/github/repo-filter-selector"; +import { STEP_DEFAULT, STEP_DEFAULT_LABEL, resolveProfileId } from "@/lib/watcher-profile-default"; import type { RepoFilter, ReviewWatch, @@ -441,15 +442,18 @@ function ProfileFields({
setForm((prev) => ({ ...prev, agentProfileId: v }))} - placeholder="Select agent profile" - items={agentProfiles.map((p) => ({ - id: p.id, - label: p.label, - icon: p.cli_passthrough ? : undefined, - }))} + description="Optional — falls back to step default." + value={form.agentProfileId || STEP_DEFAULT} + onChange={(v) => setForm((prev) => ({ ...prev, agentProfileId: resolveProfileId(v) }))} + placeholder={STEP_DEFAULT_LABEL} + items={[ + { id: STEP_DEFAULT, label: STEP_DEFAULT_LABEL }, + ...agentProfiles.map((p) => ({ + id: p.id, + label: p.label, + icon: p.cli_passthrough ? : undefined, + })), + ]} />
@@ -457,16 +461,19 @@ function ProfileFields({

- The executor environment where the agent will run. + Optional — falls back to step default. The executor environment where the agent will run.