trackWork 0.9.2

A terminal-based time tracking application for managing work sessions
# trackWork

A console-based time tracking application built with Rust featuring a terminal UI.

## Features

- **Terminal UI**: Clean, intuitive interface built with ratatui
- **Time Entry Management**: Create, edit, delete, and reorder time entries
- **Running Timers**: Start entries without an end time and stop them later
- **Timeline Visualization**: Vertical bar chart of the day's activities
- **Task Management**: Manage issue keys with name and project metadata; tasks are auto-created from time entries
- **Jira Task Name Sync**: Issue summaries are automatically fetched from Jira and displayed alongside entries in a two-row layout
- **Operations Menu**: Bulk operations like syncing all task names from Jira (`m` key)
- **Command Integration**: Configurable commands for logging work and opening issues, with variable substitution (`[[issue_key]]`, `[[description]]`, `[[task_duration]]`, etc.)
- **Weekly Statistics**: Aggregated time tracking by issue or description
- **Clipboard Integration**: Copy durations to clipboard
- **Encrypted Secrets**: API tokens encrypted at rest with AES-256-GCM (passphrase-based, Argon2id key derivation)
- **Persistent Storage**: SQLite database (`~/.timetrack.db`)
- **Configurable**: Colors, date format, and commands via `~/.timetrack.toml`
- **What's New Screen**: Shows changelog on version updates

## Installation

### From crates.io

```bash
cargo install trackWork
```

### Build from source

```bash
cargo build --release
```

The binary will be available at `target/release/trackWork`

## Usage

### Keyboard Shortcuts

#### Normal Mode
- `n` - Create new time entry
- `e` - Edit selected entry
- `d` - Delete selected entry (with confirmation)
- `D` - Force delete (no confirmation)
- `s` - Stop running entry / restart stopped entry
- `t` - Open task management view
- `m` - Open operations menu
- `l` - Log work (run configured command)
- `Shift+L` - Toggle logged status
- `o` - Open issue (run configured command)
- `Shift+S` - Open settings
- `w` - Show changelog
- `↑/↓` - Navigate entries
- `Ctrl+↑/↓` or `Shift+↑/↓` - Reorder entries
- `←/→` - Previous/next day
- `q` - Quit

#### Edit / Create Mode
- Type to enter data in the current field
- `Tab` - Next field (Description → Start Time → End Time → Issue Key)
- `↑/↓` - Increment/decrement time fields, or navigate suggestions (create mode)
- `Enter` - Save
- `Esc` - Cancel

#### Tasks View
- `n` - Create new task
- `e` - Edit selected task
- `d` - Delete selected task
- `↑/↓` - Navigate tasks
- `Tab` - Next field (when editing)
- `Enter` - Save (when editing)
- `Esc` / `q` - Close tasks view

### Command Variables

The log work and open issue commands support these variables:

| Variable | Description |
|----------|-------------|
| `[[issue_key]]` | The entry's issue key |
| `[[description]]` | The entry's description |
| `[[task_duration]]` | Duration in minutes (e.g. `45m`) |
| `[[entry_started]]` | Start time (ISO 8601 or legacy format) |
| `[[entry_ended]]` | End time |

### Time Format

Enter times in 24-hour format: `HH:MM` (e.g., `09:30`, `14:45`). Leave end time empty to create a running timer.

### Data Storage

- **Database**: `~/.timetrack.db` (SQLite)
- **Config**: `~/.timetrack.toml`
- **Secrets**: `~/.timetrack.secrets` (encrypted with AES-256-GCM when passphrase is set, plaintext fallback)

## Project Structure

```
src/
├── main.rs              # Entry point and event loop
├── app.rs               # Application state and input modes
├── models.rs            # Data models (TimeEntry, Task)
├── db.rs                # SQLite schema and time entry queries
├── config.rs            # TOML config management
├── dashboard/           # Main dashboard view
│   ├── input.rs         # Keyboard routing
│   ├── ui.rs            # Layout and rendering
│   ├── top_bar/         # Header bar
│   ├── bottom_bar/      # Footer with keybinding help
│   ├── main_element/    # Entry list and suggestions
│   └── drawers/         # Timeline and weekly stats panels
├── tasks/               # Task management view
│   ├── input.rs         # Task keyboard handler
│   ├── ui.rs            # Task list rendering
│   ├── state.rs         # Task app methods
│   └── db.rs            # Task CRUD queries
├── passphrase/          # Passphrase prompt and change screens
├── settings/            # Settings view
└── whats_new/           # Changelog modal
```

## License

MIT