Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(ide): give the add-your-own-CLI dialog a cleaner, clearer form
rubenluetke10-beep99758404e4f5
diff --git a/jarvis/ui/web/frontend/src/components/agentic/CustomCliDialog.test.tsx b/jarvis/ui/web/frontend/src/components/agentic/CustomCliDialog.test.tsxindex 28a0f4ea03..0ba8745fc7 100644--- a/jarvis/ui/web/frontend/src/components/agentic/CustomCliDialog.test.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/CustomCliDialog.test.tsx@@ -237,7 +237,7 @@ describe("CustomCliDialog", () => {);expect(field("custom-cli-name").value).toBe("Helix");expect(field("custom-cli-command").value).toBe("helix");- expect(field("custom-cli-at-reference").checked).toBe(true);+ expect(screen.getByTestId("custom-cli-at-reference").getAttribute("aria-checked")).toBe("true");});});diff --git a/jarvis/ui/web/frontend/src/components/agentic/CustomCliDialog.tsx b/jarvis/ui/web/frontend/src/components/agentic/CustomCliDialog.tsxindex e5ea02f372..5e41488109 100644--- a/jarvis/ui/web/frontend/src/components/agentic/CustomCliDialog.tsx+++ b/jarvis/ui/web/frontend/src/components/agentic/CustomCliDialog.tsx@@ -25,10 +25,11 @@*/import { useEffect, useMemo, useRef, useState } from "react";import * as Dialog from "@radix-ui/react-dialog";-import { ImagePlus, Terminal, Trash2, X } from "lucide-react";+import { AlertTriangle, ImagePlus, Info, Loader2, Terminal, Trash2, X } from "lucide-react";import { useT } from "@/i18n";import { cn } from "@/lib/utils";+import { Switch } from "@/components/ui/switch";import {createCustomCli,removeCustomCliLogo,@@ -37,7 +38,7 @@ import {type CustomCli,} from "@/lib/workspaceClisApi";import { AgentMark } from "./AgentMark";-import { Button, Field, SectionLabel } from "./controls";+import { Button } from "./controls";/** Shell characters that mean the command is source rather than an argv. */const SHELL_META = /[|&;<>()$`\n]/;@@ -148,30 +149,36 @@ export function CustomCliDialog({}};+ const inputClass =+ "h-9 w-full min-w-0 rounded-md border border-border bg-background px-3 text-sm text-foreground " ++ "outline-none transition-colors placeholder:text-faint-foreground " ++ "hover:border-border-strong focus:border-border-strong focus-visible:ring-2 focus-visible:ring-ring/40";+return (<Dialog.Root open={open} onOpenChange={onOpenChange}><Dialog.Portal>- <Dialog.Overlay className="fixed inset-0 z-[80] bg-scrim/75 backdrop-blur-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-reduce:animate-none" />+ <Dialog.Overlay className="fixed inset-0 z-[80] bg-scrim/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-reduce:animate-none" /><Dialog.Contentdata-testid="custom-cli-dialog"className={cn(- "fixed left-1/2 top-1/2 z-[90] flex max-h-[min(88dvh,44rem)] w-[min(560px,calc(100vw-2rem))]",- "-translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg",- "bg-popover shadow-float outline-none",+ "fixed left-1/2 top-1/2 z-[90] flex max-h-[min(88dvh,46rem)] w-[min(520px,calc(100vw-2rem))]",+ "-translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border",+ "bg-popover text-foreground shadow-float outline-none","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 motion-reduce:animate-none",)}>- <header className="flex items-start justify-between gap-4 border-b border-border px-5 py-4">- <div className="min-w-0">- <div className="mb-1 flex items-center gap-2">- <Terminal className="h-4 w-4 text-primary" aria-hidden="true" />- <Dialog.Title className="font-display text-base font-semibold tracking-tight text-foreground">- {editing- ? t("custom_cli.title_edit")- : t("custom_cli.title_add")}- </Dialog.Title>- </div>- <Dialog.Description className="text-xs leading-relaxed text-muted-foreground">+ <header className="flex items-start gap-3 px-6 pb-4 pt-5">+ <span+ aria-hidden="true"+ className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border bg-secondary text-foreground"+ >+ <Terminal className="h-4 w-4" />+ </span>+ <div className="min-w-0 flex-1 pt-0.5">+ <Dialog.Title className="font-display text-base font-semibold tracking-tight text-foreground-strong">+ {editing ? t("custom_cli.title_edit") : t("custom_cli.title_add")}+ </Dialog.Title>+ <Dialog.Description className="mt-1 text-sm leading-relaxed text-muted-foreground">{t("custom_cli.description")}</Dialog.Description></div>@@ -179,50 +186,71 @@ export function CustomCliDialog({<buttontype="button"aria-label={t("custom_cli.close")}- className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"+ className="-mr-2 -mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60"><X className="h-4 w-4" aria-hidden="true" /></button></Dialog.Close></header>- <div className="flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-5 py-5 scrollbar-jarvis">- {/* Identity: the mark and the name, side by side, because the mark- is what the name will be seen next to in every picker. */}+ <div className="flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto border-t border-border px-6 py-5 scrollbar-jarvis">+ {/* Identity: the mark and the name side by side, because the mark is+ what the name will be seen next to in every picker. The whole+ mark is the upload target, so there is no separate tiny icon. */}<div className="flex items-start gap-4">- <div className="flex shrink-0 flex-col items-center gap-1.5">- <AgentMark- agent={editing?.id ?? "new"}- label={trimmedName || "?"}- size="lg"- logoUrl={shownLogo || undefined}- />- <div className="flex items-center gap-0.5">+ <div className="flex w-16 shrink-0 flex-col items-center gap-1.5">+ <button+ type="button"+ onClick={() => pickerRef.current?.click()}+ aria-label={t("custom_cli.pick_logo")}+ title={t("custom_cli.pick_logo")}+ data-testid="custom-cli-pick-logo"+ className={cn(+ "group relative flex h-16 w-16 items-center justify-center overflow-hidden rounded-xl transition-colors",+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",+ shownLogo || trimmedName+ ? "border border-border bg-background hover:border-border-strong"+ : "border border-dashed border-border-strong bg-background/60 text-muted-foreground hover:bg-secondary hover:text-foreground",+ )}+ >+ {shownLogo || trimmedName ? (+ <AgentMark+ agent={editing?.id ?? "new"}+ label={trimmedName || "?"}+ size="lg"+ logoUrl={shownLogo || undefined}+ // The tile is the frame; the mark fills it rather than+ // drawing a second box inside.+ className="h-full w-full rounded-none border-0 bg-transparent text-base"+ />+ ) : (+ <ImagePlus className="h-5 w-5" aria-hidden="true" />+ )}+ {(shownLogo || trimmedName) && (+ <span+ aria-hidden="true"+ className="absolute inset-0 flex items-center justify-center bg-scrim/55 text-white opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100"+ >+ <ImagePlus className="h-4 w-4" />+ </span>+ )}+ </button>+ {shownLogo ? (<buttontype="button"- onClick={() => pickerRef.current?.click()}- aria-label={t("custom_cli.pick_logo")}- title={t("custom_cli.pick_logo")}- data-testid="custom-cli-pick-logo"- className="flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"+ onClick={() => {+ setLogoFile(null);+ setClearedLogo(true);+ }}+ title={t("custom_cli.remove_logo")}+ className="inline-flex items-center gap-1 rounded px-1 text-micro text-muted-foreground transition-colors hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60">- <ImagePlus className="h-3.5 w-3.5" aria-hidden="true" />+ <Trash2 className="h-3 w-3" aria-hidden="true" />+ {t("custom_cli.remove_logo_short")}</button>- {shownLogo && (- <button- type="button"- onClick={() => {- setLogoFile(null);- setClearedLogo(true);- }}- aria-label={t("custom_cli.remove_logo")}- title={t("custom_cli.remove_logo")}- className="flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground"- >- <Trash2 className="h-3.5 w-3.5" aria-hidden="true" />- </button>- )}- </div>+ ) : (+ <span className="text-micro text-faint-foreground">{t("custom_cli.logo_label")}</span>+ )}<inputref={pickerRef}type="file"@@ -242,95 +270,122 @@ export function CustomCliDialog({</div><label className="flex min-w-0 flex-1 flex-col gap-1.5">- <SectionLabel>{t("custom_cli.name")}</SectionLabel>- <Field+ <span className="text-xs font-medium text-foreground">{t("custom_cli.name")}</span>+ <inputvalue={name}autoFocusmaxLength={60}data-testid="custom-cli-name"placeholder={t("custom_cli.name_placeholder")}+ className={inputClass}onChange={(event) => setName(event.currentTarget.value)}/>- <span className="text-micro text-muted-foreground">+ <span className="text-xs leading-relaxed text-muted-foreground">{t("custom_cli.name_hint")}</span></label></div><label className="flex flex-col gap-1.5">- <SectionLabel>{t("custom_cli.command")}</SectionLabel>- <Field- value={command}- maxLength={500}- spellCheck={false}- autoCapitalize="off"- autoCorrect="off"- data-testid="custom-cli-command"- placeholder={t("custom_cli.command_placeholder")}- className="font-mono"- onChange={(event) => setCommand(event.currentTarget.value)}- onKeyDown={(event) => {- if (event.key === "Enter" && canSave) void save();- }}- />- <span className="text-micro text-muted-foreground">- {throughShell- ? t("custom_cli.command_shell_hint")- : t("custom_cli.command_hint")}+ <span className="text-xs font-medium text-foreground">{t("custom_cli.command")}</span>+ {/* A prompt sign in front of the command reads as "typed into a+ terminal", which is exactly what this field holds. */}+ <span className="relative block">+ <span+ aria-hidden="true"+ className="pointer-events-none absolute inset-y-0 left-3 flex items-center font-mono text-sm text-faint-foreground"+ >+ $+ </span>+ <input+ value={command}+ maxLength={500}+ spellCheck={false}+ autoCapitalize="off"+ autoCorrect="off"+ data-testid="custom-cli-command"+ placeholder={t("custom_cli.command_placeholder")}+ className={cn(inputClass, "pl-7 font-mono")}+ onChange={(event) => setCommand(event.currentTarget.value)}+ onKeyDown={(event) => {+ if (event.key === "Enter" && canSave) void save();+ }}+ /></span>+ {throughShell ? (+ <span className="flex items-start gap-2 rounded-md bg-secondary px-3 py-2 text-xs leading-relaxed text-foreground">+ <Info className="mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" aria-hidden="true" />+ {t("custom_cli.command_shell_hint")}+ </span>+ ) : (+ <span className="text-xs leading-relaxed text-muted-foreground">+ {t("custom_cli.command_hint")}+ </span>+ )}</label><label className="flex flex-col gap-1.5">- <SectionLabel>{t("custom_cli.description_label")}</SectionLabel>- <Field+ <span className="flex items-baseline justify-between gap-2 text-xs font-medium text-foreground">+ {t("custom_cli.description_label")}+ <span className="font-normal text-faint-foreground">{t("custom_cli.optional")}</span>+ </span>+ <inputvalue={description}maxLength={200}data-testid="custom-cli-description"placeholder={t("custom_cli.description_placeholder")}+ className={inputClass}onChange={(event) => setDescription(event.currentTarget.value)}/></label>- <label className="flex cursor-pointer items-start gap-2.5">- <input- type="checkbox"- checked={atReference}- data-testid="custom-cli-at-reference"- onChange={(event) => setAtReference(event.currentTarget.checked)}- className="mt-0.5 h-4 w-4 shrink-0 accent-primary"- />- <span className="min-w-0">- <span className="block text-sm text-foreground">+ <div className="flex items-start justify-between gap-4 rounded-lg border border-border bg-background/60 px-4 py-3">+ <label htmlFor="custom-cli-at-reference" className="min-w-0 cursor-pointer">+ <span className="block text-sm font-medium text-foreground">{t("custom_cli.at_reference")}</span>- <span className="block text-micro text-muted-foreground">+ <span className="mt-0.5 block text-xs leading-relaxed text-muted-foreground">{t("custom_cli.at_reference_hint")}</span>- </span>- </label>+ </label>+ <Switch+ id="custom-cli-at-reference"+ checked={atReference}+ data-testid="custom-cli-at-reference"+ onCheckedChange={setAtReference}+ className="mt-0.5"+ />+ </div>{error && (<prole="alert"data-testid="custom-cli-error"- className="border-l-2 border-destructive/70 py-1 pl-3 text-sm text-destructive"+ className="flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive">- {error}+ <AlertTriangle className="mt-0.5 h-4 w-4 shrink-0" aria-hidden="true" />+ <span className="min-w-0">{error}</span></p>)}</div>- <footer className="flex shrink-0 items-center justify-end gap-2 border-t border-border px-5 py-4">+ <footer className="flex shrink-0 items-center justify-end gap-2 border-t border-border bg-background/40 px-6 py-4"><Dialog.Close asChild>- <Button variant="quiet">{t("custom_cli.cancel")}</Button>+ <Button variant="quiet" className="h-9 px-4">{t("custom_cli.cancel")}</Button></Dialog.Close><Buttonvariant="primary"disabled={!canSave}data-testid="custom-cli-save"+ className="h-9 px-4"onClick={() => void save()}>- {saving ? t("custom_cli.saving") : t("custom_cli.save")}+ {saving && <Loader2 className="h-3.5 w-3.5 animate-spin" aria-hidden="true" />}+ {saving+ ? t("custom_cli.saving")+ : editing+ ? t("custom_cli.save")+ : t("custom_cli.save_add")}</Button></footer></Dialog.Content>diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 34fa9c743c..f0da902feb 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -4352,20 +4352,24 @@"close": "Schließen","cancel": "Abbrechen","save": "Speichern",+ "save_add": "CLI hinzufügen","saving": "Wird gespeichert…","name": "Name",- "name_placeholder": "Antigravity",+ "name_placeholder": "z. B. Aider","name_hint": "So steht es in den Auswahllisten — und so sprichst du es an.","command": "Befehl",- "command_placeholder": "agy",+ "command_placeholder": "aider","command_hint": "Genau das, was du im Terminal eintippen würdest, um es zu starten.","command_shell_hint": "Das läuft über eine Shell, weil der Befehl aus mehr als einem Programm besteht. Der Pane schließt sich, wenn die ganze Zeile durch ist.","description_label": "Beschreibung",+ "optional": "Optional","description_placeholder": "Eine Zeile, was dieses CLI ist.","at_reference": "Abgelegte Dateien als @Pfad schreiben",- "at_reference_hint": "Die meisten modernen Coding-CLIs lesen @Pfad als zu öffnende Datei. Ohne Haken werden Pfade in Anführungszeichen eingefügt.",+ "at_reference_hint": "Die meisten modernen Coding-CLIs lesen @Pfad als zu öffnende Datei. Ausgeschaltet werden Pfade in Anführungszeichen eingefügt.","pick_logo": "Logo auswählen","remove_logo": "Logo entfernen",+ "remove_logo_short": "Entfernen",+ "logo_label": "Logo","edit_named": "{0} bearbeiten","remove_named": "{0} entfernen","gone": "Dieses CLI steht nicht mehr in der Liste.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 90b5a47ed0..a698c0e5a2 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -4352,20 +4352,24 @@"close": "Close","cancel": "Cancel","save": "Save",+ "save_add": "Add CLI","saving": "Saving…","name": "Name",- "name_placeholder": "Antigravity",+ "name_placeholder": "e.g. Aider","name_hint": "What you will see in the pickers and say out loud.","command": "Command",- "command_placeholder": "agy",+ "command_placeholder": "aider","command_hint": "Exactly what you would type in a terminal to start it.","command_shell_hint": "This runs through a shell, because the command is more than one program. The pane closes when the whole line is done.","description_label": "Description",+ "optional": "Optional","description_placeholder": "One line explaining what this CLI is.","at_reference": "Write dropped files as @path","at_reference_hint": "Most modern coding CLIs read @path as a file to open. Leave this off and paths are pasted in quotes instead.","pick_logo": "Choose a logo","remove_logo": "Remove the logo",+ "remove_logo_short": "Remove",+ "logo_label": "Logo","edit_named": "Edit {0}","remove_named": "Remove {0}","gone": "That CLI is not in the list any more.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 960787a877..43bfd553f0 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -4352,20 +4352,24 @@"close": "Cerrar","cancel": "Cancelar","save": "Guardar",+ "save_add": "Añadir CLI","saving": "Guardando…","name": "Nombre",- "name_placeholder": "Antigravity",+ "name_placeholder": "p. ej. Aider","name_hint": "Lo que verás en los selectores y dirás en voz alta.","command": "Comando",- "command_placeholder": "agy",+ "command_placeholder": "aider","command_hint": "Exactamente lo que escribirías en una terminal para iniciarla.","command_shell_hint": "Esto se ejecuta a través de un shell, porque el comando es más de un programa. El panel se cierra cuando termina la línea entera.","description_label": "Descripción",+ "optional": "Opcional","description_placeholder": "Una línea que explique qué es esta CLI.","at_reference": "Escribir los archivos soltados como @ruta",- "at_reference_hint": "La mayoría de las CLI de programación modernas leen @ruta como un archivo que abrir. Sin marcar, las rutas se pegan entre comillas.",+ "at_reference_hint": "La mayoría de las CLI de programación modernas leen @ruta como un archivo que abrir. Desactivado, las rutas se pegan entre comillas.","pick_logo": "Elegir un logotipo","remove_logo": "Quitar el logotipo",+ "remove_logo_short": "Quitar",+ "logo_label": "Logotipo","edit_named": "Editar {0}","remove_named": "Quitar {0}","gone": "Esa CLI ya no está en la lista.",