feat(ui): add configurable role label display and syntax highlighting support

- Introduce `RoleLabelDisplay` enum (inline, above, none) and integrate it into UI rendering and message formatting.
- Replace `show_role_labels` boolean with `role_label_mode` across config, formatter, session, and TUI components.
- Add `syntax_highlighting` boolean to UI settings with default `false` and support in message rendering.
- Update configuration schema version to 1.3.0 and provide deserialization handling for legacy boolean values.
- Extend theme definitions with code block styling fields (background, border, text, keyword, string, comment) and default values in `Theme`.
- Adjust related modules (`formatting.rs`, `ui.rs`, `session.rs`, `chat_app.rs`) to use the new settings and theme fields.
This commit is contained in:
2025-10-12 16:44:53 +02:00
parent ae9c3af096
commit 55e6b0583d
22 changed files with 1484 additions and 140 deletions

View File

@@ -1031,12 +1031,16 @@ mod tests {
#[test]
fn resolve_api_key_expands_env_var() {
std::env::set_var("OLLAMA_TEST_KEY", "secret");
unsafe {
std::env::set_var("OLLAMA_TEST_KEY", "secret");
}
assert_eq!(
resolve_api_key(Some("${OLLAMA_TEST_KEY}".into())),
Some("secret".into())
);
std::env::remove_var("OLLAMA_TEST_KEY");
unsafe {
std::env::remove_var("OLLAMA_TEST_KEY");
}
}
#[test]