发布

  • fix(core): improve TUI task selection and pane focus behavior (#34175)

    frostbyte_neo 发布于 2026-01-21 19:02:43 +00:00

    Current Behavior

    1. When running a task with dependencies (e.g., nx serve app where app
      depends on app2:serve), the initiating task might not be selected on
      startup. Additionally, the auto-select logic could switch selection to
      the initiating task at any time when it started running - even minutes
      later - which felt "random" to the user.

    2. When pressing Enter on an already-pinned task, it would unpin the
      task, causing the pane to disappear while focus remained on it
      (invisible-but-focused state).

    Expected Behavior

    1. The initiating task (the one the user actually requested) should be
      selected during init, and selection should never unexpectedly change
      later when tasks start.

    2. Pressing Enter on an already-pinned task should focus the pane, not
      unpin it.

    Changes

    • Select initiating task during init: Moved initiating task
      selection to init() in app.rs. This only applies in RunOne mode
      since in RunMany there's no single initiating task to prioritize.
      Removed the "switch to initiating task" logic from start_tasks() in
      tasks_list.rs.
    • Focus pane on Enter: Changed behavior so pressing Enter on an
      already-pinned task focuses the pane instead of unpinning it.

    Related Issue(s)

    N/A - discovered during TUI testing

    下载附件