Skip to content

feat: Improved the UI for the CLI interface#10

Merged
PrasanthYT merged 1 commit intomainfrom
feature/improving-the-ui-terminal
Mar 2, 2026
Merged

feat: Improved the UI for the CLI interface#10
PrasanthYT merged 1 commit intomainfrom
feature/improving-the-ui-terminal

Conversation

@PrasanthYT
Copy link
Contributor

Overview

This PR introduces a full interactive Terminal UI (TUI) mode for Scanr and refactors the CLI startup behavior to support a dashboard-first experience.

Scanr now launches into an interactive interface by default, shifting from command-first execution to an operational workflow model.

This enhances usability while preserving core functionality and CI compatibility.

Startup Behavior Changes

Previous Behavior

  • scanr auto-triggered scan execution.

New Behavior

  • scanr launches TUI immediately in empty state.
  • Ctrl + S starts scan in background.
  • Loader spinner displayed during active scan.
  • Clear visual status feedback in header.

This improves UX while maintaining deterministic behavior.

New TUI Module

Added

  • tui.rs

Responsibilities

  • Alternate screen lifecycle management
  • Raw mode handling
  • Event loop management (30 FPS)
  • Keyboard input handling
  • Rendering pipeline
  • Popup management
  • Graceful cleanup on exit

Terminal state is restored cleanly after exit.

CLI Wiring Update

Modified

  • main.rs

Changes:

  • Command argument made optional
  • scanr (no subcommand) launches TUI
  • None branch invokes:
tui::run_tui(PathBuf::from("."));

This keeps CLI and interactive mode unified.

Visual Cleanup & UX Improvements

Refined layout to reduce congestion and improve readability:

  • Narrowed left panel width

  • Shortened header hint text

  • Removed focus noise in header

  • Simplified panel titles

  • Reduced table column widths and labels:

    • Sev
    • Vuln
    • Target
    • Break
  • Cleaner empty-state messaging

Improves clarity and reduces visual overload.

Dependency Updates

Updated Cargo.toml:

  • Added:

    • ratatui
    • crossterm

These power rendering and terminal interaction.

Preserved Core Behavior

All existing functionality remains intact:

  • Overview / Dependencies / Recommendations views
  • Arrow navigation
  • Enter → detail popup
  • Esc → back
  • q → quit
  • 30 FPS event loop
  • Resize handling
  • Clean terminal restore

No regression in core logic.

Impact

  • Improves interactive usability
  • Enhances developer workflow experience
  • Maintains CI compatibility
  • Preserves JSON/SARIF modes
  • No breaking changes to existing flags

Validation

  • Manual navigation tested
  • Background scan behavior verified
  • Terminal state restored correctly on exit
  • cargo build --workspace --release passes
  • No panic during lifecycle transitions

Why This Matters

This change transitions Scanr from:

Command execution tool

To:

Interactive operational security dashboard.

It improves real-world usability without sacrificing automation readiness.

@PrasanthYT PrasanthYT merged commit a3da289 into main Mar 2, 2026
3 checks passed
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