-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(core): display batch tasks in the tui #33695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit cf050c9
☁️ Nx Cloud last updated this comment at |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33695-7dbda8d
To request a new release for this pull request, mention someone from the Nx team or the |
7dbda8d to
f4e3d78
Compare
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33695-fe57a5a
To request a new release for this pull request, mention someone from the Nx team or the |
fe57a5a to
e5b8a29
Compare
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-33695-e5b8a29
To request a new release for this pull request, mention someone from the Nx team or the |
e5b8a29 to
5dd5997
Compare
5dd5997 to
0aef931
Compare
aff0d8c to
721c2e9
Compare
1a4bc8b to
52788da
Compare
Replace the SelectionState enum with Option<Selection> for better idiomatic Rust code. This eliminates unnecessary complexity since the enum only had two variants that map directly to Option's Some and None.
Move selection restoration from handle_batch_complete in app.rs into ungroup_batch_tasks in tasks_list.rs. Add find_last_completed_task helper to select task with latest end_time. Add find_batch_group test helper to reduce boilerplate.
- Remove duplicate Selection type, use SelectionEntry directly - Remove PaneSelection and SelectedItemType (unnecessary abstractions) - Consolidate THROBBER_CHARS constant in status_icons.rs - Simplify selection state handling throughout
…o Rust - Add BatchStatus enum to lifecycle.rs with #[napi(string_enum)] - Import BatchInfo and BatchStatus from native in life-cycle.ts - Update set_batch_status to use BatchStatus enum instead of strings - Cleaner match expression instead of string comparisons
- Update StoredBatchState and CompletedBatchInfo to use BatchStatus - Update handle_batch_complete to take BatchStatus directly - Simplify set_batch_status by passing BatchStatus through - Add From<BatchStatus> for TaskStatus conversion for rendering
- Make THROBBER_CHARS private to status_icons module - Add get_batch_status_char function for batch status rendering - Consolidate duplicate imports in tasks_list.rs
686a822 to
facc9a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud is proposing a fix for your failed CI:
These changes fix the Rust compilation errors introduced during the batch task display refactoring. We restore the missing Event import that was accidentally removed, complete the field rename from selected_task to selected_item that was missed in one location, and add the necessary String conversion for the register_pty_instance call.
Tip
✅ We verified this fix by re-running nx:build-native.
Suggested Fix changes
diff --git a/packages/nx/src/native/tui/inline_app.rs b/packages/nx/src/native/tui/inline_app.rs
index f9484b070a..296a2d9f5a 100644
--- a/packages/nx/src/native/tui/inline_app.rs
+++ b/packages/nx/src/native/tui/inline_app.rs
@@ -222,7 +222,7 @@ impl InlineApp {
let mut state = self.core.state().lock();
// Collect task IDs to avoid holding immutable borrow during mutation
- let task_id = self.selected_task.clone();
+ let task_id = self.selected_item.clone();
let task_id = if let Some(task_id) = task_id {
task_id
@@ -247,7 +247,7 @@ impl InlineApp {
// Clone the PTY instance, resize it, and replace the Arc
let mut pty_clone = pty_arc.as_ref().clone();
if let Ok(()) = pty_clone.resize(rows, cols) {
- state.register_pty_instance(task_id, Arc::new(pty_clone));
+ state.register_pty_instance(task_id.to_string(), Arc::new(pty_clone));
}
}
}
diff --git a/packages/nx/src/native/tui/lifecycle.rs b/packages/nx/src/native/tui/lifecycle.rs
index 284aef83db..c372e650b5 100644
--- a/packages/nx/src/native/tui/lifecycle.rs
+++ b/packages/nx/src/native/tui/lifecycle.rs
@@ -22,7 +22,7 @@ use super::components::tasks_list::TaskStatus;
use super::config::{AutoExit, TuiCliArgs as RustTuiCliArgs, TuiConfig as RustTuiConfig};
use super::inline_app::InlineApp;
#[cfg(not(test))]
-use super::tui::Tui;
+use super::tui::{Event, Tui};
use super::tui_app::TuiApp;
use super::tui_state::TuiState;
Or Apply changes locally with:
npx nx-cloud apply-locally Hfpf-tVP6
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
- Change selected_item from Option<String> to Option<SelectionEntry> - Simplify resize_selected_pty to return Option<()> for ? operator - Use is_some_and instead of map_or(false, ...)
- Add set_batch_status implementation to InlineApp to update batch_metadata - Update render_inline_status to check SelectionEntry type for proper status - Add get_selected_item() and get_focused_pane_item() methods returning SelectionEntry - Simplify lifecycle.rs mode switching to use SelectionEntry directly
Adds support for Batch tasks and displays them in the TUI.