Skip to content

feat(tui): add automatic pane switching for failed dependencies #32006

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FrozenPandaz
Copy link
Collaborator

Summary

  • Automatically switch pane to failed dependency when task becomes skipped
  • Enhanced dependency view with detailed failure analysis
  • Added graph utilities for dependency failure tracking
  • Improved UX by showing root cause of failures immediately

When a task becomes skipped due to dependency failures, the TUI now automatically switches the pane to show the actual failed task's output instead of a generic "Task was skipped" message. This provides immediate visibility into what went wrong.

Changes Made

Core Feature: Automatic Pane Switching

  • Location: packages/nx/src/native/tui/app.rs
  • Trigger: When update_task_status() detects a task becoming SKIPPED
  • Action: Automatically switches any pane viewing the skipped task to show the failed dependency's terminal output
  • State Management: Updates pane assignment, clears cached states, assigns PTY, and syncs task selection

Enhanced Dependency Analysis

  • Location: packages/nx/src/native/tui/components/dependency_view.rs
  • Feature: Detailed failure analysis for skipped tasks showing:
    • Failed dependencies with error indicators
    • Skipped dependencies in the chain
    • Root cause analysis with impact counts
    • Scrollable interface for large dependency trees

Graph Utilities

  • Location: packages/nx/src/native/tui/graph_utils.rs
  • Functions: get_failed_dependencies(), get_skipped_dependencies(), get_dependency_chain_failures()
  • Purpose: Analyze dependency graphs to identify failure root causes

Test plan

  • Build native module: nx build-native nx --configuration local
  • Test automatic switching: nx echo (should auto-switch to fail-task when echo becomes skipped)
  • Test manual selection: Select already-skipped tasks should show detailed dependency analysis
  • Verify scrolling works for tasks with many dependencies
  • Test edge cases: tasks with no dependencies, circular dependencies, etc.

User Experience

Before

  • User sees generic "Task was skipped" message
  • Must manually navigate to find what actually failed
  • Root cause investigation requires extra steps

After

  • When fail-task fails → echo becomes skipped → pane automatically switches to show fail-task output
  • User immediately sees the actual error that caused the failure
  • Task list selection updates to highlight the failed dependency
  • Manual selection of skipped tasks shows comprehensive failure analysis

Demo

The feature works seamlessly:

  1. User viewing echo task (shows dependency view)
  2. fail-task fails → echo becomes SKIPPED
  3. Automatic switch: Pane immediately shows fail-task terminal output with actual error
  4. User sees root cause without any manual navigation

This dramatically improves the debugging experience when dependent tasks fail.

Fixes #ISSUE_NUMBER

Copy link

vercel bot commented Jul 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jul 22, 2025 6:41pm

Copy link
Contributor

nx-cloud bot commented Jul 21, 2025

View your CI Pipeline Execution ↗ for commit 3974beb

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 27m 30s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 46s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 6s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded 1m 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-22 19:01:49 UTC

When a task becomes skipped due to dependency failures, automatically
switch the pane to show the failed dependency's output instead of
generic skipped message.
Replace hardcoded status icons with centralized function and fix
dependency view border colors to ensure consistent appearance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant