Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/mark/src-tauri/src/actions/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
));

Expand Down Expand Up @@ -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(),
));

Expand Down
7 changes: 7 additions & 0 deletions apps/mark/src-tauri/src/actions/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<i32>,
pub started_at: Option<i64>,
Expand All @@ -39,6 +40,7 @@ pub struct TauriExecutionListener {
branch_id: String,
action_id: String,
action_name: String,
action_type: String,
registry: Arc<ActionRegistry>,
}

Expand All @@ -48,13 +50,15 @@ impl TauriExecutionListener {
branch_id: String,
action_id: String,
action_name: String,
action_type: String,
registry: Arc<ActionRegistry>,
) -> Self {
Self {
app,
branch_id,
action_id,
action_name,
action_type,
registry,
}
}
Expand All @@ -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,
);

Expand All @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions apps/mark/src-tauri/src/actions/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down Expand Up @@ -63,13 +64,15 @@ impl ActionRegistry {
branch_id: String,
action_id: String,
action_name: String,
action_type: String,
started_at: i64,
) {
let info = RunningActionInfo {
execution_id: execution_id.clone(),
branch_id,
action_id,
action_name,
action_type,
started_at,
};

Expand Down
1 change: 1 addition & 0 deletions apps/mark/src-tauri/src/branches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
));

Expand Down
2 changes: 2 additions & 0 deletions apps/mark/src/lib/features/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export interface ActionStatusEvent {
branchId: string;
actionId: string;
actionName: string;
actionType: ActionType;
status: ActionStatus;
exitCode?: number;
startedAt?: number;
Expand All @@ -106,6 +107,7 @@ export interface RunningActionInfo {
branchId: string;
actionId: string;
actionName: string;
actionType: ActionType;
startedAt: number;
}

Expand Down
15 changes: 9 additions & 6 deletions apps/mark/src/lib/features/branches/BranchCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
listenToRunPhaseChanged,
listenToRepoActionsDetection,
type ActionStatusEvent,
type ActionType,
type RunPhase,
} from '../actions/actions';
import { getAvailableOpeners, openInApp, copyPathToClipboard, type OpenerApp } from './branch';
Expand Down Expand Up @@ -324,6 +325,7 @@
executionId: string;
actionId: string;
actionName: string;
actionType: ActionType;
status: 'running' | 'completed' | 'failed' | 'stopped';
exitCode?: number | null;
startedAt?: number;
Expand Down Expand Up @@ -443,6 +445,7 @@
executionId: payload.executionId,
actionId: payload.actionId,
actionName: payload.actionName,
actionType: payload.actionType,
status: 'running',
startedAt: payload.startedAt ?? Date.now(),
});
Expand Down Expand Up @@ -869,6 +872,7 @@
executionId: info.executionId,
actionId: info.actionId,
actionName: info.actionName,
actionType: info.actionType,
status: 'running',
startedAt: info.startedAt,
});
Expand All @@ -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 {
Expand Down Expand Up @@ -1829,7 +1832,7 @@
<Spinner size={12} class="danger" />
{:else if showStopIcon}
<StopCircle size={12} />
{:else if isRunning && phase && phase.type !== 'building'}
{:else if isRunning && phase && phase.type !== 'building' && execution.actionType === 'run'}
<SineWave size={12} />
{:else if isRunning}
<Spinner size={12} />
Expand Down