hypersdk

Modern TUI Features

The interactive TUI has been modernized with the latest Bubbletea ecosystem components for a better user experience.

New Components

1. Bubbles Progress Bar

Overall Progress: 3 / 10 VMs (30%)
████████████░░░░░░░░░░░░░░░░░░░░░░░░░░

2. Bubbles Help System

Short help:

💡 ?:toggle help • q:quit

Full help (press ?):

  ↑/k  move up       space  toggle [x]
  ↓/j  move down     enter  confirm

  /  filter          f  features
  s  sort            u  cloud

  esc  back          ?  toggle help
  q    quit

3. Bubbles Key Bindings

4. Modern Styling

Visual Improvements

Export Progress View

Before:

📦 Exporting VMs

3 / 10 VMs completed

✅ vm1 - Completed
✅ vm2 - Completed
⏳ vm3 - Exporting...
⏸  vm4 - Pending

After:

┌──────────────────────────────────────────────────────────────────────────┐
│          🚀 Exporting Virtual Machines                                    │
└──────────────────────────────────────────────────────────────────────────┘

Overall Progress: 3 / 10 VMs (30%)
████████████░░░░░░░░░░░░░░░░░░░░░░░░░░

╭──────────────────────────────────────╮
│ ⏳ Currently Exporting: vm3          │
│    /datacenter/vm/vm3                │
╰──────────────────────────────────────╯

╭────────────────────────────────────────────────────────────────────────╮
│ ✅ vm1                                          Completed               │
│ ✅ vm2                                          Completed               │
│ ⏳ vm3                                          Exporting...            │
│ ⏸️  vm4                                          Pending                 │
│ ⏸️  vm5                                          Pending                 │
╰────────────────────────────────────────────────────────────────────────╯

💡 q:quit | Export in progress...

Help Integration

Modern short help (shown by default):

Modern full help (press ?):

Color Scheme

Modern semantic colors:

Layout Enhancements

  1. Bordered boxes with rounded corners
  2. Proper spacing and padding
  3. Responsive widths
  4. Aligned elements
  5. Visual hierarchy

New Keyboard Shortcuts

Global Keys

Actions

Technical Details

Dependencies Added

github.com/charmbracelet/bubbles/progress
github.com/charmbracelet/bubbles/help
github.com/charmbracelet/bubbles/key

Component Initialization

// Progress bar with gradient
prog := progress.New(
    progress.WithDefaultGradient(),
    progress.WithWidth(40),
)

// Help with custom styles
h := help.New()
h.Styles.ShortKey = lipgloss.NewStyle().Foreground(primaryColor)
h.Styles.ShortDesc = lipgloss.NewStyle().Foreground(mutedColor)

// Key bindings
keys := tuiKeyMap{
    Up: key.NewBinding(
        key.WithKeys("up", "k"),
        key.WithHelp("↑/k", "move up"),
    ),
    // ...
}

Usage in Views

// Render progress bar
progressBar := m.progressBar.ViewAs(percent)

// Render short help
shortHelp := m.helpModel.ShortHelpView(m.keys.ShortHelp())

// Render full help
fullHelp := m.helpModel.FullHelpView(m.keys.FullHelp())

Performance

All modern components are:

Accessibility

Migration Guide

For Users

No changes required! The TUI works the same way, just looks better.

For Developers

If extending the TUI:

  1. Use the help component for new keybindings:
    newKey := key.NewBinding(
     key.WithKeys("x"),
     key.WithHelp("x", "do something"),
    )
    
  2. Use progress bars for long operations:
    percent := float64(current) / float64(total)
    progressBar := m.progressBar.ViewAs(percent)
    
  3. Follow the color scheme:
    title := lipgloss.NewStyle().
     Foreground(primaryColor).
     Bold(true).
     Render("Title")
    

Future Enhancements

Planned improvements:

Comparison

Feature Old TUI Modern TUI
Progress Text percentage Gradient progress bar
Help Static text Interactive help component
Keys Hardcoded Bubbles key bindings
Colors Basic ANSI Lipgloss styled
Borders ASCII Rounded unicode
Layout Manual spacing Lipgloss layout
State Custom logic Bubbles managed

Examples

Running the Modern TUI

# Launch interactive mode with modern UI
hyperexport -interactive

# Or use the alias
hyperexport -tui

Key Features Demo

  1. Select VMs - Use / and Space to toggle checkboxes
  2. View help - Press ? to see all keybindings
  3. Export - Modern progress bar shows live progress
  4. Filter - Press / for smart filtering

Browser-like Experience

The modern TUI provides a terminal UI that feels like a modern web app:

Perfect for both casual users and power users who live in the terminal!