feat(tui): wire Settings screen to AppSettings for live config #99

Merged
claude-desktop merged 2 commits from tui/settings-wire-92 into main 2026-04-12 15:36:41 +00:00
Collaborator

Summary

  • Read actual AppSettings values from ctx.settings on each render, populating all 9 section panes with live data (Backends, Paths, Generation Defaults, AI Features, NSFW, Appearance, Sharing, Key Bindings, System Prompts)
  • Support inline editing: Enter to start editing a text/numeric field, type new value, Enter to confirm — writes back to AppSettings and persists via save_settings()
  • Boolean fields (NSFW, safety checks, canvas inertia) toggle with Space or Enter
  • Wire Ctrl+T in the Backends section to fire bridge.health_check() and display the result as a notification
  • Two-pane navigation: Tab switches between section list and fields pane, j/k navigates within each pane

Test plan

  • cargo clippy -p loom-tui -- -D warnings clean
  • cargo test -p loom-tui passes (122 tests)
  • Manual: navigate to Settings, verify fields show real config values
  • Manual: edit a text field (e.g. gallery path), confirm it persists to settings.json
  • Manual: toggle a boolean field, confirm it persists
  • Manual: press Ctrl+T in Backends section, verify health check notification appears

Closes charles/loom#92

🤖 Generated with Claude Code

## Summary - Read actual `AppSettings` values from `ctx.settings` on each render, populating all 9 section panes with live data (Backends, Paths, Generation Defaults, AI Features, NSFW, Appearance, Sharing, Key Bindings, System Prompts) - Support inline editing: Enter to start editing a text/numeric field, type new value, Enter to confirm — writes back to `AppSettings` and persists via `save_settings()` - Boolean fields (NSFW, safety checks, canvas inertia) toggle with Space or Enter - Wire `Ctrl+T` in the Backends section to fire `bridge.health_check()` and display the result as a notification - Two-pane navigation: Tab switches between section list and fields pane, j/k navigates within each pane ## Test plan - [x] `cargo clippy -p loom-tui -- -D warnings` clean - [x] `cargo test -p loom-tui` passes (122 tests) - [ ] Manual: navigate to Settings, verify fields show real config values - [ ] Manual: edit a text field (e.g. gallery path), confirm it persists to `settings.json` - [ ] Manual: toggle a boolean field, confirm it persists - [ ] Manual: press `Ctrl+T` in Backends section, verify health check notification appears Closes charles/loom#92 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Read/write actual AppSettings values from ctx.settings in the Settings
screen. Each section displays its fields with real values; editing a
field writes back to AppSettings and persists via save_settings().
Boolean fields toggle with Space/Enter. Ctrl+T fires a health_check()
on the generation backend via the plugin bridge.

Closes charles/loom#92

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Collaborator

Review — PR #99: Settings screen wired to AppSettings

Good work. Full two-pane settings editor with inline editing, boolean toggles, and health check. Tests are solid.

Concern: blocking_read() in render path

render() calls ctx.settings.blocking_read(). This is a tokio::sync::RwLock, and blocking_read() will park the current OS thread if a write is held. In practice settings writes are rare so this is fine, but if a background task ever holds the write lock for a network call (e.g. reconfiguring the backend), the TUI would freeze. Consider using try_read() with a fallback to "(loading…)" text instead.

Concern: apply_edit with try_write()

apply_edit clones the Arc, then calls try_write(). If it fails, the user gets "failed to acquire settings lock" with no retry path. This is OK for now, but a notification with "try again" would be friendlier.

Nit

  • health_check uses ctx.bridge.clone() (field access) while other methods use ctx.bridge() (accessor). Pick one for consistency.
  • The Ctrl+T health check hint shows in all field panes, even when not in the Backends section. The hint line should probably be conditional on self.section == SettingsSection::Backends.
## Review — PR #99: Settings screen wired to AppSettings **Good work.** Full two-pane settings editor with inline editing, boolean toggles, and health check. Tests are solid. ### Concern: `blocking_read()` in render path `render()` calls `ctx.settings.blocking_read()`. This is a `tokio::sync::RwLock`, and `blocking_read()` will park the current OS thread if a write is held. In practice settings writes are rare so this is fine, but if a background task ever holds the write lock for a network call (e.g. reconfiguring the backend), the TUI would freeze. Consider using `try_read()` with a fallback to "(loading…)" text instead. ### Concern: `apply_edit` with `try_write()` `apply_edit` clones the `Arc`, then calls `try_write()`. If it fails, the user gets "failed to acquire settings lock" with no retry path. This is OK for now, but a notification with "try again" would be friendlier. ### Nit - `health_check` uses `ctx.bridge.clone()` (field access) while other methods use `ctx.bridge()` (accessor). Pick one for consistency. - The `Ctrl+T` health check hint shows in all field panes, even when not in the Backends section. The hint line should probably be conditional on `self.section == SettingsSection::Backends`.
charles force-pushed tui/settings-wire-92 from 25c0a9907a to 57982077c0 2026-04-12 14:47:23 +00:00 Compare
claude-desktop changed target branch from tui/image-ctx-85 to main 2026-04-12 15:36:29 +00:00
claude-desktop deleted branch tui/settings-wire-92 2026-04-12 15:36:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!99
No description provided.