Add built-in theme support with various pre-defined themes
Some checks failed
ci/someci/tag/woodpecker/5 Pipeline is pending
ci/someci/tag/woodpecker/6 Pipeline is pending
ci/someci/tag/woodpecker/7 Pipeline is pending
ci/someci/tag/woodpecker/1 Pipeline failed
ci/someci/tag/woodpecker/2 Pipeline failed
ci/someci/tag/woodpecker/3 Pipeline failed
ci/someci/tag/woodpecker/4 Pipeline failed

- Introduce multiple built-in themes (`default_dark`, `default_light`, `gruvbox`, `dracula`, `solarized`, `midnight-ocean`, `rose-pine`, `monokai`, `material-dark`, `material-light`).
- Implement theming system with customizable color schemes for all UI components in the TUI.
- Include documentation for themes in `themes/README.md`.
- Add fallback mechanisms for default themes in case of parsing errors.
- Support custom themes with overrides via configuration.
This commit is contained in:
2025-10-03 07:44:11 +02:00
parent 6a3f44f911
commit 96e2482782
24 changed files with 1740 additions and 247 deletions

View File

@@ -3,13 +3,13 @@
> Terminal-native assistant for running local language models with a comfortable TUI.
![Status](https://img.shields.io/badge/status-alpha-yellow)
![Version](https://img.shields.io/badge/version-0.1.8-blue)
![Version](https://img.shields.io/badge/version-0.1.9-blue)
![Rust](https://img.shields.io/badge/made_with-Rust-ffc832?logo=rust&logoColor=white)
![License](https://img.shields.io/badge/license-AGPL--3.0-blue)
## Alpha Status
- This project is currently in **alpha** (v0.1.8) and under active development.
- This project is currently in **alpha** (v0.1.9) and under active development.
- Core features are functional but expect occasional bugs and missing polish.
- Breaking changes may occur between releases as we refine the API.
- Feedback, bug reports, and contributions are very welcome!
@@ -48,6 +48,7 @@ The OWLEN interface features a clean, multi-panel layout with vim-inspired navig
- **Session Management** - Start new conversations, clear history, browse saved sessions
- **Thinking Mode Support** - Dedicated panel for extended reasoning content
- **Bracketed Paste** - Safe paste handling for multi-line content
- **Theming System** - 10 built-in themes plus custom theme support
### Code Client (`owlen-code`) [Experimental]
- All chat client features
@@ -140,14 +141,17 @@ cargo build --release --bin owlen-code --features code-client
- `Enter` - Send message and return to normal mode
- `Ctrl-J` / `Shift-Enter` - Insert newline
- `Ctrl-↑/↓` - Navigate input history
- `Ctrl-A` / `Ctrl-E` - Jump to start/end of line
- `Ctrl-W` / `Ctrl-B` - Word movement
- `Ctrl-R` - Redo
- Paste events handled automatically
**Visual Mode**:
- `j/k/h/l` - Extend selection
- `w/b/e` - Word-based selection
- `y` - Yank (copy) selection
- `d` - Cut selection (Input panel only)
- `Esc` - Cancel selection
- `d` / `Delete` - Cut selection (Input panel only)
- `Esc` / `v` - Cancel selection
**Command Mode**:
- `Tab` - Autocomplete selected command suggestion
@@ -160,8 +164,17 @@ cargo build --release --bin owlen-code --features code-client
- `:save [name]` / `:w [name]` - Save current conversation
- `:load` / `:open` - Browse and load saved sessions
- `:sessions` / `:ls` - List saved sessions
- `:theme <name>` - Switch theme (saved to config)
- `:themes` - Browse themes in interactive modal
- `:reload` - Reload configuration and themes
- *Commands show real-time suggestions as you type*
**Theme Browser** (accessed via `:themes`):
- `j` / `k` / `↑` / `↓` - Navigate themes
- `Enter` - Apply selected theme
- `g` / `G` - Jump to top/bottom
- `Esc` / `q` - Close browser
**Session Browser** (accessed via `:load` or `:sessions`):
- `j` / `k` / `↑` / `↓` - Navigate sessions
- `Enter` - Load selected session
@@ -210,15 +223,63 @@ generate_descriptions = true # AI-generated summaries for saved sessions
Configuration is automatically saved when you change models or providers.
### Theming
OWLEN includes 10 built-in themes that are embedded in the binary. You can also create custom themes.
**Built-in themes:**
- `default_dark` (default) - High-contrast dark theme
- `default_light` - Clean light theme
- `gruvbox` - Retro warm color scheme
- `dracula` - Vibrant purple and cyan
- `solarized` - Precision colors for readability
- `midnight-ocean` - Deep blue oceanic theme
- `rose-pine` - Soho vibes with muted pastels
- `monokai` - Classic code editor theme
- `material-dark` - Google's Material Design dark variant
- `material-light` - Google's Material Design light variant
**Commands:**
- `:theme <name>` - Switch theme instantly (automatically saved to config)
- `:themes` - Browse and select themes in an interactive modal
- `:reload` - Reload configuration and themes
**Setting default theme:**
```toml
[ui]
theme = "gruvbox" # or any built-in/custom theme name
```
**Creating custom themes:**
Create a `.toml` file in `~/.config/owlen/themes/`:
```toml
# ~/.config/owlen/themes/my-theme.toml
name = "my-theme"
text = "#ffffff"
background = "#000000"
focused_panel_border = "#ff00ff"
unfocused_panel_border = "#800080"
user_message_role = "#00ffff"
assistant_message_role = "#ffff00"
# ... see themes/README.md for full schema
```
**Colors** can be hex RGB (`#rrggbb`) or named colors (`red`, `blue`, `lightgreen`, etc.). See `themes/README.md` for the complete list of supported color names.
For reference theme files and detailed documentation, see the `themes/` directory in the repository or `/usr/share/owlen/themes/` after installation.
## Repository Layout
```
owlen/
├── crates/
│ ├── owlen-core/ # Core types, session management, shared UI components
│ ├── owlen-core/ # Core types, session management, theming, shared UI components
│ ├── owlen-ollama/ # Ollama provider implementation
│ ├── owlen-tui/ # TUI components (chat_app, code_app, rendering)
│ └── owlen-cli/ # Binary entry points (owlen, owlen-code)
├── themes/ # Built-in theme definitions (embedded in binary)
├── LICENSE # AGPL-3.0 License
├── Cargo.toml # Workspace configuration
└── README.md
@@ -270,9 +331,9 @@ cargo fmt
- [x] Bracketed paste support
- [x] Command autocompletion with Tab completion
- [x] Session persistence (save/load conversations)
- [x] Theming system with 9 built-in themes and custom theme support
### In Progress
- [ ] Theming options and color customization
- [ ] Enhanced configuration UX (in-app settings)
- [ ] Conversation export (Markdown, JSON, plain text)
@@ -322,4 +383,4 @@ Built with:
---
**Status**: Alpha v0.1.8 | **License**: AGPL-3.0 | **Made with Rust** 🦀
**Status**: Alpha v0.1.9 | **License**: AGPL-3.0 | **Made with Rust** 🦀