> ## Documentation Index
> Fetch the complete documentation index at: https://resq-dependabot-github-actions-github-actions-478e18be3d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Resq tui

**resq\_tui**

# Module: resq\_tui

## Contents

**Modules**

* [`terminal`](#terminal) - Terminal lifecycle helpers — init, restore, and event-loop runner.

**Structs**

* [`Theme`](#theme) - Standard `ResQ` TUI Theme.

**Functions**

* [`centered_rect`](#centered_rect) - Helper to create a centered rectangle for popups.
* [`draw_footer`](#draw_footer) - Renders a standardized footer with keyboard shortcuts.
* [`draw_header`](#draw_header) - Renders a standardized header with service metadata and PID.
* [`draw_popup`](#draw_popup) - Renders a centered popup for help or errors.
* [`draw_tabs`](#draw_tabs) - Renders a standardized tab bar.
* [`format_bytes`](#format_bytes) - Formats bytes into human-readable units.
* [`format_duration`](#format_duration) - Formats seconds into human-readable duration.

**Constants**

* [`SPINNER_FRAMES`](#spinner_frames) - Spinner animation frames for loading indicators.

***

## resq\_tui::SPINNER\_FRAMES

*Constant*: `&[&str]`

Spinner animation frames for loading indicators.

## resq\_tui::Theme

*Struct*

Standard `ResQ` TUI Theme.

**Fields:**

* `primary: ratatui::style::Color` - Primary brand color (Cyan)
* `secondary: ratatui::style::Color` - Secondary supporting color (Blue)
* `accent: ratatui::style::Color` - Accent color for PID/Metadata (Magenta)
* `success: ratatui::style::Color` - Success state (Green)
* `warning: ratatui::style::Color` - Warning/Pending state (Yellow)
* `error: ratatui::style::Color` - Error/Critical state (Red)
* `bg: ratatui::style::Color` - Background color
* `fg: ratatui::style::Color` - Foreground text color
* `highlight: ratatui::style::Color` - Highlight/Selection color
* `inactive: ratatui::style::Color` - Inactive/Muted color (`DarkGray`)

**Trait Implementations:**

* **Default**
  * `fn default() -> Self`

## resq\_tui::centered\_rect

*Function*

Helper to create a centered rectangle for popups.

```rust theme={null}
fn centered_rect(percent_x: u16, percent_y: u16, r: ratatui::layout::Rect) -> ratatui::layout::Rect
```

## resq\_tui::draw\_footer

*Function*

Renders a standardized footer with keyboard shortcuts.

```rust theme={null}
fn draw_footer(frame: & mut ratatui::Frame, area: ratatui::layout::Rect, keys: &[(&str, &str)], theme: &Theme)
```

## resq\_tui::draw\_header

*Function*

Renders a standardized header with service metadata and PID.

```rust theme={null}
fn draw_header(frame: & mut ratatui::Frame, area: ratatui::layout::Rect, title: &str, status: &str, status_color: ratatui::style::Color, pid: Option<i32>, url: &str, theme: &Theme)
```

## resq\_tui::draw\_popup

*Function*

Renders a centered popup for help or errors.

```rust theme={null}
fn draw_popup(frame: & mut ratatui::Frame, area: ratatui::layout::Rect, title: &str, lines: &[ratatui::text::Line], percent_x: u16, percent_y: u16, theme: &Theme)
```

## resq\_tui::draw\_tabs

*Function*

Renders a standardized tab bar.

```rust theme={null}
fn draw_tabs(frame: & mut ratatui::Frame, area: ratatui::layout::Rect, titles: Vec<&str>, selected: usize)
```

## resq\_tui::format\_bytes

*Function*

Formats bytes into human-readable units.

```rust theme={null}
fn format_bytes(bytes: u64) -> String
```

## resq\_tui::format\_duration

*Function*

Formats seconds into human-readable duration.

```rust theme={null}
fn format_duration(seconds: u64) -> String
```

## Module: terminal

Terminal lifecycle helpers — init, restore, and event-loop runner.
