diff --git a/apps/mark/src-tauri/src/actions/commands.rs b/apps/mark/src-tauri/src/actions/commands.rs index 4430cf1b..bb4cbe61 100644 --- a/apps/mark/src-tauri/src/actions/commands.rs +++ b/apps/mark/src-tauri/src/actions/commands.rs @@ -191,6 +191,7 @@ pub async fn run_branch_action( branch_id.clone(), action_id.clone(), action.name.clone(), + action.action_type.as_str().to_string(), reg.clone(), )); @@ -603,6 +604,7 @@ pub async fn run_prerun_actions( branch_id.clone(), action.id.clone(), action.name.clone(), + action.action_type.as_str().to_string(), registry.inner().clone(), )); diff --git a/apps/mark/src-tauri/src/actions/events.rs b/apps/mark/src-tauri/src/actions/events.rs index 58601adb..bb3758c0 100644 --- a/apps/mark/src-tauri/src/actions/events.rs +++ b/apps/mark/src-tauri/src/actions/events.rs @@ -27,6 +27,7 @@ pub struct ActionStatusEvent { pub branch_id: String, pub action_id: String, pub action_name: String, + pub action_type: String, pub status: String, // "running", "completed", "failed", "stopped" pub exit_code: Option, pub started_at: Option, @@ -39,6 +40,7 @@ pub struct TauriExecutionListener { branch_id: String, action_id: String, action_name: String, + action_type: String, registry: Arc, } @@ -48,6 +50,7 @@ impl TauriExecutionListener { branch_id: String, action_id: String, action_name: String, + action_type: String, registry: Arc, ) -> Self { Self { @@ -55,6 +58,7 @@ impl TauriExecutionListener { branch_id, action_id, action_name, + action_type, registry, } } @@ -74,6 +78,7 @@ impl ExecutionListener for TauriExecutionListener { self.branch_id.clone(), self.action_id.clone(), self.action_name.clone(), + self.action_type.clone(), started_at, ); @@ -85,6 +90,7 @@ impl ExecutionListener for TauriExecutionListener { branch_id: self.branch_id.clone(), action_id: self.action_id.clone(), action_name: self.action_name.clone(), + action_type: self.action_type.clone(), status: "running".to_string(), exit_code: None, started_at: Some(started_at), @@ -138,6 +144,7 @@ impl ExecutionListener for TauriExecutionListener { branch_id: self.branch_id.clone(), action_id: self.action_id.clone(), action_name: self.action_name.clone(), + action_type: self.action_type.clone(), status: status_str.to_string(), exit_code, started_at, diff --git a/apps/mark/src-tauri/src/actions/registry.rs b/apps/mark/src-tauri/src/actions/registry.rs index cd08aae0..a84ff692 100644 --- a/apps/mark/src-tauri/src/actions/registry.rs +++ b/apps/mark/src-tauri/src/actions/registry.rs @@ -17,6 +17,7 @@ pub struct RunningActionInfo { pub branch_id: String, pub action_id: String, pub action_name: String, + pub action_type: String, pub started_at: i64, } @@ -63,6 +64,7 @@ impl ActionRegistry { branch_id: String, action_id: String, action_name: String, + action_type: String, started_at: i64, ) { let info = RunningActionInfo { @@ -70,6 +72,7 @@ impl ActionRegistry { branch_id, action_id, action_name, + action_type, started_at, }; diff --git a/apps/mark/src-tauri/src/branches.rs b/apps/mark/src-tauri/src/branches.rs index f223e8b7..6945c663 100644 --- a/apps/mark/src-tauri/src/branches.rs +++ b/apps/mark/src-tauri/src/branches.rs @@ -1744,6 +1744,7 @@ pub(crate) async fn run_prerun_actions_for_branch( branch_id.to_string(), action.id.clone(), action.name.clone(), + action.action_type.as_str().to_string(), Arc::clone(act_registry), )); diff --git a/apps/mark/src/lib/features/actions/actions.ts b/apps/mark/src/lib/features/actions/actions.ts index 1a20aaab..3c0b0f74 100644 --- a/apps/mark/src/lib/features/actions/actions.ts +++ b/apps/mark/src/lib/features/actions/actions.ts @@ -80,6 +80,7 @@ export interface ActionStatusEvent { branchId: string; actionId: string; actionName: string; + actionType: ActionType; status: ActionStatus; exitCode?: number; startedAt?: number; @@ -106,6 +107,7 @@ export interface RunningActionInfo { branchId: string; actionId: string; actionName: string; + actionType: ActionType; startedAt: number; } diff --git a/apps/mark/src/lib/features/branches/BranchCard.svelte b/apps/mark/src/lib/features/branches/BranchCard.svelte index cc46ca39..92c6ad91 100644 --- a/apps/mark/src/lib/features/branches/BranchCard.svelte +++ b/apps/mark/src/lib/features/branches/BranchCard.svelte @@ -71,6 +71,7 @@ listenToRunPhaseChanged, listenToRepoActionsDetection, type ActionStatusEvent, + type ActionType, type RunPhase, } from '../actions/actions'; import { getAvailableOpeners, openInApp, copyPathToClipboard, type OpenerApp } from './branch'; @@ -324,6 +325,7 @@ executionId: string; actionId: string; actionName: string; + actionType: ActionType; status: 'running' | 'completed' | 'failed' | 'stopped'; exitCode?: number | null; startedAt?: number; @@ -443,6 +445,7 @@ executionId: payload.executionId, actionId: payload.actionId, actionName: payload.actionName, + actionType: payload.actionType, status: 'running', startedAt: payload.startedAt ?? Date.now(), }); @@ -869,6 +872,7 @@ executionId: info.executionId, actionId: info.actionId, actionName: info.actionName, + actionType: info.actionType, status: 'running', startedAt: info.startedAt, }); @@ -882,11 +886,10 @@ const phase = await getRunPhase(info.executionId); if (phase) { runPhases.set(info.executionId, phase); - } else { - // No persisted phase — the action is running but detection state - // was lost (app restart). Default to Running with no endpoint so - // the sine wave is shown. This is safe for non-Run actions too - // since phases are only rendered for Run-type action buttons. + } else if (info.actionType === 'run') { + // No persisted phase — the run action is running but detection + // state was lost (app restart). Default to Running with no + // endpoint so the sine wave is shown. runPhases.set(info.executionId, { type: 'running', endpoint: null }); } } catch { @@ -1829,7 +1832,7 @@ {:else if showStopIcon} - {:else if isRunning && phase && phase.type !== 'building'} + {:else if isRunning && phase && phase.type !== 'building' && execution.actionType === 'run'} {:else if isRunning}