fix(core): preserve task selection when unrelated tasks finish#34328
fix(core): preserve task selection when unrelated tasks finish#34328FrozenPandaz merged 4 commits intomasterfrom
Conversation
handle_standalone_task_finished was unconditionally switching selection whenever any task finished, even if that task wasn't the one the user had selected. Now it checks whether the finished task is the currently selected task before changing selection.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
❌ Deploy Preview for nx-dev failed. Why did it fail? →
|
✅ 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 057655b
☁️ Nx Cloud last updated this comment at |
Co-authored-by: FrozenPandaz <[email protected]>
Co-authored-by: FrozenPandaz <[email protected]>
There was a problem hiding this comment.
✅ The fix from Nx Cloud was applied
These changes correct the test snapshot to match the actual behavior of the task selection preservation feature. The previous snapshot update incorrectly showed lint:check as the first selected task, but the actual code consistently selects format:check first based on task processing order. This fix ensures the test accurately validates that selection is preserved when unrelated tasks finish.
Tip
✅ We verified this fix by re-running nx:test-native.
Suggested Fix changes
diff --git a/packages/nx/src/native/tui/components/snapshots/nx__native__tui__components__tasks_list__tests__multiple_concurrent_batches_mixed_states.snap b/packages/nx/src/native/tui/components/snapshots/nx__native__tui__components__tasks_list__tests__multiple_concurrent_batches_mixed_states.snap
index 1a06873609..60cbb14d80 100644
--- a/packages/nx/src/native/tui/components/snapshots/nx__native__tui__components__tasks_list__tests__multiple_concurrent_batches_mixed_states.snap
+++ b/packages/nx/src/native/tui/components/snapshots/nx__native__tui__components__tasks_list__tests__multiple_concurrent_batches_mixed_states.snap
@@ -5,8 +5,8 @@ expression: terminal.backend()
" "
" NX Running Multiple Concurrent Batches Test... Cache Duration"
" │ "
-">│⠋ lint:check ... <1ms"
-" │⠋ format:check ... <1ms"
+">│⠋ format:check ... <1ms"
+" │⠋ lint:check ... <1ms"
" │⠋ ▼ build-batch (2) "
" │⠋ app:build ... <1ms"
" │⠋ shared:build ... <1ms"
🎓 Learn more about Self-Healing CI on nx.dev
Co-authored-by: FrozenPandaz <[email protected]>
## Current Behavior In the TUI, when any standalone task finishes, `handle_standalone_task_finished` unconditionally switches the user's selection to another in-progress task — even if the finished task wasn't the one the user had selected. This causes the selection to jump unexpectedly while the user is watching a different task. ## Expected Behavior Selection should only change when the task the user is actively viewing finishes. If an unrelated background task finishes, the user's selection should remain on whatever they chose. ## Related Issue(s) N/A — discovered during development testing. --------- Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com> Co-authored-by: FrozenPandaz <[email protected]>
## Current Behavior In the TUI, when any standalone task finishes, `handle_standalone_task_finished` unconditionally switches the user's selection to another in-progress task — even if the finished task wasn't the one the user had selected. This causes the selection to jump unexpectedly while the user is watching a different task. ## Expected Behavior Selection should only change when the task the user is actively viewing finishes. If an unrelated background task finishes, the user's selection should remain on whatever they chose. ## Related Issue(s) N/A — discovered during development testing. --------- Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com> Co-authored-by: FrozenPandaz <[email protected]> (cherry picked from commit efa364f)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
In the TUI, when any standalone task finishes,
handle_standalone_task_finishedunconditionally switches the user's selection to another in-progress task — even if the finished task wasn't the one the user had selected. This causes the selection to jump unexpectedly while the user is watching a different task.Expected Behavior
Selection should only change when the task the user is actively viewing finishes. If an unrelated background task finishes, the user's selection should remain on whatever they chose.
Related Issue(s)
N/A — discovered during development testing.