From dee4a4056aa0b7c76f4df5dba7900785cac66ba0 Mon Sep 17 00:00:00 2001 From: "exe.dev user" Date: Wed, 11 Nov 2026 19:26:53 +0000 Subject: [PATCH 1/5] GEN-2901 split job settings into pages --- packages/app/src/features/jobs/editor.tsx | 29 ++++++++++++----------- packages/app/src/features/jobs/routes.tsx | 6 +++-- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/app/src/features/jobs/editor.tsx b/packages/app/src/features/jobs/editor.tsx index c1f4f250..e0a7a1ff 100644 --- a/packages/app/src/features/jobs/editor.tsx +++ b/packages/app/src/features/jobs/editor.tsx @@ -1,7 +1,6 @@ import { RunPermissions, defaultRunScopes } from "./run-permissions"; import { Disclosure, Summary, Button, Input, Select, Label, Page, Card, Textarea } from "../../shared/ui"; import { Dialog } from "../../shared/dialog"; -import { JobHeader } from "./header"; import { DeleteJob } from "./delete"; import { validationMessage } from "./validation-message"; import { useEffect, useState, useRef } from "react"; @@ -15,18 +14,18 @@ import { TemplateField } from "./template-field"; import { TriggerEditor } from "./trigger-editor"; import { InvocationPermissionEditor } from "./invocation-permission-editor"; import { messageOf } from "../auth/session"; -import { projectQuery, projectsQuery } from "../projects/queries"; +import { projectsQuery } from "../projects/queries"; import { AutosaveStatus, useDebouncedAutosave } from "../../shared/use-debounced-autosave"; import { skillsQuery } from "../skills/queries"; import { JobNav } from "./job-nav"; export function JobEditor() { - const { jobId } = useParams({ strict: false }); + const { jobId, section } = useParams({ strict: false }); const job = useQuery({ ...jobQuery(jobId ?? ""), enabled: !!jobId }); if (jobId && job.isPending) return

Loading job configuration…

; if (jobId && job.error) return

{job.error.message}

; - return <>{job.data?.projectId && }; + return <>{job.data?.projectId && }; } -function EditorForm({ initial }: { initial?: Job }) { +function EditorForm({ initial, section }: { initial?: Job; section?: string }) { const location = useLocation(), navigate = useNavigate(), cache = useQueryClient(); const [base, setBase] = useState(initial ? editableJob(initial) : emptyJob); const [draft, setDraft] = useState(base), [revision, setRevision] = useState(initial?.updatedAt); @@ -34,10 +33,9 @@ function EditorForm({ initial }: { initial?: Job }) { const [reconciling, setReconciling] = useState(false), [saved, setSaved] = useState(false), [invalidForm, setInvalidForm] = useState(false); const savingNavigation = useRef(false); const dirty = JSON.stringify(base) !== JSON.stringify(draft); - useBlocker({ shouldBlockFn: () => dirty && !savingNavigation.current && !window.confirm("Discard unsaved job changes?"), enableBeforeUnload: dirty }); + useBlocker({ shouldBlockFn: ({ next }) => dirty && !(initial && next.pathname.startsWith(`/jobs/${initial.id}/settings/`)) && !savingNavigation.current && !window.confirm("Discard unsaved job changes?"), enableBeforeUnload: dirty }); useEffect(() => { const handler = (event: BeforeUnloadEvent) => { if (dirty) { event.preventDefault(); event.returnValue = ""; } }; window.addEventListener("beforeunload", handler); return () => window.removeEventListener("beforeunload", handler); }, [dirty]); const targets = useQuery(targetsQuery), metadata = useQuery(metadataQuery), skills = useQuery(skillsQuery()); - const project = useQuery({ ...projectQuery(initial?.projectId ?? ""), enabled: !!initial?.projectId }); const projects = useQuery({ ...projectsQuery, enabled: !initial }); const target = targets.data?.find(t => t.id === draft.executionConfigId); const verificationFingerprint = JSON.stringify([draft.executionConfigId, canonicalizeVmImage(draft.vmImage ?? ""), draft.tags ?? [], target?.agentKind ?? ""]); @@ -90,18 +88,21 @@ function EditorForm({ initial }: { initial?: Job }) { if (conflicts.length === 1) setRemote(undefined); }; const [localConflictDraft, setLocalConflictDraft] = useState(draft); - return {initial && } + const selectedSection = initial && ["general", "execution", "context", "permissions", "triggers"].includes(section ?? "") ? section : initial ? "general" : "all"; + const show = (name: string) => selectedSection === "all" || selectedSection === name; + const settingsSection = (name: "general" | "execution" | "context" | "permissions" | "triggers") => {name[0].toUpperCase() + name.slice(1)}; + return {(remote || reconciling || refreshConflict.error) &&

This job changed while you were editing

Your unsaved draft is retained. Review the latest configuration before retrying.

{refreshConflict.isPending &&

Loading latest configuration…

}{refreshConflict.error && <>

{refreshConflict.error.message}

} {remote && !conflicts.length && <>
{JSON.stringify(editableJob(remote), null, 2)}
} {conflicts.map(field =>
Both versions changed {field}
Mine: {JSON.stringify(localConflictDraft[field], null, 2)}
Latest: {JSON.stringify(base[field], null, 2)}
)}
}
{ e.preventDefault(); save.mutate(draft); }}> - +
-

General

Set the job name, description, and stable identifier.

{!initial &&
{projects.isPending &&

Loading projects…

}{projects.error &&

{projects.error.message}

}
} + {show("general") &&

General

Set the job name, description, and stable identifier.

{!initial &&
{projects.isPending &&

Loading projects…

}{projects.error &&

{projects.error.message}

}
}