Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(core): preserve task selection when unrelated tasks finish#34328

Merged
FrozenPandaz merged 4 commits intomasterfrom
fix-tui-selection
Feb 5, 2026
Merged

fix(core): preserve task selection when unrelated tasks finish#34328
FrozenPandaz merged 4 commits intomasterfrom
fix-tui-selection

Conversation

@FrozenPandaz
Copy link
Collaborator

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.

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.
@FrozenPandaz FrozenPandaz requested review from a team as code owners February 4, 2026 20:18
@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nx-dev Ready Ready Preview Feb 4, 2026 8:28pm

Request Review

@netlify
Copy link

netlify bot commented Feb 4, 2026

Deploy Preview for nx-dev failed. Why did it fail? →

Name Link
🔨 Latest commit 057655b
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6983e1b0f8b0730008e233f0

@netlify
Copy link

netlify bot commented Feb 4, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 057655b
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6983e1b07b79bb000857caed
😎 Deploy Preview https://deploy-preview-34328--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Feb 4, 2026

View your CI Pipeline Execution ↗ for commit 057655b

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 10m 46s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 56s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 10s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx-cloud record -- nx format:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-05 00:33:32 UTC

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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"

Revert fix via Nx Cloud  

View interactive diff ↗

🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz FrozenPandaz merged commit efa364f into master Feb 5, 2026
19 of 23 checks passed
@FrozenPandaz FrozenPandaz deleted the fix-tui-selection branch February 5, 2026 02:23
jaysoo pushed a commit that referenced this pull request Feb 5, 2026
## 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]>
FrozenPandaz added a commit that referenced this pull request Feb 6, 2026
## 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)
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants