diff --git a/desktop/src-tauri/src/commands/identity.rs b/desktop/src-tauri/src/commands/identity.rs index 7c8cbc0be4..1940ae1d0a 100644 --- a/desktop/src-tauri/src/commands/identity.rs +++ b/desktop/src-tauri/src/commands/identity.rs @@ -1,7 +1,11 @@ use nostr::{EventBuilder, JsonUtil, Kind, Tag, ToBech32}; use tauri::State; -use crate::{app_state::AppState, models::IdentityInfo, relay::relay_ws_url}; +use crate::{ + app_state::AppState, + models::IdentityInfo, + relay::{relay_api_base_url, relay_ws_url}, +}; #[tauri::command] pub fn get_identity(state: State<'_, AppState>) -> Result { @@ -28,6 +32,11 @@ pub fn get_relay_ws_url() -> String { relay_ws_url() } +#[tauri::command] +pub fn get_relay_http_url() -> String { + relay_api_base_url() +} + #[tauri::command] pub fn sign_event( kind: u16, diff --git a/desktop/src-tauri/src/lib.rs b/desktop/src-tauri/src/lib.rs index de99ddc8fb..9560e7115a 100644 --- a/desktop/src-tauri/src/lib.rs +++ b/desktop/src-tauri/src/lib.rs @@ -345,6 +345,7 @@ pub fn run() { get_presence, set_presence, get_relay_ws_url, + get_relay_http_url, discover_acp_providers, discover_managed_agent_prereqs, sign_event, diff --git a/desktop/src/features/workflows/ui/WorkflowCard.tsx b/desktop/src/features/workflows/ui/WorkflowCard.tsx index e362f372a1..5ad3ad4033 100644 --- a/desktop/src/features/workflows/ui/WorkflowCard.tsx +++ b/desktop/src/features/workflows/ui/WorkflowCard.tsx @@ -16,6 +16,11 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@/shared/ui/dropdown-menu"; +import { + getWorkflowDescription, + getWorkflowDisplayStatus, + getWorkflowTriggerSummary, +} from "./workflowDefinition"; type WorkflowCardProps = { workflow: Workflow; @@ -52,6 +57,10 @@ export function WorkflowCard({ onDuplicate, onDelete, }: WorkflowCardProps) { + const displayStatus = getWorkflowDisplayStatus(workflow); + const description = getWorkflowDescription(workflow.definition); + const triggerSummary = getWorkflowTriggerSummary(workflow.definition); + return (
{workflow.name} - +
{channelName ? {channelName} : null} + {triggerSummary ? {triggerSummary} : null} {new Date(workflow.updatedAt * 1000).toLocaleDateString()}
+ {description ? ( +

+ {description} +

+ ) : null} diff --git a/desktop/src/features/workflows/ui/WorkflowDetailPanel.tsx b/desktop/src/features/workflows/ui/WorkflowDetailPanel.tsx index ac06833b03..5f9a461809 100644 --- a/desktop/src/features/workflows/ui/WorkflowDetailPanel.tsx +++ b/desktop/src/features/workflows/ui/WorkflowDetailPanel.tsx @@ -10,6 +10,11 @@ import { import { WorkflowRunTrace } from "@/features/workflows/ui/WorkflowRunTrace"; import type { Workflow } from "@/shared/api/types"; import { Button } from "@/shared/ui/button"; +import { + getWorkflowDescription, + getWorkflowDisplayStatus, + getWorkflowTriggerSummary, +} from "./workflowDefinition"; type WorkflowDetailPanelProps = { workflowId: string; @@ -33,6 +38,13 @@ export function WorkflowDetailPanel({ ? (runs.find((r) => r.id === selectedRunId) ?? null) : null; const approvalsQuery = useRunApprovalsQuery(workflowId, selectedRunId); + const workflowDescription = workflow + ? getWorkflowDescription(workflow.definition) + : null; + const triggerSummary = workflow + ? getWorkflowTriggerSummary(workflow.definition) + : null; + const workflowStatus = workflow ? getWorkflowDisplayStatus(workflow) : null; async function handleTrigger() { try { @@ -49,9 +61,24 @@ export function WorkflowDetailPanel({ data-testid="workflow-detail-panel" >
-

- {workflow?.name ?? "Loading..."} -

+
+
+

+ {workflow?.name ?? "Loading..."} +

+ {workflowStatus ? : null} +
+ {workflowDescription ? ( +

+ {workflowDescription} +

+ ) : null} + {triggerSummary ? ( +

+ {triggerSummary} +

+ ) : null} +
{workflow ? ( -
+ +
+ + +
+ + + + {savedWebhookInfo ? ( + { + if (!nextOpen) { + setSavedWebhookInfo(null); } - onClick={handleSubmit} - type="button" - > - {mutation.isPending ? PENDING_LABELS[mode] : SUBMIT_LABELS[mode]} - -
- - + }} + open + relayHttpUrl={savedWebhookInfo.relayHttpUrl} + webhookSecret={savedWebhookInfo.webhookSecret} + workflowId={savedWebhookInfo.workflowId} + /> + ) : null} + ); } diff --git a/desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx b/desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx index 0f9bd1da50..f2e947402f 100644 --- a/desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx +++ b/desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx @@ -2,6 +2,7 @@ import { Code, Plus } from "lucide-react"; import * as React from "react"; import { Button } from "@/shared/ui/button"; +import { Checkbox } from "@/shared/ui/checkbox"; import { Input } from "@/shared/ui/input"; import { Textarea } from "@/shared/ui/textarea"; import { WorkflowStepCard } from "./WorkflowStepCard"; @@ -34,6 +35,7 @@ function TriggerConfigFields({ }) { switch (trigger.on) { case "message_posted": + case "diff_posted": return (
@@ -49,7 +51,7 @@ function TriggerConfigFields({ value={trigger.filter ?? ""} />

- Evalexpr filter — leave empty to trigger on all messages. + Evalexpr filter — leave empty to trigger on all matching events.

); @@ -257,6 +259,42 @@ export function WorkflowFormBuilder({ /> +
+ + Description (optional) + +