hypersdk

Default TUI UX Improvements

This document describes the enhancements made to the default interactive TUI (simple VM selector).

Overview

The default TUI is shown when you run hyperexport without specifying a VM name. It has been completely redesigned with a modern, polished user experience.

What Changed

Before

Select a VM to export [type to search]:
  vm1
  vm2
  vm3
> vm4

After

 ██   ██ ██    ██ ██████  ███████ ██████
 ██   ██  ██  ██  ██   ██ ██      ██   ██
 ███████   ████   ██████  █████   ██████
 ██   ██    ██    ██      ██      ██   ██
 ██   ██    ██    ██      ███████ ██   ██

 ███████ ██   ██ ██████   ██████  ██████  ████████
 ██       ██ ██  ██   ██ ██    ██ ██   ██    ██
 █████     ███   ██████  ██    ██ ██████     ██
 ██       ██ ██  ██      ██    ██ ██   ██    ██
 ███████ ██   ██ ██       ██████  ██   ██    ██

┌─ VM Selection ────────────────────────────────┐
│ Found 201 virtual machines                    │
│                                                │
│ 💡 Use ↑/↓ arrows to navigate                 │
│ 💡 Press / to search and filter               │
│ 💡 Press Enter to select                      │
│ 💡 Press Ctrl+C to cancel                     │
└────────────────────────────────────────────────┘

━━━━━━━━━━━━━━━━━ Select VM to Export ━━━━━━━━━━━━━━━━━

Select a VM to export [type to search]:
  esx8.0-rhel9.5-x86_64
  esx8.0-sles11sp4-x86_64
  esx8.0-ubuntu22.04.5
> esx8.0-win10-x86_64-efi
  esx8.0-win2022-x86_64

 ✔ SELECTED: esx8.0-win10-x86_64-efi

Key Improvements

1. Screen Clearing

2. Branded Header

3. Instructional Box

4. Sorted VM List

5. Enhanced Selection Prompt

6. Better Search UX

7. Success Confirmation

8. Enhanced VM Info Display

Before:

┌────────────────────────────────┐
│ Property    │ Value            │
├─────────────┼──────────────────┤
│ Name        │ my-vm            │
│ Power State │ poweredOn        │
│ Guest OS    │ Ubuntu Linux     │
└────────────────────────────────┘

After:

━━━━━━━━━━━━━ 📋 Virtual Machine Details ━━━━━━━━━━━━━

┌──────────────────┬─────────────────────────────────┐
│ Property         │ Value                           │
├──────────────────┼─────────────────────────────────┤
│ 🖥️  VM Name      │ my-vm                           │
│ ⚡ Power State   │ 🟢 poweredOn                    │
│ 💿 Guest OS      │ Ubuntu Linux (64-bit)           │
│ 🧠 Memory        │ 16384 MB (16.0 GB)              │
│ ⚙️  vCPUs        │ 8                               │
│ 💾 Storage       │ 512.0 GB                        │
│ 📁 Path          │ /datacenter/vm/my-vm            │
└──────────────────┴─────────────────────────────────┘

Features:

9. Enhanced Export Summary

Before:

Export Summary
┌────────────┬───────────┐
│ Metric     │ Value     │
├────────────┼───────────┤
│ Duration   │ 5m30s     │
└────────────┴───────────┘

After:

 ███████ ██    ██  ██████  ██████ ███████ ███████ ███████
 ██      ██    ██ ██      ██      ██      ██      ██
 ███████ ██    ██ ██      ██      █████   ███████ ███████
      ██ ██    ██ ██      ██      ██           ██      ██
 ███████  ██████   ██████  ██████ ███████ ███████ ███████

━━━━━━━━━━━━━━━━━ ✅ Export Summary ━━━━━━━━━━━━━━━━━

┌──────────────────┬──────────────────────────────────┐
│ Metric           │ Value                            │
├──────────────────┼──────────────────────────────────┤
│ 🖥️  VM Name      │ my-vm                            │
│ ⏱️  Duration     │ 5m30s                            │
│ 💾 Total Size    │ 512.0 GB                         │
│ ⚡ Avg Speed     │ 156.4 MB/s                       │
│ 📦 Files Exported│ 4                                │
│ 📁 Output Dir    │ /exports/my-vm                   │
│ 📋 Manifest      │ /exports/my-vm/manifest.json     │
└──────────────────┴──────────────────────────────────┘

Features:

User Experience Benefits

1. Professional Appearance

2. Better Discoverability

3. Easier Navigation

4. Reduced Cognitive Load

5. Faster Workflow

6. More Information

Technical Details

Colors Used

Icons

Layout Principles

  1. Top-down flow
  2. Generous whitespace
  3. Visual hierarchy (big headers → content → details)
  4. Consistent spacing
  5. Box-drawing for structure

Code Changes

Modified Functions

  1. selectVMInteractive()
    • Added screen clearing
    • Added big text branding
    • Added instruction box
    • Implemented alphabetical sorting
    • Enhanced selection confirmation
  2. displayVMInfo()
    • Added header bar
    • Added icons for properties
    • Enhanced table formatting
    • Added full VM path
  3. showExportSummary()
    • Added “SUCCESS” banner
    • Added speed calculation
    • Added icons for metrics
    • Color-coded values
    • Enhanced layout

Usage

The enhanced TUI appears automatically when you run:

hyperexport
# or
hyperexport --provider vsphere

For the advanced multi-select TUI, use:

hyperexport -interactive
# or
hyperexport -tui

Compatibility