Update CLAUDE.md for skim project

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Shautvast 2026-02-17 21:34:46 +01:00
parent 328a5fa5d2
commit bdb6dce672

View file

@ -4,8 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project Overview ## Project Overview
This is a Rust terminal user interface (TUI) application built with Ratatui. **Skim** is a TUI email client built with Rust and Ratatui. It connects to IMAP servers (including Gmail) and displays inbox messages with a split-pane interface: email list on top, message preview on the bottom.
It will evolve to become a tui mail client
## Build and Run Commands ## Build and Run Commands
@ -44,27 +43,34 @@ docker exec -it mailserver setup email add test@example.com password123
docker-compose down docker-compose down
``` ```
Connection details: localhost:143 (IMAP) or localhost:993 (IMAPS). See `MAIL_SERVER_SETUP.md` for detailed usage. Connection details: localhost:143 (IMAP) or localhost:993 (IMAPS). See `MAIL_SERVER_SETUP.md` for detailed usage including Gmail configuration.
## Architecture ## Architecture
This is a single-file application (`src/main.rs`) following the standard terminal application lifecycle: - **`src/main.rs`** — Terminal setup/teardown, delegates to `lib::main`
- **`src/lib.rs`** — Main event loop, UI rendering, worker thread coordination
- **`src/inbox.rs`** — IMAP inbox operations (refresh, fetch older, fetch body)
- **`src/connect.rs`** — IMAP connection handling (plain TCP and TLS)
- **`src/config.rs`** — Configuration loading from `config.toml`
1. **Terminal Setup**: Enable raw mode and enter alternate screen ### Key patterns
2. **Event Loop**:
- Render UI using Ratatui's declarative widget system - IMAP operations run in a **background worker thread** communicating via `mpsc` channels, keeping the UI responsive
- Poll for keyboard events (200ms timeout) - Emails are loaded in **batches of 50**, with lazy loading when scrolling past the end
- Exit on 'q' or Escape key - **Tab** switches focus between inbox list and preview pane
3. **Cleanup**: Disable raw mode, leave alternate screen, restore cursor - Selection is **preserved across refreshes** by matching IMAP sequence numbers
## Key Dependencies ## Key Dependencies
- **ratatui (0.29)**: TUI framework providing widgets, layouts, and rendering - **ratatui (0.30)**: TUI framework providing widgets, layouts, and rendering
- **crossterm (0.28)**: Cross-platform terminal manipulation (raw mode, events, alternate screen) - **crossterm (0.29)**: Cross-platform terminal manipulation (raw mode, events, alternate screen)
- **imap (2.4)**: IMAP protocol client
- **native-tls (0.2)**: TLS support for secure IMAP connections (Gmail)
- **chrono (0.4)**: Date parsing and timezone conversion
## Development Notes ## Development Notes
- Uses Rust edition 2024 - Uses Rust edition 2024
- The application uses a constraint-based layout system to center content
- Terminal is set to raw mode to capture individual key presses - Terminal is set to raw mode to capture individual key presses
- The alternate screen prevents terminal history pollution - The alternate screen prevents terminal history pollution
- `config.toml` contains credentials and is gitignored — see `config.toml.example` for the format