tui: tui.toml configuration file support #43

Closed
opened 2026-04-11 13:06:52 +00:00 by charles · 0 comments
Owner

User story

As a user, I want TUI-specific settings persisted in $XDG_CONFIG_HOME/loom/tui.toml, so that loom-tui can run with my preferences without conflicting with loom-gtk's config.

Acceptance criteria

Location & schema

  • Path: $XDG_CONFIG_HOME/loom/tui.toml (fallback ~/.config/loom/tui.toml)
  • Schema matches spec §7.1:
    • [tui]image_protocol, theme, sidebar_width, gallery_columns, mouse_enabled, smooth_scroll
    • [tui.keybinds] — action-id → combo override map
    • [tui.log] — ring buffer size, level filter
  • Missing file at startup: treat as defaults; do not write until the user changes a setting

Load / save

  • Config::load() returns (LoomTuiConfig, Vec<LoadWarning>); warnings go to the notification bar on startup
  • Config::save(&self) writes atomically (tempfile + rename) and creates a .bak of the previous content
  • Write permissions issues surface as a fatal error dialog only if invoked explicitly by the Settings screen

Integration

  • Config values consumed by: image renderer detection, layout (sidebar width), gallery (column count), keybinds, log overlay
  • Shared backend/plugin config keeps using the loom-core path; loom-tui does not duplicate those fields

Tests

  • Round-trip: load a hand-written tui.toml, save, reload, assert equality
  • Invalid enum values produce LoadWarning and fall back to defaults instead of failing

Out of scope

  • UI for editing (separate Settings ticket)

References

  • Spec §7 "Configuration"
  • Spec §7.1 sample TOML
## User story As a user, I want TUI-specific settings persisted in `$XDG_CONFIG_HOME/loom/tui.toml`, so that loom-tui can run with my preferences without conflicting with loom-gtk's config. ## Acceptance criteria ### Location & schema - [ ] Path: `$XDG_CONFIG_HOME/loom/tui.toml` (fallback `~/.config/loom/tui.toml`) - [ ] Schema matches spec §7.1: - `[tui]` — `image_protocol`, `theme`, `sidebar_width`, `gallery_columns`, `mouse_enabled`, `smooth_scroll` - `[tui.keybinds]` — action-id → combo override map - `[tui.log]` — ring buffer size, level filter - [ ] Missing file at startup: treat as defaults; do not write until the user changes a setting ### Load / save - [ ] `Config::load()` returns `(LoomTuiConfig, Vec<LoadWarning>)`; warnings go to the notification bar on startup - [ ] `Config::save(&self)` writes atomically (tempfile + rename) and creates a `.bak` of the previous content - [ ] Write permissions issues surface as a fatal error dialog only if invoked explicitly by the Settings screen ### Integration - [ ] Config values consumed by: image renderer detection, layout (sidebar width), gallery (column count), keybinds, log overlay - [ ] Shared backend/plugin config keeps using the `loom-core` path; loom-tui does not duplicate those fields ### Tests - [ ] Round-trip: load a hand-written tui.toml, save, reload, assert equality - [ ] Invalid enum values produce `LoadWarning` and fall back to defaults instead of failing ## Out of scope - UI for editing (separate Settings ticket) ## References - Spec §7 "Configuration" - Spec §7.1 sample TOML
charles added this to the loom-tui v0.1.0 milestone 2026-04-11 13:06:52 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom#43
No description provided.