From b12b1ba7cf1043bfa50ae3083e3cb7e02398138b Mon Sep 17 00:00:00 2001 From: yannickmonney Date: Tue, 13 Oct 2026 19:01:52 +0200 Subject: [PATCH 1/2] feat(platform): guide the editor's coding agent dialog the same way The automation editor's Edit with your coding agent dialog showed the automation's name and two links, one to the MCP settings page. It now holds the same guided setup as the Connected agents page: the commands that connect Claude Code or Codex, the address for any other agent, the line that waits for an agent to sign in and then names it, and a prompt that names this automation (the slug the agent opens it by) with the part to fill in marked. Where the operator has turned agent sign-in off, the commands would lead nowhere, so the dialog keeps what it showed before: the name to copy, a link to the MCP settings and the guide. While that is not yet known it shows the setup. The foot of the two dialogs (the guide and Done) is one component. --- .../components/coding-agent-entry.test.tsx | 81 +++++++++++++++++-- .../components/coding-agent-entry.tsx | 52 ++++++++++-- .../components/connect-agent-dialog.tsx | 22 +---- .../components/setup-dialog-footer.tsx | 32 ++++++++ .../tests/manual/reference/automation.md | 1 + .../tests/manual/suites/automations.md | 12 ++- 6 files changed, 166 insertions(+), 34 deletions(-) create mode 100644 services/platform/app/features/coding-agent/components/setup-dialog-footer.tsx diff --git a/services/platform/app/features/automations/components/coding-agent-entry.test.tsx b/services/platform/app/features/automations/components/coding-agent-entry.test.tsx index 84e854211f..868bda728b 100644 --- a/services/platform/app/features/automations/components/coding-agent-entry.test.tsx +++ b/services/platform/app/features/automations/components/coding-agent-entry.test.tsx @@ -1,5 +1,5 @@ import type { AnchorHTMLAttributes } from 'react'; -import { describe, expect, it, vi } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { checkAccessibility } from '@/tests/utils/a11y'; import { render, screen, within } from '@/tests/utils/render'; @@ -29,16 +29,40 @@ vi.mock('@tanstack/react-router', async () => { }; }); +const h = vi.hoisted(() => ({ + access: { signInOn: true } as { signInOn: boolean } | undefined, +})); + +vi.mock('@/lib/site-url-context', () => ({ + useSiteUrl: () => 'https://tale.example.com', +})); +vi.mock('@/app/features/coding-agent/hooks/use-new-connection', () => ({ + useNewConnection: () => ({ state: 'waiting' }), +})); +vi.mock( + '@/app/features/settings/agent-connections/hooks/queries', + async (importOriginal) => ({ + ...(await importOriginal< + typeof import('@/app/features/settings/agent-connections/hooks/queries') + >()), + useAgentConnectionAccess: () => ({ data: h.access }), + }), +); + import { CodingAgentButton } from './coding-agent-entry'; +beforeEach(() => { + h.access = { signInOn: true }; +}); + /** * An automation changes through a coding agent connected to Tale's MCP * server; the canvas only takes small field edits. The entry says so and - * hands the reader what an agent needs: the automation's name, the way to - * set up MCP and the guide. + * hands the reader what an agent needs: the commands that connect it, a + * prompt that names this automation, and the guide. */ describe('CodingAgentButton', () => { - it('opens the way to edit with a coding agent', async () => { + it('opens the way to edit with a coding agent, with a prompt that names the automation', async () => { const { user } = render( { expect(dialog).toHaveAccessibleDescription( /^Coding agents such as Claude Code, Codex and Cursor change automations through Tale's MCP server\./, ); - // The name to hand the agent, copied with one press. + // The commands that connect the agent in use. + expect(within(dialog).getByText('claude mcp login tale')).toBeVisible(); + // The prompt hands the agent this automation by name. + expect(within(dialog).getByText(/support\/triage-inbox/)).toBeVisible(); + expect( + within(dialog).getByText('[Describe the change you want.]'), + ).toBeVisible(); + const guide = within(dialog).getByRole('link', { name: 'Setup guide' }); + expect(guide.getAttribute('href')).toMatch( + /\/develop\/use-tale-from-your-editor$/, + ); + expect(guide).toHaveAttribute('target', '_blank'); + await checkAccessibility(dialog); + }); + + it('offers the name to copy and the MCP settings while agents may not sign in', async () => { + h.access = { signInOn: false }; + const { user } = render( + , + ); + await user.click( + screen.getByRole('button', { name: 'Edit with your coding agent' }), + ); + const dialog = await screen.findByRole('dialog', { + name: 'Edit with your coding agent', + }); + // The name to hand an agent that holds a key, copied with one press. expect( within(dialog).getByRole('button', { name: 'Name of this automation support/triage-inbox', @@ -71,9 +124,27 @@ describe('CodingAgentButton', () => { }); expect(guide.getAttribute('href')).toMatch(/\/develop\/mcp-endpoint$/); expect(guide).toHaveAttribute('target', '_blank'); + expect( + within(dialog).queryByText('claude mcp login tale'), + ).not.toBeInTheDocument(); await checkAccessibility(dialog); }); + it('shows the guided setup while it is not yet known whether agents may sign in', async () => { + h.access = undefined; + const { user } = render( + , + ); + await user.click( + screen.getByRole('button', { name: 'Edit with your coding agent' }), + ); + const dialog = await screen.findByRole('dialog'); + expect(within(dialog).getByText('claude mcp login tale')).toBeVisible(); + }); + it('is the main action of an empty automation', () => { render( - + {t('codingAgent.button')} {t('codingAgent.body')} + + + + ); +} + +/** + * What the dialog holds once it is open: the guided setup, with a prompt that + * names this automation, while agents may sign in; where the operator turned + * that off, the automation's name to hand an agent that holds a key and the + * way to the MCP settings, which describe the key. + */ +function CodingAgentDialogBody({ + organizationId, + automationSlug, +}: { + organizationId: string; + automationSlug: string; +}) { + const { t } = useT('automations'); + const { data: access } = useAgentConnectionAccess(organizationId); + if (access?.signInOn === false) { + return ( + <> - - + + ); + } + return ( + <> + + + ); } diff --git a/services/platform/app/features/coding-agent/components/connect-agent-dialog.tsx b/services/platform/app/features/coding-agent/components/connect-agent-dialog.tsx index b515162792..62b296b36f 100644 --- a/services/platform/app/features/coding-agent/components/connect-agent-dialog.tsx +++ b/services/platform/app/features/coding-agent/components/connect-agent-dialog.tsx @@ -1,20 +1,17 @@ 'use client'; -import { Button } from '@tale/ui/button'; import { ResponsiveDialog, - ResponsiveDialogClose, ResponsiveDialogContent, ResponsiveDialogDescription, ResponsiveDialogTitle, } from '@tale/ui/responsive-dialog'; -import { TALE_DOCS_URL } from '@tale/ui/seo/globals'; -import { ExternalLink } from 'lucide-react'; import type { RefObject } from 'react'; import { useT } from '@/lib/i18n/client'; import { CodingAgentSetup } from './coding-agent-setup'; +import { SetupDialogFooter } from './setup-dialog-footer'; interface ConnectAgentDialogProps { organizationId: string; @@ -51,22 +48,7 @@ export function ConnectAgentDialog({ organizationId={organizationId} promptContext={{ kind: 'general' }} /> -
- - {t('dialog.guide')} - - - - - -
+ ); diff --git a/services/platform/app/features/coding-agent/components/setup-dialog-footer.tsx b/services/platform/app/features/coding-agent/components/setup-dialog-footer.tsx new file mode 100644 index 0000000000..743513025c --- /dev/null +++ b/services/platform/app/features/coding-agent/components/setup-dialog-footer.tsx @@ -0,0 +1,32 @@ +'use client'; + +import { Button } from '@tale/ui/button'; +import { ResponsiveDialogClose } from '@tale/ui/responsive-dialog'; +import { TALE_DOCS_URL } from '@tale/ui/seo/globals'; +import { ExternalLink } from 'lucide-react'; + +import { useT } from '@/lib/i18n/client'; + +/** The foot of a dialog that connects a coding agent: the guide for the + * agents it has no commands for yet, and the way out. */ +export function SetupDialogFooter() { + const { t } = useT('codingAgent'); + return ( +
+ + {t('dialog.guide')} + + + + + +
+ ); +} diff --git a/services/platform/tests/manual/reference/automation.md b/services/platform/tests/manual/reference/automation.md index 2543ce8386..5027dcfe2a 100644 --- a/services/platform/tests/manual/reference/automation.md +++ b/services/platform/tests/manual/reference/automation.md @@ -823,6 +823,7 @@ Legend: ✅ fully automated · 🔶 partially automated · ⛔ manual-only (no s | [auth](../suites/auth.md) | `AUTH-F5`, `AUTH-F10`–`AUTH-F12`, `AUTH-F17`, `AUTH-B3`, `AUTH-B4` | ⛔ manual-only | — (fresh DB / WebAuthn / IdP / mid-session policy / TOTP / needs 2 orgs) | | [automations](../suites/automations.md) | `AUTO-F57` and the trail half of `AUTO-B12`: an automation opened inside a project starts its trail at the project — the project's name leads to the project, **Automations** to the project's Automations tab, the automation's name (on a run) to its editor; a project the read answers without (deleted, or out of reach) gives the organization's trail, whose **Automations** and back arrow lead to the organization's list, a read that failed leaves a **Projects** crumb, a loading one a skeleton; only the leaf is the current page, a long project or automation name truncates while the leaf keeps its room and shows whole in a tooltip on hover or focus (never over a name that fits), and the phone's back arrow returns to the project's Automations tab; the rail and the tab bar light **Automations** there, never **Home**, and no Home panel stands beside it | 🔶 Chromium + component | `app/features/automations/components/automation-breadcrumbs.browser.test.tsx`, `app/features/automations/components/automation-breadcrumbs.test.tsx`, `app/hooks/use-navigation-items.test.ts`, `app/features/home/lib/home-paths.test.ts`, `app/components/layout/mobile-bottom-nav.test.tsx`, `app/components/layout/app-sidebar/sidebar-nav.browser.test.tsx`; the pill's glide, the look of the truncation and the DE/FR read stay manual | | [automations](../suites/automations.md) | `AUTO-F1` (toolbar create), `AUTO-F1b`, `AUTO-F4` (org-level row), `AUTO-F8` (yml lane, Later), `AUTO-F12` (leaf switcher), `AUTO-F35` (tab strip walk) | 🔶 partial | `automations.spec.ts` (upload → detail tabs + switcher → delete) | +| [automations](../suites/automations.md) | `AUTO-F87` (the component half): **Edit with your coding agent** opens the guided setup with a prompt that names this automation (`support/triage-inbox`) and its place to fill in, the guide opening in a new tab, and axe clean; where agents may not sign in it shows the name to copy, **Set up MCP** and the guide instead; while that is not yet known it shows the setup; and the button is the main action of an empty automation | ✅ component | `app/features/automations/components/coding-agent-entry.test.tsx`; the setup it holds is covered with `SET-F89` | | [automations](../suites/automations.md) | The end-to-end half of `AUTO-F73`, on the branch probe: after an upload, the condition stands above Escalate and is named for it, **Yes** leads to Escalate and **No** to File; an edit of Score's **Input** in the inspector saves v2; after a **Test run** of v2, the run page's condition says **No**, the line to File is taken and the one to Escalate is not, File succeeded and Escalate was skipped | 🔶 partial | `automation-canvas.spec.ts` (upload → condition and branches → field edit → save → test run → the branch on the run page → delete); the layout, the dashed borders and the condition's words stay manual | | [automations](../suites/automations.md) | The leaf switcher keeps all automations after project navigation, lists organization automations above a separator and project-specific ones below, searches across both groups, routes each selection to its bound project or the organization, and resets the editor's version and draft when the automation changes | ✅ automated | `app/features/automations/components/automation-breadcrumb-switcher.browser.test.tsx` (real Chromium navigation and grouping), `automation-breadcrumb-switcher.test.tsx` (project binding destinations), `automation-editor.test.tsx` (editor identity reset), `app/components/ui/forms/searchable-select.test.tsx` (group filtering and keyboard navigation) | | [automations](../suites/automations.md) | `AUTO-F12` workbench layout: at phone width the canvas fills the available height at every point — before selection and after — with editor actions inside it never overlapping zoom or navigation; picking a node opens its fields (and Save/Discard) in a sheet over the canvas instead of stacking below it, and the canvas never grows or scrolls under that sheet; at desktop width the canvas and inspector split into columns and fill the tab without scrolling the page | ✅ automated | `app/features/automations/components/automation-editor.browser.test.tsx` (real Chromium layout at 390×844 and 1280×800; tablet node dialogs keep one localized close control in EN/DE/FR; compact automation navigation is covered by `app/components/layout/mobile-bottom-nav.test.tsx`) | diff --git a/services/platform/tests/manual/suites/automations.md b/services/platform/tests/manual/suites/automations.md index ac74ac1454..6edfb2ae27 100644 --- a/services/platform/tests/manual/suites/automations.md +++ b/services/platform/tests/manual/suites/automations.md @@ -972,8 +972,16 @@ output: (`automations.codingAgent.button`) → it is the last button at the canvas's top right in Canvas, List and Source, and the primary action of a version with no nodes (`automations.canvas.empty.title`); its dialog - shows **Name of this automation** (`automations.codingAgent.nameLabel`) - to copy, **Set up MCP** (`automations.codingAgent.setUp`) opening + shows what SET-F89 shows — the **Claude Code**, **Codex** and **Other** + tabs with their commands, the line that waits for an agent to sign in and + then names it, and a prompt that names this automation + (`codingAgent.prompt.edit`) with **[Describe the change you want.]** + marked — and **Setup guide** (`codingAgent.dialog.guide`) opening the + guide in a new tab. With the agent sign-in switched off + (`TALE_MCP_DYNAMIC_CLIENT_REGISTRATION` and + `TALE_MCP_CLIENT_METADATA_DOCUMENTS` both `false`) it shows **Name of + this automation** (`automations.codingAgent.nameLabel`) to copy, **Set up + MCP** (`automations.codingAgent.setUp`) opening `/dashboard/{org}/settings/api/mcp`, and **How to connect a coding agent** (`automations.codingAgent.learnMore`) opening the MCP endpoint guide in a new tab. From 62c6fc9111eb1a35b563fe3e3f24e1ba83307790 Mon Sep 17 00:00:00 2001 From: yannickmonney Date: Tue, 13 Oct 2026 19:01:56 +0200 Subject: [PATCH 2/2] docs: say what the editor's coding agent dialog now holds The assistant guide described the dialog as the automation's name and two links. It now says what the dialog gives: the commands that connect Claude Code or Codex, the address for any other agent, the line that says when the agent has signed in, and a prompt that names the automation, and that where the operator turned agent sign-in off it shows the name and leads to the MCP settings. English, German and French. --- docs/de/platform/automations/assistant.md | 2 +- docs/en/platform/automations/assistant.md | 2 +- docs/fr/platform/automations/assistant.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/de/platform/automations/assistant.md b/docs/de/platform/automations/assistant.md index fe443eab74..8f79a657bb 100644 --- a/docs/de/platform/automations/assistant.md +++ b/docs/de/platform/automations/assistant.md @@ -19,7 +19,7 @@ description: Ändere Workflows direkt im visuellen Editor oder lass deinen Codin ## Mit deinem Coding-Agent ändern -Der Weg dorthin ist **Mit deinem Coding-Agent bearbeiten**, die letzte Schaltfläche oben rechts im Canvas des Editors. Ihr Dialog zeigt den Namen der Automatisierung, den du dem Agent gibst, **MCP einrichten**, das **Einstellungen > API > MCP** öffnet, und einen Link zur Anleitung, mit der du einen Coding-Agent verbindest. Verbinde deinen Coding-Agent mit dem Endpoint unter **Einstellungen > API > MCP**: Der Agent meldet sich selbst an, und du wählst die Organisation und was er darf, oder du gibst ihm deinen persönlichen API-Schlüssel. Fertige Konfigurationen findest du unter [Tale aus deinem Editor oder einem Skript nutzen](/de/develop/use-tale-from-your-editor), und unter [Verbundene Agenten](/de/platform/admin/connected-agents) siehst du die Agents, die du verbunden hast, und trennst sie wieder. Sag ihm, was die Automatisierung entgegennehmen und liefern soll und welche Systeme sie verändern darf. Lass ihn die vorhandenen Automatisierungen und das, was deine Organisation hat, ansehen, bevor er eine weitere erstellt. +Der Weg dorthin ist **Mit deinem Coding-Agent bearbeiten**, die letzte Schaltfläche oben rechts im Canvas des Editors. Ihr Dialog nennt die Befehle, die Claude Code oder Codex verbinden, und die Adresse für jeden anderen Agent, sagt dir, wann sich dein Agent angemeldet hat, und bietet dir einen Prompt für ihn an, der diese Automatisierung nennt. Der Agent meldet sich selbst an, und du wählst die Organisation und was er darf; hat dein Betreiber die Anmeldung von Agents abgeschaltet, zeigt der Dialog den Namen der Automatisierung und führt zu **Einstellungen > API > MCP**, wo du dem Agent deinen persönlichen API-Schlüssel gibst. Fertige Konfigurationen findest du unter [Tale aus deinem Editor oder einem Skript nutzen](/de/develop/use-tale-from-your-editor), und unter [Verbundene Agenten](/de/platform/admin/connected-agents) siehst du die Agents, die du verbunden hast, und trennst sie wieder. Sag ihm, was die Automatisierung entgegennehmen und liefern soll und welche Systeme sie verändern darf. Lass ihn die vorhandenen Automatisierungen und das, was deine Organisation hat, ansehen, bevor er eine weitere erstellt. Dein Agent arbeitet an einer Automatisierung so, wie du es im Editor tust. Er liest die Referenz und die aktuelle Version, validiert seine Änderung, führt sie mit den Mocks aus und lässt die Tests der Automatisierung laufen. Dann speichert er eine neue Version und nennt dabei die Version, von der er ausgegangen ist. Hat inzwischen jemand eine neuere Version gespeichert, lehnt Tale das Speichern ab; der Agent liest dann diese Version und führt seine Änderung zuerst zusammen. Startet er eine gespeicherte Version mit den Mocks, erscheint der Lauf im Tab **Läufe** der Automatisierung als **Test**-Lauf mit **Von dir gestartet (API)**, sodass du öffnen kannst, was er ausgeführt hat. Eine Version, die der Agent speichert, erscheint im Canvas, während du die Automatisierung ansiehst. diff --git a/docs/en/platform/automations/assistant.md b/docs/en/platform/automations/assistant.md index aef2e91197..22200d2731 100644 --- a/docs/en/platform/automations/assistant.md +++ b/docs/en/platform/automations/assistant.md @@ -19,7 +19,7 @@ Open **Automations** and select the workflow. Select a node to inspect its input ## Change it with your coding agent -**Edit with your coding agent**, the last button at the top right of the editor's canvas, is the way in. Its dialog shows the automation's name to give the agent, **Set up MCP**, which opens **Settings > API > MCP**, and a link to the guide for connecting a coding agent. Connect your coding agent with the endpoint under **Settings > API > MCP**: the agent signs itself in, and you choose the organization and what it may do, or you give it your personal API key. [Use Tale from your editor or a script](/develop/use-tale-from-your-editor) has ready configurations, and [Connected agents](/platform/admin/connected-agents) shows and ends the agents you connected. Tell it what the automation should take in, what it should produce, and which systems it may change. Ask it to look at the existing automations and at what your organization has before it creates another one. +**Edit with your coding agent**, the last button at the top right of the editor's canvas, is the way in. Its dialog gives the commands that connect Claude Code or Codex and the address for any other agent, says when your agent has signed in, and offers a prompt for it that names this automation. The agent signs itself in, and you choose the organization and what it may do; where your operator has turned agent sign-in off, the dialog shows the automation's name and leads to **Settings > API > MCP**, where you give the agent your personal API key. [Use Tale from your editor or a script](/develop/use-tale-from-your-editor) has ready configurations, and [Connected agents](/platform/admin/connected-agents) shows and ends the agents you connected. Tell it what the automation should take in, what it should produce, and which systems it may change. Ask it to look at the existing automations and at what your organization has before it creates another one. Your agent works on an automation the way you do in the editor. It reads the reference and the current version, validates its change, runs it on the mocks and runs the automation’s tests, then saves a new version that names the version it started from. If someone saved a newer version in the meantime, Tale refuses the save, and the agent reads that version and merges its change first. When it starts a saved version on the mocks, the run appears in the automation’s **Runs** tab as a **Test** run, **Started by you (API)**, so you can open what it ran. A version the agent saves appears on the canvas while you look at the automation. diff --git a/docs/fr/platform/automations/assistant.md b/docs/fr/platform/automations/assistant.md index 14c0ff930f..f797daf4ec 100644 --- a/docs/fr/platform/automations/assistant.md +++ b/docs/fr/platform/automations/assistant.md @@ -19,7 +19,7 @@ Ouvre **Automatisations** et sélectionne le workflow. Choisis un nœud pour exa ## Modifier avec ton agent de code -Le point de départ est **Modifier avec ton agent de code**, le dernier bouton en haut à droite du canevas de l’éditeur. Son dialogue montre le nom de l’automatisation à donner à l’agent, **Configurer MCP**, qui ouvre **Paramètres > API > MCP**, et un lien vers le guide pour connecter un agent de code. Connecte ton agent de code avec l’endpoint indiqué sous **Paramètres > API > MCP** : l’agent se connecte lui-même, et tu choisis l’organisation et ce qu’il peut faire, ou tu lui donnes ta clé API personnelle. [Utiliser Tale depuis ton éditeur ou un script](/fr/develop/use-tale-from-your-editor) propose des configurations prêtes à l’emploi, et [Agents connectés](/fr/platform/admin/connected-agents) montre les agents que tu as connectés et te laisse mettre fin à leur connexion. Dis à ton agent ce que l’automatisation doit recevoir, ce qu’elle doit produire et quels systèmes elle peut modifier. Demande-lui d’examiner les automatisations existantes et ce dont ton organisation dispose avant d’en créer une autre. +Le point de départ est **Modifier avec ton agent de code**, le dernier bouton en haut à droite du canevas de l’éditeur. Son dialogue donne les commandes qui connectent Claude Code ou Codex et l’adresse pour tout autre agent, indique quand ton agent s’est connecté et te propose un prompt à lui donner, qui nomme cette automatisation. L’agent se connecte lui-même, et tu choisis l’organisation et ce qu’il peut faire ; si ton opérateur a désactivé la connexion des agents, le dialogue montre le nom de l’automatisation et mène à **Paramètres > API > MCP**, où tu donnes à l’agent ta clé API personnelle. [Utiliser Tale depuis ton éditeur ou un script](/fr/develop/use-tale-from-your-editor) propose des configurations prêtes à l’emploi, et [Agents connectés](/fr/platform/admin/connected-agents) montre les agents que tu as connectés et te laisse mettre fin à leur connexion. Dis à ton agent ce que l’automatisation doit recevoir, ce qu’elle doit produire et quels systèmes elle peut modifier. Demande-lui d’examiner les automatisations existantes et ce dont ton organisation dispose avant d’en créer une autre. Ton agent travaille sur une automatisation comme toi dans l’éditeur. Il lit la référence et la version actuelle, valide sa modification, l’exécute avec les simulations et lance les tests de l’automatisation, puis enregistre une nouvelle version en indiquant celle dont il est parti. Si quelqu’un a enregistré une version plus récente entre-temps, Tale refuse l’enregistrement ; l’agent lit alors cette version et y intègre d’abord sa modification. Quand il lance une version enregistrée avec les simulations, l’exécution apparaît dans l’onglet **Exécutions** de l’automatisation comme exécution **Essai**, **Lancée par toi (API)**, pour que tu puisses ouvrir ce qu’il a exécuté. Une version enregistrée par l’agent apparaît sur le canevas pendant que tu consultes l’automatisation.