fp-dotfiles-tui 0.2.5

Minimal premium TUI for fp-dotfiles-manager
# fp-dotfiles-tui

Optional [ratatui](https://ratatui.rs) frontend for **fp-dotfiles-manager**.

This crate is a **Cargo workspace member** of the parent repository
(`fp-dotfiles-manager`). It never reimplements sync or chezmoi logic: every action
shells out to the CLI binary. Command names, summaries, categories, and help text
are defined once in the shared `fp-dotfiles-catalog` crate and consumed here so the
TUI menus cannot drift from `fp-dotfiles-manager --help`.

| Piece | Location |
|---|---|
| This package | `tui/` (`fp-dotfiles-tui`) |
| Shared command catalog | `catalog/` (`fp-dotfiles-catalog`) |
| CLI it drives | workspace root (`fp-dotfiles-manager`) |
| Build output | workspace `target/` (same tree as the CLI) |

## Features

- Category tabs: **Daily · Tracking · Setup · Maintenance**
- Split layout: command list + detail pane (exact CLI invocation preview)
- Argument prompt modal (simple quoted paths supported)
- Confirm dialog for destructive ops (`clean-history`)
- Scrollable output viewer for CLI stdout/stderr
- Interactive commands (`edit`, `cd`, `edit-lists`) leave the alternate screen and use a real TTY
- Theme: **Catppuccin Mocha** (see `src/theme.rs`)
- Size-oriented release profiles from the workspace root (`release-static` + optional UPX)

## Layout (source)

```
tui/
├── Cargo.toml          # workspace member; deps: crossterm, ratatui, fp-dotfiles-catalog
├── README.md
└── src/
    ├── main.rs         # terminal setup, event loop, FP_DOTFILES_MANAGER resolution
    ├── app.rs          # mode machine (menu / prompt / output / confirm / help)
    ├── commands.rs     # re-exports catalog (Category, CommandDef, all_commands)
    ├── theme.rs        # Catppuccin Mocha palette + style helpers
    └── ui.rs           # ratatui widgets / layout
```

There is **no** local `justfile` or `Cargo.lock` under `tui/` — build from the
repository root so the workspace lockfile and `target/` stay unified.

## Requirements

- Rust toolchain (build from the **workspace root**)
- `fp-dotfiles-manager` on `PATH`, or one of:
  - `FP_DOTFILES_MANAGER` (preferred)
  - `DOTFILES_MANAGER_BIN` (legacy alias)
- Optional: `just`, `upx` (for the root release recipes)

## Build & run (from repository root)

All recipes live in the root `justfile`. Binaries land next to the CLI:

```bash
# debug
just build-tui                    # → target/debug/fp-dotfiles-tui
just build-all                    # CLI + TUI

# run (defaults FP_DOTFILES_MANAGER to target/debug/fp-dotfiles-manager)
just run-tui

# release (static LTO + UPX)
just release-tui                  # → target/release-static/fp-dotfiles-tui
just release-all                  # CLI + TUI

# install
just install-tui                  # → ~/.bin/fp-dotfiles-tui
just install-all
```

Equivalent cargo invocations:

```bash
cargo build -p fp-dotfiles-tui
cargo build --profile release-static -p fp-dotfiles-tui
cargo run -p fp-dotfiles-tui

# point at a specific CLI binary
FP_DOTFILES_MANAGER=./target/debug/fp-dotfiles-manager \
  cargo run -p fp-dotfiles-tui
```

GitLab CI builds this package with the rest of the workspace and publishes
`target/release-static/fp-dotfiles-tui` and `target/release/fp-dotfiles-tui`
alongside the CLI artifacts.

## Keys

| Key | Action |
|-----|--------|
| `↑` `↓` / `k` `j` | Move selection |
| `←` `→` / `h` `l` / Tab / Shift-Tab | Switch category |
| `Enter` / `Space` | Run selected command |
| `r` | Run selected (from menu) |
| `1`–`9` | Jump to item |
| `?` | Toggle help |
| `q` / `Esc` | Quit (menu) or close modal / output |
| `Ctrl+C` | Force quit |
| Output view: `PgUp` / `PgDn` / `Home` / `End` | Scroll |

## Theme

Colors follow **[Catppuccin Mocha](https://github.com/catppuccin/catppuccin)**:

| Role | Mocha token | Hex |
|---|---|---|
| Background | base | `#1e1e2e` |
| Surface | mantle | `#181825` |
| Border | surface2 | `#585b70` |
| Focus border / titles | lavender | `#b4befe` |
| Text | text | `#cdd6f4` |
| Muted | overlay1 | `#7f849c` |
| Accent / selection marker | mauve | `#cba6f7` |
| Keybinds | blue | `#89b4fa` |
| Success | green | `#a6e3a1` |
| Warn | peach | `#fab387` |
| Error | red | `#f38ba8` |
| Highlight | surface0 | `#313244` |

Semantic constants and style helpers live in `src/theme.rs`.