diff --git a/packages/app/src/ui.ts b/packages/app/src/ui.ts index 1cdf7365..f5279bd6 100644 --- a/packages/app/src/ui.ts +++ b/packages/app/src/ui.ts @@ -210,8 +210,10 @@ ${dashboardHead("Jobs", "Create reusable agent work and choose exactly how it st async function load(){const jobs=await request('/api/jobs');const root=$('#jobs');if(!jobs.length){root.innerHTML='

No jobs yet

Create a manual-only or automatically triggered job.

';return}root.innerHTML=''}load().catch(e=>$('#jobs').innerHTML='

'+esc(e.message)+'

');`); export const jobPage = (viewer: { email: string }, jobId?: string) => shell(`${jobId ? "Edit" : "Create"} job — Factorize`, viewer, `
← Jobs
${dashboardHead(jobId ? "Edit job" : "Create a job", "Every prompt input comes from an explicit trigger row with a stable context slug.")}
-
-

Triggers

Context slugTypeConfigurationEnabledActions
+

Step 1

Job details

Name this job and set how many runs it can process at once.

+

Step 2

Triggers

Choose the events that start this job and expose prompt context.

Context slugTypeConfigurationEnabledActions
+

Step 3

Prompt and context

Write the instructions for each run using context supplied by your triggers.

+

Step 4

Execution target

Select the connected environment that will run this job.

Add trigger

Provider credentials stay managed by Factorize.

diff --git a/packages/app/test/ui.test.ts b/packages/app/test/ui.test.ts index 51b38a58..9f7c49d2 100644 --- a/packages/app/test/ui.test.ts +++ b/packages/app/test/ui.test.ts @@ -151,6 +151,23 @@ describe("pages", () => { expectInlineScriptsToParse(html); }); + it("organizes create and edit job fields into the same four-step sequence", () => { + for (const html of [jobPage({ email: "owner@example.com" }), jobPage({ email: "owner@example.com" }, "job-1")]) { + const basics = html.indexOf('id="job-basics-title"'); + const triggers = html.indexOf('id="job-triggers-title"'); + const prompt = html.indexOf('id="job-prompt-title"'); + const target = html.indexOf('id="job-target-title"'); + expect(basics).toBeGreaterThan(-1); + expect(basics).toBeLessThan(triggers); + expect(triggers).toBeLessThan(prompt); + expect(prompt).toBeLessThan(target); + expect(html).toContain("Name this job and set how many runs it can process at once."); + expect(html).toContain("Choose the events that start this job and expose prompt context."); + expect(html).toContain("Write the instructions for each run using context supplied by your triggers."); + expect(html).toContain("Select the connected environment that will run this job."); + } + }); + it("renders accessible icon actions for editing and removing triggers", () => { const editor = jobPage({ email: "owner@example.com" }, "job-1"); expect(editor).toContain('aria-label="Edit trigger" title="Edit trigger"');