From 5b3664a28703b2776bb00128de9da361b0e63521 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 10 Oct 2026 22:43:09 +0000 Subject: [PATCH 1/4] feat(ui): guess names for new pipelines, workflows, templates and API tokens A new pipeline, workflow, template or API token no longer needs a name typed: the field shows a guess (from the pipeline's steps, what the workflow runs on, the template's kind, the token's scope), numbered when it's taken, and Create uses it unless something else is typed, as routines already did. The pencil next to the name renames them later; PATCH /pipelines/{id}, /templates/{id} and /tokens/{id} are new for that. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_014pKRz6HkdQ7hTqEbpnyhYo --- CHANGELOG.md | 5 + docs/api.md | 12 +- docs/authentication.md | 3 +- docs/processing.md | 4 + fastapi_backend/app/api/v1/routes/auth.py | 12 + .../app/api/v1/routes/pipelines.py | 12 +- .../app/api/v1/routes/templates.py | 16 +- fastapi_backend/app/domain/auth.py | 7 + fastapi_backend/app/domain/pipelines.py | 12 + fastapi_backend/app/domain/templates.py | 12 + fastapi_backend/app/schemas/auth.py | 4 + fastapi_backend/app/schemas/pipelines.py | 5 + fastapi_backend/app/schemas/templates.py | 5 + fastapi_backend/tests/api/test_auth.py | 4 + fastapi_backend/tests/api/test_pipelines.py | 8 + fastapi_backend/tests/api/test_templates.py | 7 + nextjs-frontend/__tests__/less-typing.test.ts | 25 +- .../__tests__/rename-title.test.tsx | 48 ++++ nextjs-frontend/app/openapi-client/index.ts | 18 ++ nextjs-frontend/app/openapi-client/sdk.gen.ts | 63 +++++ .../app/openapi-client/types.gen.ts | 128 ++++++++++ .../components/account/token-model.ts | 7 +- nextjs-frontend/components/account/tokens.tsx | 32 ++- .../components/pipelines/pipeline-editor.tsx | 31 ++- .../components/pipelines/pipeline-model.ts | 14 ++ .../components/templates/new-template.tsx | 23 +- .../components/templates/template-editor.tsx | 18 +- .../components/templates/template-model.ts | 8 + .../components/ui/rename-title.tsx | 83 +++++++ .../components/workflows/workflow-editor.tsx | 31 ++- .../components/workflows/workflow-model.ts | 7 + nextjs-frontend/lib/format.ts | 10 + nextjs-frontend/openapi.json | 227 ++++++++++++++++++ 33 files changed, 865 insertions(+), 36 deletions(-) create mode 100644 nextjs-frontend/__tests__/rename-title.test.tsx create mode 100644 nextjs-frontend/components/ui/rename-title.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f6d93f4..a0cc28aa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ The backend (`fastapi_backend`) and the frontend (`nextjs-frontend`) are version ## Unreleased +- **New pipelines, workflows, templates and API tokens come with a name.** The web app guesses one from what you're + making ("Transcribe to report", "Recording workflow", "Prompt template 2", "Read only token"), as it already did for + routines, so making one takes no typing; type over it to choose your own. The pencil next to the name renames it + later, and `PATCH /api/v1/pipelines/{id}`, `/templates/{id}` and `/tokens/{id}` rename them through the API. + - **The graph as files.** Graph nodes are folders, nested along its links: collections inside collections, topics inside their broader topics, entities by type. Each folder holds its assets' files, with a `.json` sidecar of metadata and a `.txt` of the text; everyone sees what the web app shows them. Browse and read it through the API diff --git a/docs/api.md b/docs/api.md index b7839a1c1..292fd6a1b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -62,6 +62,7 @@ accounts. See [Authentication](authentication.md#signing-in-passkeys). GET /api/v1/tokens GET /api/v1/tokens/limits POST /api/v1/tokens +PATCH /api/v1/tokens/{token_id} DELETE /api/v1/tokens/{token_id} GET /api/v1/admin/tokens DELETE /api/v1/admin/tokens/{token_id} @@ -69,7 +70,8 @@ DELETE /api/v1/admin/tokens/{token_id} `POST /tokens {name, scope, days?}` makes an API key (while signed in). `days` defaults to `tokens.default_days`; more than `tokens.max_days`, or `0` (never expires) when `tokens.never_expire` is off, is a 400. `GET /tokens/limits` says -`{default_days, max_days, never_expire}`. `/admin/tokens` lists everyone's keys with their owner's `email` (admins), and +`{default_days, max_days, never_expire}`. `PATCH /tokens/{token_id} {name}` renames one of your keys (audited as +`token.rename`). `/admin/tokens` lists everyone's keys with their owner's `email` (admins), and `DELETE /admin/tokens/{token_id}` revokes any of them; revoking is audited as `token.revoke`. ## oauth @@ -1139,20 +1141,28 @@ GET /api/v1/templates POST /api/v1/templates POST /api/v1/templates/preview GET /api/v1/templates/{tid} +PATCH /api/v1/templates/{tid} POST /api/v1/templates/{tid}/versions GET /api/v1/templates/{tid}/diff ``` +`PATCH {name?, description?}` renames a template or changes its description (admins); its text changes by saving a +version. + ## pipelines ``` GET /api/v1/pipelines POST /api/v1/pipelines GET /api/v1/pipelines/{pid} +PATCH /api/v1/pipelines/{pid} POST /api/v1/pipelines/{pid}/versions POST /api/v1/pipelines/{pid}/run ``` +`PATCH {name?, description?}` renames a pipeline or changes its description (admins); its steps change by saving a +version. + ## chats ``` diff --git a/docs/authentication.md b/docs/authentication.md index bf7ba763b..f42b960b0 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -121,7 +121,8 @@ For scripts and integrations: `POST /api/v1/tokens` (while signed in) returns `l **write** scoped, act with their maker's roles, and expire after `days`: by default `tokens.default_days`, at most `tokens.max_days`, and never (`0`) only where `tokens.never_expire` allows ([Configuration](configuration.md#api-keys); `GET /api/v1/tokens/limits` says what's allowed). Their maker revokes them, and admins can revoke anyone's -(`/api/v1/admin/tokens`); both are audited as `token.revoke`. +(`/api/v1/admin/tokens`); both are audited as `token.revoke`. The web app names a new token after its scope ("Read only +token") unless you type a name, and the pencil in the list renames it (`PATCH /api/v1/tokens/{token_id}`). ```bash curl -H "Authorization: Bearer la_…" https://lens.example.org/api/v1/resources diff --git a/docs/processing.md b/docs/processing.md index 5ac1c611e..6fff56799 100644 --- a/docs/processing.md +++ b/docs/processing.md @@ -348,6 +348,10 @@ strings. A fresh archive starts with three: Meeting notes (prompt), Markdown tra `POST /api/v1/templates/preview` renders any template, saved or not, against a recording, and with `run: true` also asks the model. +New pipelines, workflows, templates and routines don't need a name typed: the web app guesses one (from a pipeline's +steps, what a workflow runs on, a template's kind, a routine's schedule and actions), numbered when it's taken +("Prompt template 2"). The pencil next to the name on its page renames it later, as does `PATCH` on its address. + ## Workflows and the canvas A pipeline's steps make assets (a transcript, shots, text on screen, faces); workflows turn them into metadata. A diff --git a/fastapi_backend/app/api/v1/routes/auth.py b/fastapi_backend/app/api/v1/routes/auth.py index eec85620d..5a2dca693 100644 --- a/fastapi_backend/app/api/v1/routes/auth.py +++ b/fastapi_backend/app/api/v1/routes/auth.py @@ -17,6 +17,7 @@ ApiToken, ApiTokenCreate, ApiTokenCreated, + ApiTokenRename, AuthStatus, ForgotPasswordRequest, LoginRequest, @@ -202,6 +203,17 @@ def create_token(body: ApiTokenCreate, user: Writer, db: Db, cfg: Cfg) -> ApiTok return ApiTokenCreated(id=tid, token=raw) +@tokens.patch("/{token_id}") +def rename_token(token_id: int, body: ApiTokenRename, user: Writer, db: Db) -> Ok: + """Rename one of your keys.""" + with domain_errors(): + found = auth.rename_token(db, user.id, token_id, body.name) + if not found: + raise HTTPException(404, "not found") + auth.audit(db, user.as_audit(), "token.rename", f"api_token:{token_id}") + return Ok() + + @tokens.delete("/{token_id}") def revoke_token(token_id: int, user: Writer, db: Db) -> Ok: """Revoke one of your keys. Audited as `token.revoke`.""" diff --git a/fastapi_backend/app/api/v1/routes/pipelines.py b/fastapi_backend/app/api/v1/routes/pipelines.py index ed686faf4..d6d4869bd 100644 --- a/fastapi_backend/app/api/v1/routes/pipelines.py +++ b/fastapi_backend/app/api/v1/routes/pipelines.py @@ -6,13 +6,14 @@ from app.api.deps import Acl, AdminWriter, CurrentUser, Db, Writer, domain_errors from app.domain import auth, content_types, jobs, pipelines -from app.schemas.common import Created +from app.schemas.common import Created, Ok from app.schemas.pipelines import ( JobQueued, Pipeline, PipelineCatalog, PipelineCreate, PipelineRunRequest, + PipelineUpdate, PipelineVersionCreate, ) from app.schemas.templates import VersionSaved @@ -58,6 +59,15 @@ def get_pipeline(pid: int, user: CurrentUser, db: Db, version: int | None = None return p +@router.patch("/{pid}") +def update_pipeline(pid: int, body: PipelineUpdate, user: AdminWriter, db: Db) -> Ok: + """Its name and description (the steps change by saving a version).""" + with domain_errors(): + pipelines.rename(db, pid, body.name, body.description) + auth.audit(db, user.as_audit(), "pipeline.update", f"pipeline:{pid}") + return Ok() + + @router.post("/{pid}/versions") def create_pipeline_version(pid: int, body: PipelineVersionCreate, user: AdminWriter, db: Db) -> VersionSaved: with domain_errors(): diff --git a/fastapi_backend/app/api/v1/routes/templates.py b/fastapi_backend/app/api/v1/routes/templates.py index 9dc2e3606..94c9253e6 100644 --- a/fastapi_backend/app/api/v1/routes/templates.py +++ b/fastapi_backend/app/api/v1/routes/templates.py @@ -7,13 +7,14 @@ from app.api.deps import Acl, AdminWriter, Cfg, CurrentUser, Db, Writer from app.domain import auth, llm, templates -from app.schemas.common import Created +from app.schemas.common import Created, Ok from app.schemas.templates import ( Template, TemplateCreate, TemplatePreview, TemplatePreviewRequest, TemplateSummary, + TemplateUpdate, TemplateVersionCreate, VersionSaved, ) @@ -73,6 +74,19 @@ def get_template(tid: int, user: CurrentUser, db: Db, version: int | None = None raise HTTPException(404, "not found") from None +@router.patch("/{tid}") +def update_template(tid: int, body: TemplateUpdate, user: AdminWriter, db: Db) -> Ok: + """Its name and description (the text changes by saving a version).""" + try: + templates.rename(db, tid, body.name, body.description) + except KeyError: + raise HTTPException(404, "not found") from None + except templates.TemplateProblem as e: + raise HTTPException(400, str(e)) from None + auth.audit(db, user.as_audit(), "template.update", f"template:{tid}") + return Ok() + + @router.post("/{tid}/versions") def create_template_version(tid: int, body: TemplateVersionCreate, user: AdminWriter, db: Db) -> VersionSaved: try: diff --git a/fastapi_backend/app/domain/auth.py b/fastapi_backend/app/domain/auth.py index 93f486d23..8e69a9c6c 100644 --- a/fastapi_backend/app/domain/auth.py +++ b/fastapi_backend/app/domain/auth.py @@ -365,6 +365,13 @@ def list_tokens(db, uid): ) +def rename_token(db, uid, tid, name): + """Rename one of this person's keys; whether there was one.""" + if not name.strip(): + raise ValueError("give the token a name") + return bool(db.rows("UPDATE api_token SET name = $n WHERE account = $a AND id = $r", n=name.strip()[:80], a=uid, r=R("api_token", tid))) + + def revoke_token(db, uid, tid): """Revoke one of this person's keys; whether there was one.""" return bool(db.rows("DELETE api_token WHERE account = $a AND id = $r RETURN BEFORE", a=uid, r=R("api_token", tid))) diff --git a/fastapi_backend/app/domain/pipelines.py b/fastapi_backend/app/domain/pipelines.py index ba96b416d..b5d519ed6 100644 --- a/fastapi_backend/app/domain/pipelines.py +++ b/fastapi_backend/app/domain/pipelines.py @@ -167,6 +167,18 @@ def create(db, name, steps, description=None, user=None, graph=None): return pid +def rename(db, pid, name=None, description=None): + """A pipeline's name and description (its steps change by saving a version).""" + if not db.one("SELECT id FROM $r", r=R("pipeline", pid)): + raise KeyError(pid) + if name is not None: + if not name.strip(): + raise ValueError("give the pipeline a name") + db.q("UPDATE $r SET name = $n", r=R("pipeline", pid), n=name.strip()[:80]) + if description is not None: + db.q("UPDATE $r SET description = $d", r=R("pipeline", pid), d=description.strip() or None) + + def save_version(db, pid, steps, notes=None, user=None, publish=True, graph=None): if not db.one("SELECT id FROM $r", r=R("pipeline", pid)): raise KeyError(pid) diff --git a/fastapi_backend/app/domain/templates.py b/fastapi_backend/app/domain/templates.py index 22dcf7e6e..910c6c26e 100644 --- a/fastapi_backend/app/domain/templates.py +++ b/fastapi_backend/app/domain/templates.py @@ -171,6 +171,18 @@ def create(db, name, kind, body, schema=None, system=None, description=None, use return tid +def rename(db, tid, name=None, description=None): + """A template's name and description (its text changes by saving a version).""" + if not db.one("SELECT id FROM $r", r=R("template", tid)): + raise KeyError(tid) + if name is not None: + if not name.strip(): + raise TemplateProblem("give the template a name") + db.q("UPDATE $r SET name = $n", r=R("template", tid), n=name.strip()[:80]) + if description is not None: + db.q("UPDATE $r SET description = $d", r=R("template", tid), d=description.strip() or None) + + def save_version(db, tid, body, schema=None, system=None, notes=None, user=None, publish=True): t = db.one("SELECT kind FROM $r", r=R("template", tid)) if not t: diff --git a/fastapi_backend/app/schemas/auth.py b/fastapi_backend/app/schemas/auth.py index 49845b8a6..ea7deac4b 100644 --- a/fastapi_backend/app/schemas/auth.py +++ b/fastapi_backend/app/schemas/auth.py @@ -99,6 +99,10 @@ class TokenLimits(ResponseModel): never_expire: bool = Field(description="keys may be made that never expire (days: 0)") +class ApiTokenRename(RequestModel): + name: str = Field(min_length=1, max_length=80) + + class ApiToken(ResponseModel): id: int name: str diff --git a/fastapi_backend/app/schemas/pipelines.py b/fastapi_backend/app/schemas/pipelines.py index a249724a8..af147c8a2 100644 --- a/fastapi_backend/app/schemas/pipelines.py +++ b/fastapi_backend/app/schemas/pipelines.py @@ -72,6 +72,11 @@ class PipelineCreate(RequestModel): description: str | None = None +class PipelineUpdate(RequestModel): + name: str | None = None + description: str | None = None + + class PipelineVersionCreate(RequestModel): steps: list[Step] = Field(default_factory=list, description="the steps in order; or send a graph instead") graph: PipelineGraph | None = None diff --git a/fastapi_backend/app/schemas/templates.py b/fastapi_backend/app/schemas/templates.py index 479f83fee..e29c4c7e3 100644 --- a/fastapi_backend/app/schemas/templates.py +++ b/fastapi_backend/app/schemas/templates.py @@ -62,6 +62,11 @@ class TemplateCreate(RequestModel): description: str | None = None +class TemplateUpdate(RequestModel): + name: str | None = None + description: str | None = None + + class TemplateVersionCreate(RequestModel): model_config = ConfigDict(extra="forbid", populate_by_name=True) diff --git a/fastapi_backend/tests/api/test_auth.py b/fastapi_backend/tests/api/test_auth.py index e1d31f8f5..c963f4438 100644 --- a/fastapi_backend/tests/api/test_auth.py +++ b/fastapi_backend/tests/api/test_auth.py @@ -75,6 +75,10 @@ def test_api_tokens(client, db): assert client.post("/api/v1/tokens", json={"name": "x"}, headers=bearer).status_code == 403 # read-only listed = client.get("/api/v1/tokens", headers=h).json() assert [t["name"] for t in listed] == ["ci"] and "hash" not in listed[0] + assert client.patch(f"/api/v1/tokens/{tok['id']}", json={"name": " "}, headers=h).status_code == 400 + assert client.patch("/api/v1/tokens/999", json={"name": "x"}, headers=h).status_code == 404 + assert client.patch(f"/api/v1/tokens/{tok['id']}", json={"name": " ci runner "}, headers=h).status_code == 200 + assert [t["name"] for t in client.get("/api/v1/tokens", headers=h).json()] == ["ci runner"] assert client.post("/api/v1/tokens", json={"name": "x", "scope": "admin"}, headers=h).status_code == 422 assert client.delete(f"/api/v1/tokens/{tok['id']}", headers=h).status_code == 200 assert client.get("/api/v1/auth/me", headers=bearer).status_code == 401 diff --git a/fastapi_backend/tests/api/test_pipelines.py b/fastapi_backend/tests/api/test_pipelines.py index a5be72dec..9e8f20fdc 100644 --- a/fastapi_backend/tests/api/test_pipelines.py +++ b/fastapi_backend/tests/api/test_pipelines.py @@ -59,6 +59,14 @@ def test_pipelines_versions_and_runs(client, new_client, db, cfg): assert (p["version"], [v["version"] for v in p["history"]], p["history"][0]["notes"]) == (2, [2, 1], "less") assert client.get(f"/api/v1/pipelines/{pid}", params={"version": 1}, headers=h).json()["steps"][1]["key"] == "meeting_notes" assert client.get("/api/v1/pipelines/999", headers=h).status_code == 404 + # renamed and described without a new version: admins only, never to nothing + assert client.patch(f"/api/v1/pipelines/{pid}", headers=he, json={"name": "Mine"}).status_code == 403 + assert client.patch(f"/api/v1/pipelines/{pid}", headers=h, json={"name": " "}).status_code == 400 + assert client.patch("/api/v1/pipelines/999", headers=h, json={"name": "x"}).status_code == 404 + assert client.patch(f"/api/v1/pipelines/{pid}", headers=h, json={"name": " Notes v2 ", "description": "renamed"}).status_code == 200 + p = client.get(f"/api/v1/pipelines/{pid}", headers=h).json() + assert (p["name"], p["description"], p["version"]) == ("Notes v2", "renamed", 2) + assert client.patch(f"/api/v1/pipelines/{pid}", headers=h, json={"name": "Notes"}).status_code == 200 assert client.post(f"/api/v1/pipelines/{pid}/versions", headers=h, json={"steps": steps}).json()["version"] == 3 # running it on one recording: editors of its namespace only diff --git a/fastapi_backend/tests/api/test_templates.py b/fastapi_backend/tests/api/test_templates.py index 99d6ad9c4..3c59dbf2b 100644 --- a/fastapi_backend/tests/api/test_templates.py +++ b/fastapi_backend/tests/api/test_templates.py @@ -138,6 +138,13 @@ def test_templates_previews_and_versions(client, new_client, db, cfg, h): assert c.post("/api/v1/templates/preview", headers=he, json={"recording": rid, "body": "x"}).status_code == 404 assert c.post("/api/v1/templates", headers=he, json={"name": "x", "kind": "export", "body": "x"}).status_code == 403 # admins only assert c.get("/api/v1/templates", headers=he).status_code == 200 + # renamed and described without a new version: admins only, never to nothing + assert c.patch(f"/api/v1/templates/{new}", headers=he, json={"name": "Mine"}).status_code == 403 + assert c.patch(f"/api/v1/templates/{new}", headers=h, json={"name": " "}).status_code == 400 + assert c.patch("/api/v1/templates/999", headers=h, json={"name": "x"}).status_code == 404 + assert c.patch(f"/api/v1/templates/{new}", headers=h, json={"name": "Just titles", "description": ""}).status_code == 200 + t = c.get(f"/api/v1/templates/{new}", headers=h).json() + assert (t["name"], t["description"], t["version"]) == ("Just titles", None, 1) tid = tl["Markdown transcript"] assert ( diff --git a/nextjs-frontend/__tests__/less-typing.test.ts b/nextjs-frontend/__tests__/less-typing.test.ts index d893f024a..6ebcbc4e6 100644 --- a/nextjs-frontend/__tests__/less-typing.test.ts +++ b/nextjs-frontend/__tests__/less-typing.test.ts @@ -1,5 +1,9 @@ +import { suggestedTokenName } from "@/components/account/token-model"; +import { suggestedPipelineName } from "@/components/pipelines/pipeline-model"; import { suggestedName } from "@/components/routines/routine-model"; -import { nameFromEmail, nsSlug } from "@/lib/format"; +import { suggestedTemplateName } from "@/components/templates/template-model"; +import { suggestedWorkflowName } from "@/components/workflows/workflow-model"; +import { nameFromEmail, nsSlug, uniqueName } from "@/lib/format"; describe("less typing", () => { it("turns a typed namespace name into a valid one", () => { @@ -20,6 +24,25 @@ describe("less typing", () => { ); expect(suggestedName("manual", [])).toBe("On demand routine"); }); + + it("guesses a name nothing has yet", () => { + expect(uniqueName("Report page", [])).toBe("Report page"); + expect(uniqueName("Report page", ["report page ", "Report page 2", null])).toBe("Report page 3"); + }); + + it("names a pipeline, workflow, template and token nobody named", () => { + const standard = ["transcribe", "diarize", "analyze", "embed", "summarize", "report"].map((type) => ({ type })); + expect(suggestedPipelineName(standard, [])).toBe("Transcribe to report"); + expect(suggestedPipelineName([{ type: "analyze" }, { type: "summarize" }], [])).toBe("Analyze and summarize"); + expect(suggestedPipelineName([{ type: "llm", name: "Meeting notes" }], ["Meeting notes"])).toBe("Meeting notes 2"); + expect(suggestedPipelineName([], [])).toBe("New pipeline"); + expect(suggestedWorkflowName("recording", ["Recording workflow"])).toBe("Recording workflow 2"); + expect(suggestedWorkflowName("graph", [])).toBe("Graph workflow"); + expect(suggestedTemplateName("prompt", ["Meeting notes"])).toBe("Prompt template"); + expect(suggestedTemplateName("export", ["Export file"])).toBe("Export file 2"); + expect(suggestedTokenName("read", [])).toBe("Read only token"); + expect(suggestedTokenName("write", ["Read & write token"])).toBe("Read & write token 2"); + }); }); describe("a file's language", () => { diff --git a/nextjs-frontend/__tests__/rename-title.test.tsx b/nextjs-frontend/__tests__/rename-title.test.tsx new file mode 100644 index 000000000..1d4ef31ac --- /dev/null +++ b/nextjs-frontend/__tests__/rename-title.test.tsx @@ -0,0 +1,48 @@ +import { act, fireEvent, render, screen } from "@testing-library/react"; +import "@testing-library/jest-dom"; + +import { RenameTitle } from "@/components/ui/rename-title"; +import { TooltipProvider } from "@/components/ui/tooltip"; + +const show = (onRename?: (name: string) => Promise) => + render( + + + , + ); + +describe("a title renamed in place", () => { + it("opens with the name selected, and Enter saves the new one", async () => { + const rename = jest.fn(() => Promise.resolve()); + show(rename); + expect(screen.getByRole("heading", { name: "Transcribe to report" })).toBeInTheDocument(); + fireEvent.click(screen.getByRole("button", { name: "Rename pipeline" })); + const field = screen.getByRole("textbox", { name: "Pipeline name" }); + expect(field).toHaveFocus(); + expect([(field as HTMLInputElement).selectionStart, (field as HTMLInputElement).selectionEnd]).toEqual([0, 20]); + fireEvent.change(field, { target: { value: " Podcasts " } }); + await act(async () => { + fireEvent.submit(field); + }); + expect(rename).toHaveBeenCalledWith("Podcasts"); + expect(screen.queryByRole("textbox")).not.toBeInTheDocument(); + }); + + it("keeps the old name on Escape, or when nothing changed", async () => { + const rename = jest.fn(() => Promise.resolve()); + show(rename); + fireEvent.click(screen.getByRole("button", { name: "Rename pipeline" })); + fireEvent.keyDown(screen.getByRole("textbox"), { key: "Escape" }); + expect(screen.getByRole("heading", { name: "Transcribe to report" })).toBeInTheDocument(); + fireEvent.click(screen.getByRole("button", { name: "Rename pipeline" })); + await act(async () => { + fireEvent.submit(screen.getByRole("textbox")); + }); + expect(rename).not.toHaveBeenCalled(); + }); + + it("is a plain title for people who can't rename it", () => { + show(); + expect(screen.queryByRole("button", { name: "Rename pipeline" })).not.toBeInTheDocument(); + }); +}); diff --git a/nextjs-frontend/app/openapi-client/index.ts b/nextjs-frontend/app/openapi-client/index.ts index 81cff73c6..a581296f5 100644 --- a/nextjs-frontend/app/openapi-client/index.ts +++ b/nextjs-frontend/app/openapi-client/index.ts @@ -121,6 +121,7 @@ export type { ApiToken, ApiTokenCreate, ApiTokenCreated, + ApiTokenRename, ApplyEntitySetupData, ApplyEntitySetupError, ApplyEntitySetupErrors, @@ -2020,6 +2021,7 @@ export type { PipelineGraph, PipelineRunRequest, PipelineSummary, + PipelineUpdate, PipelineVersionCreate, PipelineVersionInfo, Placed, @@ -2267,6 +2269,11 @@ export type { RenameSpeakerErrors, RenameSpeakerResponse, RenameSpeakerResponses, + RenameTokenData, + RenameTokenError, + RenameTokenErrors, + RenameTokenResponse, + RenameTokenResponses, Rendition, ReprocessRecordingData, ReprocessRecordingError, @@ -2703,6 +2710,7 @@ export type { TemplatePreview, TemplatePreviewRequest, TemplateSummary, + TemplateUpdate, TemplateVersionCreate, TemplateVersionInfo, TermSuggestion, @@ -2961,6 +2969,11 @@ export type { UpdatePatternErrors, UpdatePatternResponse, UpdatePatternResponses, + UpdatePipelineData, + UpdatePipelineError, + UpdatePipelineErrors, + UpdatePipelineResponse, + UpdatePipelineResponses, UpdateRecordingAccessData, UpdateRecordingAccessError, UpdateRecordingAccessErrors, @@ -3002,6 +3015,11 @@ export type { UpdateSourceResponse, UpdateSourceResponses, UpdateStatus, + UpdateTemplateData, + UpdateTemplateError, + UpdateTemplateErrors, + UpdateTemplateResponse, + UpdateTemplateResponses, UpdateTopicData, UpdateTopicError, UpdateTopicErrors, diff --git a/nextjs-frontend/app/openapi-client/sdk.gen.ts b/nextjs-frontend/app/openapi-client/sdk.gen.ts index 4fd670a0b..0baee7870 100644 --- a/nextjs-frontend/app/openapi-client/sdk.gen.ts +++ b/nextjs-frontend/app/openapi-client/sdk.gen.ts @@ -1111,6 +1111,9 @@ import type { RenameSpeakerData, RenameSpeakerErrors, RenameSpeakerResponses, + RenameTokenData, + RenameTokenErrors, + RenameTokenResponses, ReprocessRecordingData, ReprocessRecordingErrors, ReprocessRecordingResponses, @@ -1448,6 +1451,9 @@ import type { UpdatePatternData, UpdatePatternErrors, UpdatePatternResponses, + UpdatePipelineData, + UpdatePipelineErrors, + UpdatePipelineResponses, UpdateRecordingAccessData, UpdateRecordingAccessErrors, UpdateRecordingAccessResponses, @@ -1472,6 +1478,9 @@ import type { UpdateSourceData, UpdateSourceErrors, UpdateSourceResponses, + UpdateTemplateData, + UpdateTemplateErrors, + UpdateTemplateResponses, UpdateTopicData, UpdateTopicErrors, UpdateTopicResponses, @@ -2165,6 +2174,24 @@ export class Tokens { ...options, }); } + + /** + * Rename Token + * + * Rename one of your keys. + */ + public static renameToken( + options: Options, + ): RequestResult { + return (options.client ?? client).patch({ + url: "/api/v1/tokens/{token_id}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } } export class Users { @@ -7505,6 +7532,24 @@ export class Templates { }); } + /** + * Update Template + * + * Its name and description (the text changes by saving a version). + */ + public static updateTemplate( + options: Options, + ): RequestResult { + return (options.client ?? client).patch({ + url: "/api/v1/templates/{tid}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + /** * Create Template Version */ @@ -7581,6 +7626,24 @@ export class Pipelines { }); } + /** + * Update Pipeline + * + * Its name and description (the steps change by saving a version). + */ + public static updatePipeline( + options: Options, + ): RequestResult { + return (options.client ?? client).patch({ + url: "/api/v1/pipelines/{pid}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + /** * Create Pipeline Version */ diff --git a/nextjs-frontend/app/openapi-client/types.gen.ts b/nextjs-frontend/app/openapi-client/types.gen.ts index f27b999db..079c6fb9a 100644 --- a/nextjs-frontend/app/openapi-client/types.gen.ts +++ b/nextjs-frontend/app/openapi-client/types.gen.ts @@ -391,6 +391,16 @@ export type ApiTokenCreated = { [key: string]: unknown; }; +/** + * ApiTokenRename + */ +export type ApiTokenRename = { + /** + * Name + */ + name: string; +}; + /** * Approval */ @@ -10627,6 +10637,20 @@ export type PipelineSummary = { [key: string]: unknown; }; +/** + * PipelineUpdate + */ +export type PipelineUpdate = { + /** + * Name + */ + name?: string | null; + /** + * Description + */ + description?: string | null; +}; + /** * PipelineVersionCreate */ @@ -16423,6 +16447,20 @@ export type TemplateSummary = { [key: string]: unknown; }; +/** + * TemplateUpdate + */ +export type TemplateUpdate = { + /** + * Name + */ + name?: string | null; + /** + * Description + */ + description?: string | null; +}; + /** * TemplateVersionCreate */ @@ -18911,6 +18949,36 @@ export type RevokeTokenResponses = { export type RevokeTokenResponse = RevokeTokenResponses[keyof RevokeTokenResponses]; +export type RenameTokenData = { + body: ApiTokenRename; + path: { + /** + * Token Id + */ + token_id: number; + }; + query?: never; + url: "/api/v1/tokens/{token_id}"; +}; + +export type RenameTokenErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type RenameTokenError = RenameTokenErrors[keyof RenameTokenErrors]; + +export type RenameTokenResponses = { + /** + * Successful Response + */ + 200: Ok; +}; + +export type RenameTokenResponse = RenameTokenResponses[keyof RenameTokenResponses]; + export type PasskeySetupOptionsData = { body: PasskeySetupStart; path?: never; @@ -29916,6 +29984,36 @@ export type GetTemplateResponses = { export type GetTemplateResponse = GetTemplateResponses[keyof GetTemplateResponses]; +export type UpdateTemplateData = { + body: TemplateUpdate; + path: { + /** + * Tid + */ + tid: number; + }; + query?: never; + url: "/api/v1/templates/{tid}"; +}; + +export type UpdateTemplateErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type UpdateTemplateError = UpdateTemplateErrors[keyof UpdateTemplateErrors]; + +export type UpdateTemplateResponses = { + /** + * Successful Response + */ + 200: Ok; +}; + +export type UpdateTemplateResponse = UpdateTemplateResponses[keyof UpdateTemplateResponses]; + export type CreateTemplateVersionData = { body: TemplateVersionCreate; path: { @@ -30061,6 +30159,36 @@ export type GetPipelineResponses = { export type GetPipelineResponse = GetPipelineResponses[keyof GetPipelineResponses]; +export type UpdatePipelineData = { + body: PipelineUpdate; + path: { + /** + * Pid + */ + pid: number; + }; + query?: never; + url: "/api/v1/pipelines/{pid}"; +}; + +export type UpdatePipelineErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type UpdatePipelineError = UpdatePipelineErrors[keyof UpdatePipelineErrors]; + +export type UpdatePipelineResponses = { + /** + * Successful Response + */ + 200: Ok; +}; + +export type UpdatePipelineResponse = UpdatePipelineResponses[keyof UpdatePipelineResponses]; + export type CreatePipelineVersionData = { body: PipelineVersionCreate; path: { diff --git a/nextjs-frontend/components/account/token-model.ts b/nextjs-frontend/components/account/token-model.ts index d64ba8c50..94bee2fae 100644 --- a/nextjs-frontend/components/account/token-model.ts +++ b/nextjs-frontend/components/account/token-model.ts @@ -1,4 +1,4 @@ -import { relative, shortDate } from "@/lib/format"; +import { relative, shortDate, uniqueName } from "@/lib/format"; export type TokenExpiry = { label: string; @@ -38,6 +38,11 @@ export const SCOPE_LABEL: Record = { write: "Read & write", }; +/** A name for a token nobody named, from its scope ("Read only token", then "Read only token 2"). */ +export function suggestedTokenName(scope: string, taken: Iterable): string { + return uniqueName(`${SCOPE_LABEL[scope] ?? "API"} token`, taken); +} + /** How long keys may last (GET /tokens/limits; admins set them). */ export type TokenLimits = { default_days: number; max_days: number; never_expire: boolean }; export const NO_LIMITS: TokenLimits = { default_days: 90, max_days: 3650, never_expire: true }; diff --git a/nextjs-frontend/components/account/tokens.tsx b/nextjs-frontend/components/account/tokens.tsx index e47129d92..d4659a184 100644 --- a/nextjs-frontend/components/account/tokens.tsx +++ b/nextjs-frontend/components/account/tokens.tsx @@ -6,13 +6,14 @@ import { useState } from "react"; import { Tokens } from "@/app/openapi-client"; import type { ApiToken } from "@/app/openapi-client/types.gen"; -import { daysError, expiresOn, SCOPE_LABEL, tokenExpiry } from "@/components/account/token-model"; +import { daysError, expiresOn, SCOPE_LABEL, suggestedTokenName, tokenExpiry } from "@/components/account/token-model"; import { isUnreachable } from "@/components/errors/error-states"; import { ChoiceCards } from "@/components/settings/controls"; import { Banner } from "@/components/ui/banner"; import { Button } from "@/components/ui/button"; import { Dialog } from "@/components/ui/dialog"; import { Field, Input } from "@/components/ui/field"; +import { RenameTitle } from "@/components/ui/rename-title"; import { EmptyState, SkeletonRows } from "@/components/ui/states"; import { Table, Td, Th, THead, Tr } from "@/components/ui/table"; import { useToast } from "@/components/ui/toast"; @@ -101,7 +102,19 @@ export function TokensPage() { const expired = exp.state === "expired"; return ( - {t.name} + + { + await data(Tokens.renameToken({ client, path: { token_id: t.id }, body: { name: n } })); + await qc.invalidateQueries({ queryKey: ["tokens"] }); + }} + /> + {SCOPE_LABEL[t.scope] ?? t.scope} @@ -142,6 +155,7 @@ export function TokensPage() { t.name)} onClose={() => setCreating(false)} onCreated={(c) => { setCreating(false); @@ -169,10 +183,13 @@ export function TokensPage() { function NewTokenDialog({ open, + taken, onClose, onCreated, }: { open: boolean; + /** The names of the tokens there are, so the guessed name is a new one. */ + taken: string[]; onClose: () => void; onCreated: (c: Created) => void; }) { @@ -187,13 +204,15 @@ function NewTokenDialog({ }); const limits = limitsQ.data ?? null; const shown = days || (limits ? String(limits.default_days) : ""); + const guess = suggestedTokenName(scope, taken); + const named = name.trim() || guess; const create = useMutation({ mutationFn: () => data( Tokens.createToken({ client, body: { - name: name.trim(), + name: named, scope: scope as "read" | "write", days: Number(shown), }, @@ -202,7 +221,7 @@ function NewTokenDialog({ onSuccess: (r) => { onCreated({ token: r.token, - name: name.trim(), + name: named, scope, days: Number(shown), }); @@ -213,7 +232,7 @@ function NewTokenDialog({ }); const nameError = name.trim() ? (name.trim().length > 80 ? "Use at most 80 characters" : null) : null; const dError = limits ? daysError(shown, limits) : "Loading how long keys may last…"; - const ready = name.trim() && !nameError && !dError; + const ready = !nameError && !dError; return ( create.mutate()} > {create.isPending ? "Creating…" : "Create token"} @@ -256,6 +275,7 @@ function NewTokenDialog({ aria-describedby={f.describedBy} invalid={f.invalid} value={name} + placeholder={guess} onChange={(e) => setName(e.target.value)} autoFocus maxLength={120} diff --git a/nextjs-frontend/components/pipelines/pipeline-editor.tsx b/nextjs-frontend/components/pipelines/pipeline-editor.tsx index bbf9823b4..40b3a75d0 100644 --- a/nextjs-frontend/components/pipelines/pipeline-editor.tsx +++ b/nextjs-frontend/components/pipelines/pipeline-editor.tsx @@ -38,6 +38,7 @@ import { sameSteps, specProblems, stepSummary, + suggestedPipelineName, toSpec, type StepSpec, } from "@/components/pipelines/pipeline-model"; @@ -48,6 +49,7 @@ import { Dialog } from "@/components/ui/dialog"; import { Field, Input, Select, Textarea } from "@/components/ui/field"; import { STEP_TONE } from "@/components/ui/loop"; import { Menu, MenuContent, MenuItem, MenuLabel, MenuTrigger } from "@/components/ui/menu"; +import { RenameTitle } from "@/components/ui/rename-title"; import { EmptyState, Skeleton } from "@/components/ui/states"; import { useToast } from "@/components/ui/toast"; import { Tooltip } from "@/components/ui/tooltip"; @@ -243,6 +245,11 @@ export function PipelineEditor({ id }: { id?: number }) { const readOnly = !admin; const latest = base ? Math.max(base.current, ...(base.history ?? []).map((h) => h.version)) : 0; const dirty = creating ? true : base ? !sameSteps(base.steps, steps) : false; + const guess = suggestedPipelineName( + steps, + (catalog.data?.pipelines ?? []).map((p) => p.name), + ); + const named = name.trim() || guess; const problems = specProblems(steps, (tid) => tpl.get(tid)?.kind); const firstProblem = Object.entries(problems)[0]; const used = (catalog.data?.pipelines.find((p) => p.id === id)?.namespaces ?? []).filter((n) => @@ -268,7 +275,7 @@ export function PipelineEditor({ id }: { id?: number }) { Pipelines.createPipeline({ client, body: { - name: name.trim(), + name: named, description: description.trim() || null, steps: body, }, @@ -291,7 +298,7 @@ export function PipelineEditor({ id }: { id?: number }) { void qc.invalidateQueries({ queryKey: ["pipeline", r.id] }); setNotes(""); if (creating) { - toast({ tone: "green", title: "Pipeline created", body: name }); + toast({ tone: "green", title: "Pipeline created", body: named }); router.push(`/pipelines/${r.id}`); return; } @@ -407,14 +414,26 @@ export function PipelineEditor({ id }: { id?: number }) { {creating ? ( setName(e.target.value)} className="h-9 w-[280px] text-[16px] font-bold" autoFocus /> ) : ( -

{base?.name}

+ { + await data(Pipelines.updatePipeline({ client, path: { pid: id! }, body: { name: n } })); + void qc.invalidateQueries({ queryKey: ["pipelines"] }); + await qc.invalidateQueries({ queryKey: ["pipeline", id] }); + } + } + /> )} {!creating && ( save.mutate(true)} > {creating ? "Create pipeline" : `Publish v${nextV}`} diff --git a/nextjs-frontend/components/pipelines/pipeline-model.ts b/nextjs-frontend/components/pipelines/pipeline-model.ts index 1766338eb..cafdf94e6 100644 --- a/nextjs-frontend/components/pipelines/pipeline-model.ts +++ b/nextjs-frontend/components/pipelines/pipeline-model.ts @@ -3,6 +3,7 @@ * what each step makes available to later ones, and one-line summaries of settings and conditions. */ import { stepLabel } from "@/components/activity/job-model"; +import { uniqueName } from "@/lib/format"; export type StepSpec = { type: string; @@ -23,6 +24,19 @@ export type StepSpec = { workflow?: number; }; +/** A name for a pipeline nobody named, from its steps ("Transcribe to report", "Analyze and summarize"), told apart + * from the pipelines there are. */ +export function suggestedPipelineName(steps: StepSpec[], taken: Iterable): string { + const labels = steps.map((s) => stepLabel(s.type, s.name)); + const [first, last] = [labels[0], labels[labels.length - 1]?.toLowerCase()]; + const base = !first + ? "New pipeline" + : labels.length === 1 + ? first + : `${first} ${labels.length === 2 ? "and" : "to"} ${last}`; + return uniqueName(base, taken); +} + export function toSpec(s: unknown): StepSpec { if (typeof s === "string") return { type: s }; return { ...((s as StepSpec) ?? { type: "analyze" }) }; diff --git a/nextjs-frontend/components/templates/new-template.tsx b/nextjs-frontend/components/templates/new-template.tsx index 9a130e454..5308d511d 100644 --- a/nextjs-frontend/components/templates/new-template.tsx +++ b/nextjs-frontend/components/templates/new-template.tsx @@ -6,6 +6,8 @@ import { useRouter } from "next/navigation"; import { useState } from "react"; import { Templates } from "@/app/openapi-client"; +import { useTemplateList } from "@/components/pipelines/catalog-header"; +import { suggestedTemplateName, type TemplateKind } from "@/components/templates/template-model"; import { Button } from "@/components/ui/button"; import { Field, Input, Textarea } from "@/components/ui/field"; import { EmptyState } from "@/components/ui/states"; @@ -14,7 +16,7 @@ import { useToast } from "@/components/ui/toast"; import { data, useApiClient } from "@/lib/api/browser"; import { useArchive } from "@/lib/hooks/session"; -type Kind = "prompt" | "report" | "export"; +type Kind = TemplateKind; /** Starting points, so a new template renders straight away. */ const STARTERS: Record }> = { @@ -51,13 +53,19 @@ export function NewTemplate() { const [name, setName] = useState(""); const [kind, setKind] = useState("prompt"); const [description, setDescription] = useState(""); + const templates = useTemplateList(); + const guess = suggestedTemplateName( + kind, + (templates.data ?? []).map((t) => t.name), + ); + const named = name.trim() || guess; const create = useMutation({ mutationFn: () => data( Templates.createTemplate({ client, body: { - name: name.trim(), + name: named, kind, description: description.trim() || null, body: STARTERS[kind].body, @@ -67,7 +75,7 @@ export function NewTemplate() { ), onSuccess: (r) => { void qc.invalidateQueries({ queryKey: ["templates"] }); - toast({ tone: "green", title: "Template created", body: name }); + toast({ tone: "green", title: "Template created", body: named }); router.push(`/templates/${r.id}`); }, onError: (e: Error) => @@ -107,7 +115,7 @@ export function NewTemplate() { value={name} maxLength={80} onChange={(e) => setName(e.target.value)} - placeholder="Podcast summary" + placeholder={guess} /> )} @@ -146,12 +154,7 @@ export function NewTemplate() { - diff --git a/nextjs-frontend/components/templates/template-editor.tsx b/nextjs-frontend/components/templates/template-editor.tsx index 5a18bd744..32cd151da 100644 --- a/nextjs-frontend/components/templates/template-editor.tsx +++ b/nextjs-frontend/components/templates/template-editor.tsx @@ -19,6 +19,7 @@ import { useTemplateUsage } from "@/components/templates/use-template-usage"; import { VersionsPanel } from "@/components/templates/versions-panel"; import { Button } from "@/components/ui/button"; import { Field, Select, Textarea } from "@/components/ui/field"; +import { RenameTitle } from "@/components/ui/rename-title"; import { EmptyState, Skeleton } from "@/components/ui/states"; import { Tabs } from "@/components/ui/tabs"; import { useToast } from "@/components/ui/toast"; @@ -252,8 +253,21 @@ export function TemplateEditor({ id }: { id: number }) { {" "} › {t.name} -
-

{t.name}

+
+ { + await data(Templates.updateTemplate({ client, path: { tid: id }, body: { name: n } })); + void qc.invalidateQueries({ queryKey: ["templates"] }); + await qc.invalidateQueries({ queryKey: ["template", id] }); + } + } + /> {t.kind} · v{dirty ? latest + 1 : t.version}{" "} {dirty ? "draft" : t.version === t.current ? "published" : ""} diff --git a/nextjs-frontend/components/templates/template-model.ts b/nextjs-frontend/components/templates/template-model.ts index 9e0048e24..ae76b0fd5 100644 --- a/nextjs-frontend/components/templates/template-model.ts +++ b/nextjs-frontend/components/templates/template-model.ts @@ -2,9 +2,17 @@ * Templates (Jinja, rendered by the backend against one recording): the variables a template can use, a check for * unknown variables with a "did you mean", autocomplete, the output schema, and the versions diff. */ +import { uniqueName } from "@/lib/format"; export type Variable = { key: string; type: string }; +export type TemplateKind = "prompt" | "report" | "export"; + +/** A name for a template nobody named, from its kind ("Prompt template", then "Prompt template 2"). */ +export function suggestedTemplateName(kind: TemplateKind, taken: Iterable): string { + return uniqueName({ prompt: "Prompt template", report: "Report page", export: "Export file" }[kind], taken); +} + /** What templates.context() gives a template, as the editor lists it. */ export const VARIABLES: Variable[] = [ { key: "recording.title", type: "string" }, diff --git a/nextjs-frontend/components/ui/rename-title.tsx b/nextjs-frontend/components/ui/rename-title.tsx new file mode 100644 index 000000000..475b4a38a --- /dev/null +++ b/nextjs-frontend/components/ui/rename-title.tsx @@ -0,0 +1,83 @@ +"use client"; + +import { Pencil } from "lucide-react"; +import { useState } from "react"; + +import { Button, IconButton } from "@/components/ui/button"; +import { Input } from "@/components/ui/field"; +import { useToast } from "@/components/ui/toast"; +import { cn } from "@/lib/utils"; + +/** A title that can be renamed in place: the pencil opens a field with the name selected, Enter saves and Escape + * keeps the old name. `onRename` saves it (and refreshes what shows the name); without it the title is plain. A page + * title by default; `as="span"` for a name in a list or table. */ +export function RenameTitle({ + name, + what, + onRename, + as: Tag = "h1", + className, + inputClassName, +}: { + name: string; + /** What is being renamed, for the labels ("pipeline" → "Rename pipeline"). */ + what: string; + onRename?: (name: string) => Promise; + as?: "h1" | "span"; + className?: string; + inputClassName?: string; +}) { + const toast = useToast(); + const [draft, setDraft] = useState(null); + const [saving, setSaving] = useState(false); + const save = async () => { + const next = (draft ?? "").trim(); + if (!next || next === name || !onRename) return setDraft(null); + setSaving(true); + try { + await onRename(next); + setDraft(null); + } catch (e) { + toast({ tone: "red", title: "Couldn’t rename it", body: e instanceof Error ? e.message : String(e) }); + } finally { + setSaving(false); + } + }; + if (draft != null) + return ( +
{ + e.preventDefault(); + void save(); + }} + > + e.currentTarget.select()} + onChange={(e) => setDraft(e.target.value)} + onKeyDown={(e) => e.key === "Escape" && setDraft(null)} + className={cn("h-9 w-[280px] text-[16px] font-bold", inputClassName)} + /> + + +
+ ); + return ( + + {name} + {onRename && ( + setDraft(name)}> + + + )} + + ); +} diff --git a/nextjs-frontend/components/workflows/workflow-editor.tsx b/nextjs-frontend/components/workflows/workflow-editor.tsx index f87c62f40..3d6e24400 100644 --- a/nextjs-frontend/components/workflows/workflow-editor.tsx +++ b/nextjs-frontend/components/workflows/workflow-editor.tsx @@ -19,6 +19,7 @@ import { problems as findProblems, sameGraph, starter, + suggestedWorkflowName, type CustomDef, type Scope, type WfGraph, @@ -26,6 +27,7 @@ import { import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/field"; import { Menu, MenuContent, MenuItem, MenuLabel, MenuTrigger } from "@/components/ui/menu"; +import { RenameTitle } from "@/components/ui/rename-title"; import { EmptyState, Skeleton } from "@/components/ui/states"; import { Segmented } from "@/components/ui/tabs"; import { useToast } from "@/components/ui/toast"; @@ -92,6 +94,11 @@ export function WorkflowEditor({ id }: { id?: number }) { const why = readOnly ? "Only admins can change workflows" : undefined; const latest = base ? Math.max(base.current, ...(base.history ?? []).map((h) => h.version)) : 0; const dirty = creating ? true : base ? !sameGraph(base.graph as WfGraph, graph) : false; + const guess = suggestedWorkflowName( + scope, + (catalog.data?.workflows ?? []).map((w) => w.name), + ); + const named = name.trim() || guess; const problems = findProblems(graph, (tid) => tpl.get(tid)?.kind, scope, "workflow", customOf); const firstProblem = Object.entries(problems)[0]; const nextV = latest + 1; @@ -107,7 +114,7 @@ export function WorkflowEditor({ id }: { id?: number }) { mutationFn: async (publish: boolean) => { const body = cleanGraph(graph); if (creating) { - const r = await data(Workflows.createWorkflow({ client, body: { name: name.trim(), graph: body, scope } })); + const r = await data(Workflows.createWorkflow({ client, body: { name: named, graph: body, scope } })); return { id: r.id, version: 1 }; } const r = await data( @@ -124,7 +131,7 @@ export function WorkflowEditor({ id }: { id?: number }) { void qc.invalidateQueries({ queryKey: ["workflow", r.id] }); setNotes(""); if (creating) { - toast({ tone: "green", title: "Workflow created", body: name }); + toast({ tone: "green", title: "Workflow created", body: named }); router.push(`/workflows/${r.id}`); return; } @@ -208,14 +215,26 @@ export function WorkflowEditor({ id }: { id?: number }) { {creating ? ( setName(e.target.value)} className="h-9 w-[320px] text-[16px] font-bold" autoFocus /> ) : ( -

{base?.name}

+ { + await data(Workflows.updateWorkflow({ client, path: { wid: id! }, body: { name: n } })); + void qc.invalidateQueries({ queryKey: ["workflows"] }); + await qc.invalidateQueries({ queryKey: ["workflow", id] }); + } + } + /> )} {creating && ( save.mutate(true)} > {creating ? "Create workflow" : `Publish v${nextV}`} diff --git a/nextjs-frontend/components/workflows/workflow-model.ts b/nextjs-frontend/components/workflows/workflow-model.ts index 3d3cb26fe..3a5b70158 100644 --- a/nextjs-frontend/components/workflows/workflow-model.ts +++ b/nextjs-frontend/components/workflows/workflow-model.ts @@ -29,6 +29,8 @@ import { type LucideIcon, } from "lucide-react"; +import { uniqueName } from "@/lib/format"; + export type WfNode = { id: string; type: string; @@ -439,6 +441,11 @@ export function starter(scope: Scope = "recording"): WfGraph { }; } +/** A name for a workflow nobody named, from what it runs on ("Recording workflow", then "Recording workflow 2"). */ +export function suggestedWorkflowName(scope: Scope, taken: Iterable): string { + return uniqueName(scope === "graph" ? "Graph workflow" : scope === "tool" ? "Tool" : "Recording workflow", taken); +} + /** A new tool's graph: its text goes to the model, and the reply is what it gives back. */ export function starterTool(): WfGraph { return { diff --git a/nextjs-frontend/lib/format.ts b/nextjs-frontend/lib/format.ts index 5233bd817..81086ebd3 100644 --- a/nextjs-frontend/lib/format.ts +++ b/nextjs-frontend/lib/format.ts @@ -116,6 +116,16 @@ export function nsSlug(text: string): string { .slice(0, 41); } +/** A guessed name nothing else has yet: `base` when it's free, else "base 2", "base 3"… (case aside), so new things + * get a name without typing and stay told apart. */ +export function uniqueName(base: string, taken: Iterable): string { + const used = new Set([...taken].map((n) => (n ?? "").trim().toLowerCase())); + if (!used.has(base.toLowerCase())) return base; + let k = 2; + while (used.has(`${base} ${k}`.toLowerCase())) k++; + return `${base} ${k}`; +} + /** A display name from an email address: "ana.lopez@x.io" → "Ana Lopez". */ export function nameFromEmail(email: string): string { const local = email.trim().split("@")[0] ?? ""; diff --git a/nextjs-frontend/openapi.json b/nextjs-frontend/openapi.json index 12d041177..aad92d48c 100644 --- a/nextjs-frontend/openapi.json +++ b/nextjs-frontend/openapi.json @@ -490,6 +490,57 @@ } }, "/api/v1/tokens/{token_id}": { + "patch": { + "tags": [ + "tokens" + ], + "summary": "Rename Token", + "description": "Rename one of your keys.", + "operationId": "rename_token", + "parameters": [ + { + "name": "token_id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Token Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiTokenRename" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ok" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, "delete": { "tags": [ "tokens" @@ -18561,6 +18612,57 @@ } } } + }, + "patch": { + "tags": [ + "templates" + ], + "summary": "Update Template", + "description": "Its name and description (the text changes by saving a version).", + "operationId": "update_template", + "parameters": [ + { + "name": "tid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Tid" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TemplateUpdate" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ok" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } } }, "/api/v1/templates/{tid}/versions": { @@ -18794,6 +18896,57 @@ } } } + }, + "patch": { + "tags": [ + "pipelines" + ], + "summary": "Update Pipeline", + "description": "Its name and description (the steps change by saving a version).", + "operationId": "update_pipeline", + "parameters": [ + { + "name": "pid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Pid" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PipelineUpdate" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ok" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } } }, "/api/v1/pipelines/{pid}/versions": { @@ -26356,6 +26509,22 @@ ], "title": "ApiTokenCreated" }, + "ApiTokenRename": { + "properties": { + "name": { + "type": "string", + "maxLength": 80, + "minLength": 1, + "title": "Name" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ], + "title": "ApiTokenRename" + }, "Approval": { "properties": { "id": { @@ -44040,6 +44209,35 @@ ], "title": "PipelineSummary" }, + "PipelineUpdate": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + } + }, + "additionalProperties": false, + "type": "object", + "title": "PipelineUpdate" + }, "PipelineVersionCreate": { "properties": { "steps": { @@ -54131,6 +54329,35 @@ ], "title": "TemplateSummary" }, + "TemplateUpdate": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + } + }, + "additionalProperties": false, + "type": "object", + "title": "TemplateUpdate" + }, "TemplateVersionCreate": { "properties": { "body": { From 9c0b4b6354d65ea0221ba8a3104dba7a75291d1f Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 10 Oct 2026 22:57:33 +0000 Subject: [PATCH 2/4] ci(clicks): make a pipeline, routine and API token without typing a name The journeys take the guessed name instead of typing one: pipeline -14 keys, routine -12, API token -6 (computer survey 229 from 261). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_014pKRz6HkdQ7hTqEbpnyhYo --- ci/clicks/baseline.json | 82 +++++++++++++++-------------------------- ci/clicks/journeys.mjs | 6 +-- 2 files changed, 32 insertions(+), 56 deletions(-) diff --git a/ci/clicks/baseline.json b/ci/clicks/baseline.json index 91ce82c98..a4598bb6c 100644 --- a/ci/clicks/baseline.json +++ b/ci/clicks/baseline.json @@ -1,5 +1,5 @@ { - "surveyed": "2026-10-10T22:25:49.567Z", + "surveyed": "2026-10-10T22:57:02.610Z", "commit": "", "viewport": "1400x900", "journeys": [ @@ -45,7 +45,7 @@ } ], "id": "install", - "ms": 2081, + "ms": 2028, "ok": true }, { @@ -82,7 +82,7 @@ } ], "id": "first-admin", - "ms": 475, + "ms": 524, "ok": true }, { @@ -127,7 +127,7 @@ } ], "id": "setup-wizard", - "ms": 659, + "ms": 666, "ok": true }, { @@ -156,7 +156,7 @@ } ], "id": "first-question", - "ms": 2225, + "ms": 2344, "ok": true }, { @@ -201,7 +201,7 @@ } ], "id": "import-paste", - "ms": 4139, + "ms": 4151, "ok": true }, { @@ -230,7 +230,7 @@ } ], "id": "library-open", - "ms": 2621, + "ms": 2691, "ok": true }, { @@ -267,7 +267,7 @@ } ], "id": "search-word", - "ms": 3173, + "ms": 3241, "ok": true }, { @@ -304,7 +304,7 @@ } ], "id": "jump-to", - "ms": 2385, + "ms": 2356, "ok": true }, { @@ -341,7 +341,7 @@ } ], "id": "chat-ask", - "ms": 3552, + "ms": 3410, "ok": true }, { @@ -386,7 +386,7 @@ } ], "id": "note-create", - "ms": 3366, + "ms": 3338, "ok": true }, { @@ -431,15 +431,15 @@ } ], "id": "topic-add", - "ms": 3487, + "ms": 3322, "ok": true }, { "module": "Pipelines", "feature": "Make a pipeline from the standard steps", - "note": "", + "note": "Lens guesses the name from the steps; it can be renamed on the pipeline's page.", "clicks": 3, - "keys": 14, + "keys": 0, "prompts": 0, "steps": [ { @@ -458,14 +458,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/pipelines/new", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 14, - "prompts": 0 - }, { "page": "/pipelines/new", "kind": "click", @@ -476,15 +468,15 @@ } ], "id": "pipeline-create", - "ms": 2694, + "ms": 2649, "ok": true }, { "module": "Routines", "feature": "Make a nightly routine (sync sources, the default action)", - "note": "", + "note": "Lens guesses the name from when it runs and what it does; it can be renamed later.", "clicks": 3, - "keys": 12, + "keys": 0, "prompts": 0, "steps": [ { @@ -503,14 +495,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/routines/new", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 12, - "prompts": 0 - }, { "page": "/routines/new", "kind": "click", @@ -521,7 +505,7 @@ } ], "id": "routine-create", - "ms": 2647, + "ms": 2844, "ok": true }, { @@ -558,7 +542,7 @@ } ], "id": "extension-add", - "ms": 2554, + "ms": 2639, "ok": true }, { @@ -595,7 +579,7 @@ } ], "id": "sensor-webhook", - "ms": 2684, + "ms": 2845, "ok": true }, { @@ -640,7 +624,7 @@ } ], "id": "settings-change", - "ms": 3491, + "ms": 3510, "ok": true }, { @@ -701,15 +685,15 @@ } ], "id": "person-add", - "ms": 3863, + "ms": 3081, "ok": true }, { "module": "Account", "feature": "Make an API token", - "note": "", + "note": "Lens guesses the name from the scope; it can be renamed in the list.", "clicks": 3, - "keys": 6, + "keys": 0, "prompts": 0, "steps": [ { @@ -728,14 +712,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/account/tokens", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 6, - "prompts": 0 - }, { "page": "/account/tokens", "kind": "click", @@ -746,7 +722,7 @@ } ], "id": "api-token", - "ms": 3140, + "ms": 3031, "ok": true }, { @@ -775,7 +751,7 @@ } ], "id": "namespace-switch", - "ms": 2280, + "ms": 2256, "ok": true } ], @@ -892,7 +868,7 @@ "page": "/routines/history", "label": "Routines › History", "reach": 2, - "controls": 3 + "controls": 6 }, { "page": "/extensions", @@ -1048,7 +1024,7 @@ "page": "/settings/telemetry", "label": "Settings › Telemetry", "reach": 2, - "controls": 12 + "controls": 13 }, { "page": "/settings/fedora", @@ -1126,7 +1102,7 @@ "page": "/admin/health", "label": "Admin › System health", "reach": 2, - "controls": 10 + "controls": 11 } ] } diff --git a/ci/clicks/journeys.mjs b/ci/clicks/journeys.mjs index 2f8a4e414..d906a549a 100644 --- a/ci/clicks/journeys.mjs +++ b/ci/clicks/journeys.mjs @@ -213,11 +213,11 @@ export const JOURNEYS = [ id: "pipeline-create", module: "Pipelines", feature: "Make a pipeline from the standard steps", + note: "Lens guesses the name from the steps; it can be renamed on the pipeline's page.", from: "/", async run({ page, meter }) { await meter.click(nav(page, "Pipelines"), "Pipelines"); await meter.click(page.getByRole("main").getByRole("link", { name: "New pipeline" }), "New pipeline"); - await meter.type(page.getByRole("textbox", { name: "Pipeline name" }), "Quick pipeline", "name"); await meter.click(page.getByRole("button", { name: "Create pipeline" }), "Create pipeline"); await page.waitForURL(/\/pipelines\/\d+/); }, @@ -226,11 +226,11 @@ export const JOURNEYS = [ id: "routine-create", module: "Routines", feature: "Make a nightly routine (sync sources, the default action)", + note: "Lens guesses the name from when it runs and what it does; it can be renamed later.", from: "/", async run({ page, meter }) { await meter.click(nav(page, "Routines"), "Routines"); await meter.click(page.getByRole("main").getByRole("link", { name: "New routine" }), "New routine"); - await meter.type(page.getByRole("textbox", { name: "Name" }), "Nightly sync", "name"); await meter.click(page.getByRole("button", { name: "Create routine" }), "Create routine"); await page.waitForURL(/\/routines\/\d+/); }, @@ -293,6 +293,7 @@ export const JOURNEYS = [ id: "api-token", module: "Account", feature: "Make an API token", + note: "Lens guesses the name from the scope; it can be renamed in the list.", from: "/", async run({ page, meter }) { await meter.click(page.getByRole("button", { name: "Account menu" }), "Account menu"); @@ -303,7 +304,6 @@ export const JOURNEYS = [ // the form is open already when there are no tokens yet if (!(await d.isVisible())) await meter.click(page.getByRole("main").getByRole("button", { name: "New token" }).first(), "New token"); - await meter.type(d.getByRole("textbox", { name: "Name" }), "script", "name"); await meter.click(d.getByRole("button", { name: "Create token" }), "Create token"); await page.getByText(/copy/i).first().waitFor(); }, From c40b09e627fd0cce40d65df8bac0d70410d1e9bf Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Wed, 14 Oct 2026 10:55:06 +0000 Subject: [PATCH 3/4] ci(clicks): wait for the servers to stop before the next survey starts run.sh killed the API and the web app on exit without waiting, so the API could still answer for a moment after it returned. CI runs the phone survey straight after the computer's: its readiness check reached the old API, the installer's Open Lens landed on Sign in because that API already had an admin, and every phone journey failed. run.sh now waits for each server to exit (forced after 30 seconds), and the survey waits for the web installer. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_014pKRz6HkdQ7hTqEbpnyhYo --- ci/clicks/run.sh | 8 ++++++++ ci/clicks/survey.mjs | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ci/clicks/run.sh b/ci/clicks/run.sh index f92317fcb..3f88d9d90 100755 --- a/ci/clicks/run.sh +++ b/ci/clicks/run.sh @@ -11,6 +11,14 @@ tmp=$(mktemp -d) pids="" stop() { for p in $pids; do kill "$p" 2>/dev/null || true; done + # Wait for them to exit (30 seconds, then forced), so a run straight after this one (the phone survey after the + # computer's in CI) gets the ports, rather than this run's API answering it with its accounts already made + for p in $pids; do + (sleep 30 && kill -9 "$p") >/dev/null 2>&1 & + w=$! + wait "$p" 2>/dev/null || true + kill "$w" 2>/dev/null || true + done rm -rf "$tmp" } trap stop EXIT INT TERM diff --git a/ci/clicks/survey.mjs b/ci/clicks/survey.mjs index dcd0aadb3..c866c8010 100644 --- a/ci/clicks/survey.mjs +++ b/ci/clicks/survey.mjs @@ -185,7 +185,12 @@ async function main() { if (a.state) await context.storageState({ path: a.state }); const pages = a.only ? [] : await surveyPages(page, a.base, ctx.phone); await browser.close(); - installer?.kill(); + if (installer) { + // and wait for it to go, so a survey straight after this one gets its port + const gone = new Promise((r) => (installer.exitCode != null || installer.signalCode != null ? r() : installer.once("exit", r))); + installer.kill(); + await gone; + } model.close(); const result = { From f8e617163e4e9f168cc6b14df3154cf1af7058d9 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Wed, 14 Oct 2026 15:46:46 +0000 Subject: [PATCH 4/4] ci(clicks): re-measure both baselines on main with #346 Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_014pKRz6HkdQ7hTqEbpnyhYo --- ci/clicks/baseline-phone.json | 106 +++++++++++++--------------------- ci/clicks/baseline.json | 104 +++++++++++++-------------------- 2 files changed, 81 insertions(+), 129 deletions(-) diff --git a/ci/clicks/baseline-phone.json b/ci/clicks/baseline-phone.json index 723c47df0..08e00fe47 100644 --- a/ci/clicks/baseline-phone.json +++ b/ci/clicks/baseline-phone.json @@ -1,5 +1,5 @@ { - "surveyed": "2026-10-14T10:41:13.906Z", + "surveyed": "2026-10-14T15:46:32.131Z", "commit": "", "viewport": "Pixel 7, 412x839, touch", "device": "phone", @@ -47,7 +47,7 @@ } ], "id": "install", - "ms": 2942, + "ms": 3223, "ok": true }, { @@ -85,7 +85,7 @@ } ], "id": "first-admin", - "ms": 656, + "ms": 632, "ok": true }, { @@ -131,7 +131,7 @@ } ], "id": "setup-wizard", - "ms": 1276, + "ms": 1299, "ok": true }, { @@ -161,7 +161,7 @@ } ], "id": "first-question", - "ms": 1208, + "ms": 1264, "ok": true }, { @@ -208,7 +208,7 @@ } ], "id": "import-paste", - "ms": 4573, + "ms": 4576, "ok": true }, { @@ -246,7 +246,7 @@ } ], "id": "library-open", - "ms": 3110, + "ms": 3179, "ok": true }, { @@ -292,7 +292,7 @@ } ], "id": "search-word", - "ms": 3759, + "ms": 3717, "ok": true }, { @@ -330,7 +330,7 @@ } ], "id": "jump-to", - "ms": 2503, + "ms": 2482, "ok": true }, { @@ -384,7 +384,7 @@ } ], "id": "chat-ask", - "ms": 6439, + "ms": 6427, "ok": true }, { @@ -446,7 +446,7 @@ } ], "id": "note-create", - "ms": 3701, + "ms": 3777, "ok": true }, { @@ -500,13 +500,13 @@ } ], "id": "topic-add", - "ms": 3746, + "ms": 3786, "ok": true }, { "module": "Pipelines", "feature": "Make a pipeline from the standard steps", - "note": "", + "note": "Lens guesses the name from the steps; it can be renamed on the pipeline's page.", "clicks": 3, "keys": 1, "prompts": 0, @@ -546,13 +546,13 @@ } ], "id": "pipeline-create", - "ms": 3008, + "ms": 3010, "ok": true }, { "module": "Routines", "feature": "Make a nightly routine (sync sources, the default action)", - "note": "", + "note": "Lens guesses the name from when it runs and what it does; it can be renamed later.", "clicks": 3, "keys": 1, "prompts": 0, @@ -592,7 +592,7 @@ } ], "id": "routine-create", - "ms": 3082, + "ms": 3090, "ok": true }, { @@ -638,7 +638,7 @@ } ], "id": "extension-add", - "ms": 3141, + "ms": 3199, "ok": true }, { @@ -684,7 +684,7 @@ } ], "id": "sensor-webhook", - "ms": 3062, + "ms": 3173, "ok": true }, { @@ -747,7 +747,7 @@ } ], "id": "settings-change", - "ms": 4379, + "ms": 4435, "ok": true }, { @@ -817,15 +817,15 @@ } ], "id": "person-add", - "ms": 3787, + "ms": 3819, "ok": true }, { "module": "Account", "feature": "Make an API token", - "note": "", + "note": "Lens guesses the name from the scope; it can be renamed in the list.", "clicks": 3, - "keys": 6, + "keys": 0, "prompts": 0, "swipes": 0, "steps": [ @@ -845,14 +845,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/account/tokens", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 6, - "prompts": 0 - }, { "page": "/account/tokens", "kind": "tap", @@ -863,7 +855,7 @@ } ], "id": "api-token", - "ms": 3378, + "ms": 3379, "ok": true }, { @@ -901,7 +893,7 @@ } ], "id": "namespace-switch", - "ms": 2873, + "ms": 2882, "ok": true }, { @@ -947,7 +939,7 @@ } ], "id": "agent-connect", - "ms": 3312, + "ms": 3309, "ok": true }, { @@ -985,7 +977,7 @@ } ], "id": "import-file", - "ms": 3544, + "ms": 3405, "ok": true }, { @@ -1039,7 +1031,7 @@ } ], "id": "source-folder", - "ms": 4415, + "ms": 4530, "ok": true }, { @@ -1085,7 +1077,7 @@ } ], "id": "entity-find", - "ms": 11971, + "ms": 12189, "ok": true }, { @@ -1139,7 +1131,7 @@ } ], "id": "graph-find", - "ms": 4944, + "ms": 4917, "ok": true }, { @@ -1201,7 +1193,7 @@ } ], "id": "podcast-create", - "ms": 4151, + "ms": 4201, "ok": true }, { @@ -1255,15 +1247,15 @@ } ], "id": "report-pdf", - "ms": 4032, + "ms": 4047, "ok": true }, { "module": "Pipelines", "feature": "Make a workflow", - "note": "", + "note": "Lens guesses the name from what it runs on; it can be renamed on the workflow's page.", "clicks": 5, - "keys": 13, + "keys": 0, "prompts": 0, "swipes": 0, "steps": [ @@ -1299,14 +1291,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/workflows/new", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 13, - "prompts": 0 - }, { "page": "/workflows/new", "kind": "tap", @@ -1317,15 +1301,15 @@ } ], "id": "workflow-create", - "ms": 3785, + "ms": 3774, "ok": true }, { "module": "Pipelines", "feature": "Make a prompt template", - "note": "", + "note": "Lens guesses the name from the kind; it can be renamed on the template's page.", "clicks": 5, - "keys": 10, + "keys": 0, "prompts": 0, "swipes": 0, "steps": [ @@ -1361,14 +1345,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/templates/new", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 10, - "prompts": 0 - }, { "page": "/templates/new", "kind": "tap", @@ -1379,7 +1355,7 @@ } ], "id": "template-create", - "ms": 3621, + "ms": 3710, "ok": true }, { @@ -1441,7 +1417,7 @@ } ], "id": "namespace-create", - "ms": 3489, + "ms": 3562, "ok": true }, { @@ -1503,7 +1479,7 @@ } ], "id": "speaker-rename", - "ms": 4400, + "ms": 4464, "ok": true }, { @@ -1573,7 +1549,7 @@ } ], "id": "cloud-model", - "ms": 3876, + "ms": 4658, "ok": true } ], @@ -1810,7 +1786,7 @@ "page": "/settings/components", "label": "Settings › Components", "reach": 3, - "controls": 3 + "controls": 1 }, { "page": "/settings/access", diff --git a/ci/clicks/baseline.json b/ci/clicks/baseline.json index 752585311..36545a098 100644 --- a/ci/clicks/baseline.json +++ b/ci/clicks/baseline.json @@ -1,5 +1,5 @@ { - "surveyed": "2026-10-14T10:44:48.927Z", + "surveyed": "2026-10-14T15:42:38.553Z", "commit": "", "viewport": "1400x900", "device": "desktop", @@ -47,7 +47,7 @@ } ], "id": "install", - "ms": 1901, + "ms": 2643, "ok": true }, { @@ -85,7 +85,7 @@ } ], "id": "first-admin", - "ms": 445, + "ms": 513, "ok": true }, { @@ -131,7 +131,7 @@ } ], "id": "setup-wizard", - "ms": 625, + "ms": 716, "ok": true }, { @@ -161,7 +161,7 @@ } ], "id": "first-question", - "ms": 2353, + "ms": 2318, "ok": true }, { @@ -207,7 +207,7 @@ } ], "id": "import-paste", - "ms": 4168, + "ms": 4228, "ok": true }, { @@ -237,7 +237,7 @@ } ], "id": "library-open", - "ms": 2582, + "ms": 2609, "ok": true }, { @@ -275,7 +275,7 @@ } ], "id": "search-word", - "ms": 3245, + "ms": 3249, "ok": true }, { @@ -313,7 +313,7 @@ } ], "id": "jump-to", - "ms": 2318, + "ms": 2328, "ok": true }, { @@ -351,7 +351,7 @@ } ], "id": "chat-ask", - "ms": 3460, + "ms": 3445, "ok": true }, { @@ -405,7 +405,7 @@ } ], "id": "note-create", - "ms": 3299, + "ms": 3377, "ok": true }, { @@ -451,13 +451,13 @@ } ], "id": "topic-add", - "ms": 3234, + "ms": 3207, "ok": true }, { "module": "Pipelines", "feature": "Make a pipeline from the standard steps", - "note": "", + "note": "Lens guesses the name from the steps; it can be renamed on the pipeline's page.", "clicks": 2, "keys": 1, "prompts": 0, @@ -489,13 +489,13 @@ } ], "id": "pipeline-create", - "ms": 2483, + "ms": 2552, "ok": true }, { "module": "Routines", "feature": "Make a nightly routine (sync sources, the default action)", - "note": "", + "note": "Lens guesses the name from when it runs and what it does; it can be renamed later.", "clicks": 2, "keys": 1, "prompts": 0, @@ -527,7 +527,7 @@ } ], "id": "routine-create", - "ms": 2552, + "ms": 2619, "ok": true }, { @@ -565,7 +565,7 @@ } ], "id": "extension-add", - "ms": 2522, + "ms": 2575, "ok": true }, { @@ -603,7 +603,7 @@ } ], "id": "sensor-webhook", - "ms": 2526, + "ms": 2673, "ok": true }, { @@ -711,15 +711,15 @@ } ], "id": "person-add", - "ms": 3133, + "ms": 3351, "ok": true }, { "module": "Account", "feature": "Make an API token", - "note": "", + "note": "Lens guesses the name from the scope; it can be renamed in the list.", "clicks": 3, - "keys": 6, + "keys": 0, "prompts": 0, "swipes": 0, "steps": [ @@ -739,14 +739,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/account/tokens", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 6, - "prompts": 0 - }, { "page": "/account/tokens", "kind": "click", @@ -757,7 +749,7 @@ } ], "id": "api-token", - "ms": 3052, + "ms": 3047, "ok": true }, { @@ -787,7 +779,7 @@ } ], "id": "namespace-switch", - "ms": 2298, + "ms": 2297, "ok": true }, { @@ -833,7 +825,7 @@ } ], "id": "agent-connect", - "ms": 2875, + "ms": 2908, "ok": true }, { @@ -871,7 +863,7 @@ } ], "id": "import-file", - "ms": 8174, + "ms": 8494, "ok": true }, { @@ -917,7 +909,7 @@ } ], "id": "source-folder", - "ms": 3777, + "ms": 8389, "ok": true }, { @@ -955,7 +947,7 @@ } ], "id": "entity-find", - "ms": 11376, + "ms": 11531, "ok": true }, { @@ -993,7 +985,7 @@ } ], "id": "graph-find", - "ms": 4208, + "ms": 4261, "ok": true }, { @@ -1047,7 +1039,7 @@ } ], "id": "podcast-create", - "ms": 3406, + "ms": 3630, "ok": true }, { @@ -1093,15 +1085,15 @@ } ], "id": "report-pdf", - "ms": 3308, + "ms": 3372, "ok": true }, { "module": "Pipelines", "feature": "Make a workflow", - "note": "", + "note": "Lens guesses the name from what it runs on; it can be renamed on the workflow's page.", "clicks": 4, - "keys": 13, + "keys": 0, "prompts": 0, "swipes": 0, "steps": [ @@ -1129,14 +1121,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/workflows/new", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 13, - "prompts": 0 - }, { "page": "/workflows/new", "kind": "click", @@ -1147,15 +1131,15 @@ } ], "id": "workflow-create", - "ms": 3082, + "ms": 2939, "ok": true }, { "module": "Pipelines", "feature": "Make a prompt template", - "note": "", + "note": "Lens guesses the name from the kind; it can be renamed on the template's page.", "clicks": 4, - "keys": 10, + "keys": 0, "prompts": 0, "swipes": 0, "steps": [ @@ -1183,14 +1167,6 @@ "keys": 0, "prompts": 0 }, - { - "page": "/templates/new", - "kind": "type", - "what": "name", - "clicks": 0, - "keys": 10, - "prompts": 0 - }, { "page": "/templates/new", "kind": "click", @@ -1201,7 +1177,7 @@ } ], "id": "template-create", - "ms": 2868, + "ms": 2710, "ok": true }, { @@ -1255,7 +1231,7 @@ } ], "id": "namespace-create", - "ms": 2916, + "ms": 2857, "ok": true }, { @@ -1309,7 +1285,7 @@ } ], "id": "speaker-rename", - "ms": 3919, + "ms": 3966, "ok": true }, { @@ -1363,7 +1339,7 @@ } ], "id": "cloud-model", - "ms": 2712, + "ms": 2784, "ok": true } ], @@ -1760,7 +1736,7 @@ }, { "page": "/notes/:id", - "label": "Untitled", + "label": "Pi setup", "reach": 1, "controls": 9 }