@elaraai/e3-ui-cli 1.0.73 → 1.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,12 +10,22 @@
10
10
  * failed task's logs. Status detail is inline (`✗ failed · exit 2`,
11
11
  * `◐ waiting`, `◔ in-progress`).
12
12
  *
13
+ * The column is built in two steps. {@link dashboardModel} derives what
14
+ * follows from the data and the width — the counts, the events the panel
15
+ * lists, the latest event per task, the dataset map, the fitted table
16
+ * plans, each row's cells and where each selectable row sits — once per
17
+ * data change: a single-entry cache keyed on the identity of the status,
18
+ * the execution, the dataset list, the task list, the width and the
19
+ * breakpoint. {@link dashboardLines} then renders only the lines on
20
+ * screen, restyling the selected row and stamping the clock and the
21
+ * spinner. A selection move costs the window, not the workspace.
22
+ *
13
23
  * @packageDocumentation
14
24
  */
15
25
  import type { DataflowEvent, WorkspaceStatusResult } from '@elaraai/e3-api-client';
16
26
  import type { Glyphs } from '../../render/glyphs.js';
17
- import { type Breakpoint } from '../../render/layout.js';
18
- import type { NavOp, TuiState } from '../../state/actions.js';
27
+ import { type Breakpoint, type ColumnSpec } from '../../render/layout.js';
28
+ import type { ExecutionData, NavOp, TuiState } from '../../state/actions.js';
19
29
  import { type Controller } from '../../controller.js';
20
30
  import type { Hit, Pane } from '../frame.js';
21
31
  import { type Line, type RenderCtx } from '../lines.js';
@@ -35,11 +45,6 @@ export interface DashboardRow {
35
45
  name: string;
36
46
  line: number;
37
47
  }
38
- /** The column under the title: its lines and the selectable rows. */
39
- export interface DashboardColumn {
40
- lines: Line[];
41
- rows: DashboardRow[];
42
- }
43
48
  /** Event rows the execution panel shows at most. */
44
49
  export declare const MAX_EVENT_ROWS = 6;
45
50
  /**
@@ -74,36 +79,86 @@ export declare function accountedBar(tasks: readonly TaskInfo[], g: Glyphs): {
74
79
  * @returns One event per task
75
80
  */
76
81
  export declare function latestPerTask(events: readonly DataflowEvent[]): DataflowEvent[];
82
+ /** A task's row: the cells that follow from the data, and what the `SIZE · LAST RUN` cell is stamped from per frame. */
83
+ export interface TaskRowModel {
84
+ task: TaskInfo;
85
+ /** The cells the data decides (`size` is stamped at render — it carries the clock and the spinner while the task runs). */
86
+ cells: TableRow['cells'];
87
+ /** The output's size text (`12.1 MB` / `—`). */
88
+ size: string;
89
+ /** The task's latest dataflow event, if any. */
90
+ event: DataflowEvent | undefined;
91
+ }
77
92
  /**
78
- * The tasks table rows.
93
+ * The data-derived column: everything that follows from the workspace's
94
+ * data and the terminal width. Built by {@link dashboardModel}, rendered
95
+ * by {@link dashboardLines}.
79
96
  *
80
- * @param state - The store state
81
- * @param ws - The workspace
82
- * @param status - Its status
83
- * @param dctx - The dashboard context
84
- * @returns The rows, in the status order
97
+ * @property status - The status the model follows (undefined → `placeholder` is the whole column)
98
+ * @property placeholder - The column while there is no status: nothing deployed, an error, or loading
99
+ * @property counts - The counts block (the two stat groups and the accounted bar)
100
+ * @property execution - The execution the panel shows
101
+ * @property live - Whether the panel shows the live feed
102
+ * @property done - Events past `start` (the live feed's `N of M tasks`)
103
+ * @property events - The events the panel lists: the latest per task — the last ones while live, the failures after
104
+ * @property latest - The latest event per task
105
+ * @property taskPlan - The tasks table's fitted column plan
106
+ * @property tasks - The task rows
107
+ * @property inputPlan - The inputs table's fitted column plan
108
+ * @property inputs - The input rows
109
+ * @property inputNames - The input names, in row order
110
+ * @property rows - The selectable rows in column order (failures, tasks, inputs) with their line indices
111
+ * @property total - Lines in the column
112
+ * @property panelAt - The execution panel's first line
113
+ * @property tasksAt - The TASKS section line (the header follows, then the rows)
114
+ * @property inputsAt - The INPUTS section line
85
115
  */
86
- export declare function taskRows(state: TuiState, ws: string, status: WorkspaceStatusResult, dctx: DashboardCtx): TableRow[];
116
+ export interface DashboardModel {
117
+ status: WorkspaceStatusResult | undefined;
118
+ placeholder: Line[];
119
+ counts: Line[];
120
+ execution: ExecutionData | undefined;
121
+ live: boolean;
122
+ done: number;
123
+ events: DataflowEvent[];
124
+ latest: ReadonlyMap<string, DataflowEvent>;
125
+ taskPlan: ColumnSpec[];
126
+ tasks: TaskRowModel[];
127
+ inputPlan: ColumnSpec[];
128
+ inputs: TableRow[];
129
+ inputNames: string[];
130
+ rows: DashboardRow[];
131
+ total: number;
132
+ panelAt: number;
133
+ tasksAt: number;
134
+ inputsAt: number;
135
+ }
87
136
  /**
88
- * The inputs table rows (`.inputs.*` datasets that no task produces).
137
+ * The dashboard model for a workspace built once per data change and
138
+ * returned as the same object until the status, the execution, the
139
+ * dataset list, the task list, the width or the breakpoint changes. The
140
+ * clock, the spinner and the selection are not inputs: they restyle lines
141
+ * at render ({@link dashboardLines}).
89
142
  *
90
143
  * @param state - The store state
91
144
  * @param ws - The workspace
92
- * @param status - Its status
93
- * @param dctx - The dashboard context
94
- * @returns The rows, in the status order
145
+ * @param dctx - The dashboard context (its width and breakpoint key the cache)
146
+ * @returns The model
95
147
  */
96
- export declare function inputRows(state: TuiState, ws: string, status: WorkspaceStatusResult, dctx: DashboardCtx): TableRow[];
148
+ export declare function dashboardModel(state: TuiState, ws: string, dctx: DashboardCtx): DashboardModel;
97
149
  /**
98
- * Builds the column under the title.
150
+ * The column's lines in `[top, top + visible)` — the window the screen
151
+ * shows, rendered from the model with the selected row restyled and the
152
+ * clock and the spinner stamped in.
99
153
  *
100
- * @param state - The store state
101
- * @param ws - The workspace
154
+ * @param model - The dashboard model
102
155
  * @param dctx - The dashboard context
103
156
  * @param sel - The selected row index
104
- * @returns The lines and the selectable rows
157
+ * @param top - The first line
158
+ * @param visible - Lines in the window
159
+ * @returns The lines (fewer when the column ends first)
105
160
  */
106
- export declare function dashboardColumn(state: TuiState, ws: string, dctx: DashboardCtx, sel: number): DashboardColumn;
161
+ export declare function dashboardLines(model: DashboardModel, dctx: DashboardCtx, sel: number, top: number, visible: number): Line[];
107
162
  /**
108
163
  * The dashboard body: the fixed title, then the column window with its
109
164
  * scrollbar — plus the window's clickable rows and pane for the mouse.
@@ -1 +1 @@
1
- {"version":3,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