Skip to content

feat(core): add inline-tui view mode#32718

Merged
AgentEnder merged 1 commit intomasterfrom
inline-tui
Dec 18, 2025
Merged

feat(core): add inline-tui view mode#32718
AgentEnder merged 1 commit intomasterfrom
inline-tui

Conversation

@AgentEnder
Copy link
Copy Markdown
Member

@AgentEnder AgentEnder commented Sep 12, 2025

Current Behavior

When running single tasks we have a "minimal" tui, but that minimal tui still makes it really hard / impossible to use some of the terminals built in features... like:

  • Find (can only find what's currently rendered by tui)
  • Text select + copy (can only select what's rendered to screen, copied text includes the frame around the tui / scrollbar)

Expected Behavior

When running single tasks we can use an inline viewport to render some tui widgets at the bottom of the viewport, and terminal output can be printed above.

Related Issue(s)

Fixes #

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 12, 2025

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

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Dec 18, 2025 11:13pm

@AgentEnder AgentEnder changed the title wip feat(core): add inline-tui view mode Sep 12, 2025
@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Sep 12, 2025

View your CI Pipeline Execution ↗ for commit 24a67fc

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

☁️ Nx Cloud last updated this comment at 2025-12-18 23:18:57 UTC

@AgentEnder AgentEnder changed the title feat(core): add inline-tui view mode feat(core): add inline-tui view mode [wip] Sep 12, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 31, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 24a67fc
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/694489a38100e600086e8c7a
😎 Deploy Preview https://deploy-preview-32718--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[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 6, 2025

Failed to publish a PR release of this pull request, triggered by @AgentEnder.
See the failed workflow run at: https://github.com/nrwl/nx/actions/runs/19142410944

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 4, 2025

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx create-nx-workspace@0.0.0-pr-32718-f806144 my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-32718-f806144
Release details 📑
Published version 0.0.0-pr-32718-f806144
Triggered by @AgentEnder
Branch inline-tui
Commit f806144
Workflow run 19919132270

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

}

/// Get the shared state Arc (for mode switching)
pub fn get_state(&self) -> Arc<Mutex<TuiState>> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove this helper

Comment thread packages/nx/src/native/tui/app.rs Outdated
/// This creates both the state and the app in one call.
/// Prefer using `with_state()` for new code, especially when mode switching is needed.
#[allow(dead_code)]
pub fn new(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove?

Comment thread packages/nx/src/native/tui/lifecycle.rs Outdated
pub fn start_command(&mut self, thread_count: Option<u32>) -> napi::Result<()> {
self.app.lock().start_command(thread_count);

self.app.with_app(|tui_app| {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WHy do we need with_app? rather than like.. self.app.start_command?

Comment thread packages/nx/src/native/tui/lifecycle.rs Outdated
/// tui_app.start_command(None);
/// });
/// ```
fn with_app<F, R>(&self, f: F) -> R
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this is necessary? self.app can be Arc<Mutex>

Comment thread packages/nx/src/native/tui/lifecycle.rs Outdated
if let Err(r) = t.exit() {
debug!("Unable to exit Terminal: {:?}", r);
// Only try to restore terminal if it's still in raw mode
if crossterm::terminal::is_raw_mode_enabled().unwrap_or(false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't check this out here, check it inside of TUi exit

// === Interactive Mode Methods ===

/// Check if the current task can be interactive (has a PTY writer)
fn can_be_interactive(&self) -> bool {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be shareable

Comment thread packages/nx/src/native/tui/inline_app.rs Outdated

if matches!(key.code, KeyCode::F(12)) {
// Toggle debug mode on F12
self.dispatch_action(Action::ToggleDebugMode);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fyi, this doesn't work. but we can follow for it

// start_tasks uses trait default which calls on_tasks_started

// === PTY Registration (hooks for trait defaults) ===

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this could probably be 1 function


// Build left side: NX logo + status icon + task name
let left_spans = vec![
Span::styled(" NX", status_style.add_modifier(Modifier::BOLD)).not_crossed_out(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

THis doesn't seem necessary at the moment

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@FrozenPandaz FrozenPandaz changed the title feat(core): add inline-tui view mode [wip] feat(core): add inline-tui view mode Dec 17, 2025
nx-cloud[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
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.

Important

A new CI pipeline execution was requested that may update the conclusion below...

Nx Cloud has identified a possible root cause for your failed CI:

Our maven-batch-runner:package task failed due to an HTTP 500 error from Maven Central when downloading dependencies. This is unrelated to the TUI changes in this PR - it's a transient external repository issue. The failure should resolve once Maven Central recovers.

No code changes were suggested for this issue.

If the issue was transient, you can trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


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

This adds a new inline TUI mode
alongside the existing full-screen alternate screen mode.

Key changes:
- Add InlineApp for compact inline viewport rendering
- Add TuiApp trait to unify App and InlineApp interfaces
- Add TuiCore for shared functionality between modes
- Add TuiState for shared state management
- Support F11/ESC to switch between inline and full-screen modes
- Add interactive mode support (press 'i' to send input to PTY)
- Add 'c' key to copy terminal output to clipboard
- Add status message support in inline chrome
- Preserve UI state when switching between modes
- Fix terminal restoration and progress indicator handling

The inline mode displays task output in a compact format within the terminal,
with scrollback content pushed above the viewport. This enables better
integration with IDE terminals that don't support alternate screen well.
@AgentEnder AgentEnder merged commit 32783df into master Dec 18, 2025
20 checks passed
@AgentEnder AgentEnder deleted the inline-tui branch December 18, 2025 23:31
@github-actions
Copy link
Copy Markdown
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 Dec 24, 2025
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