Skip to content

Commit 30abc3f

Browse files
feat(core): display batch tasks in the tui (#33695)
Adds support for Batch tasks and displays them in the TUI. --------- Co-authored-by: FrozenPandaz <[email protected]> (cherry picked from commit a15881d)
1 parent f872ebd commit 30abc3f

69 files changed

Lines changed: 5318 additions & 1412 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/nx/src/native/index.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export declare class AppLifeCycle {
2323
registerForcedShutdownCallback(forcedShutdownCallback: () => any): void
2424
__setCloudMessage(message: string): Promise<void>
2525
setEstimatedTaskTimings(timings: Record<string, number>): void
26+
registerRunningBatch(batchId: string, batchInfo: BatchInfo): void
27+
appendBatchOutput(batchId: string, output: string): void
28+
setBatchStatus(batchId: string, status: BatchStatus): void
2629
}
2730

2831
export declare class ChildProcess {
@@ -193,6 +196,17 @@ export declare class WorkspaceContext {
193196
getFilesInDirectory(directory: string): Array<string>
194197
}
195198

199+
export interface BatchInfo {
200+
executorName: string
201+
taskIds: Array<string>
202+
}
203+
204+
export declare const enum BatchStatus {
205+
Running = 'Running',
206+
Success = 'Success',
207+
Failure = 'Failure'
208+
}
209+
196210
export interface CachedResult {
197211
code: number
198212
terminalOutput?: string

packages/nx/src/native/native-bindings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ module.exports.TaskDetails = nativeBinding.TaskDetails
378378
module.exports.TaskHasher = nativeBinding.TaskHasher
379379
module.exports.Watcher = nativeBinding.Watcher
380380
module.exports.WorkspaceContext = nativeBinding.WorkspaceContext
381+
module.exports.BatchStatus = nativeBinding.BatchStatus
381382
module.exports.canInstallNxConsole = nativeBinding.canInstallNxConsole
382383
module.exports.canInstallNxConsoleForEditor = nativeBinding.canInstallNxConsoleForEditor
383384
module.exports.closeDbConnection = nativeBinding.closeDbConnection

packages/nx/src/native/tui/action.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
use crate::native::tasks::types::{Task, TaskResult};
22

3-
use super::{app::Focus, components::tasks_list::TaskStatus, lifecycle::TuiMode};
3+
use super::{
4+
app::Focus,
5+
components::{task_selection_manager::SelectionEntry, tasks_list::TaskStatus},
6+
lifecycle::{BatchInfo, TuiMode},
7+
};
48

59
#[derive(Debug, Clone, PartialEq, Eq)]
610
pub enum Action {
@@ -17,8 +21,8 @@ pub enum Action {
1721
RemoveFilterChar,
1822
ScrollUp,
1923
ScrollDown,
20-
PinTask(String, usize),
21-
UnpinTask(String, usize),
24+
PinSelection(SelectionEntry, usize),
25+
UnpinSelection(usize),
2226
UnpinAllTasks,
2327
SortTasks,
2428
NextTask,
@@ -38,4 +42,7 @@ pub enum Action {
3842
EndCommand,
3943
ShowHint(String),
4044
SwitchMode(TuiMode),
45+
StartBatch(String, BatchInfo),
46+
ExpandBatch(String),
47+
CollapseBatch(String),
4148
}

0 commit comments

Comments
 (0)