main: fix missing text colors in conversation logs
This commit is contained in:
+11
-4
@@ -13,7 +13,7 @@ use futures::{StreamExt, future::FutureExt};
|
|||||||
use ratatui::prelude::*;
|
use ratatui::prelude::*;
|
||||||
use tui_skeleton::{AnimationMode, SkeletonText};
|
use tui_skeleton::{AnimationMode, SkeletonText};
|
||||||
|
|
||||||
use crate::{audio::{AudioInputControl, TtsOutStream, start_audio_input}, prediction::{BandcampResult, PossibleResponse}, scene::{ConversationEntry, Scene, StageActions, StageDirection}, transcription::TranscriptionControl, tts::{TtsControl, start_tts}};
|
use crate::{audio::{AudioInputControl, start_audio_input}, prediction::{BandcampResult, PossibleResponse}, scene::{ConversationEntry, Scene, StageActions, StageDirection}, transcription::TranscriptionControl, tts::{TtsControl, start_tts}};
|
||||||
|
|
||||||
mod scene;
|
mod scene;
|
||||||
mod events;
|
mod events;
|
||||||
@@ -32,6 +32,8 @@ mod audio;
|
|||||||
// FIXME: It is unclear what would happen if we are live editing the save.json, have a typo, then reload. The file might get wiped without recovery.
|
// FIXME: It is unclear what would happen if we are live editing the save.json, have a typo, then reload. The file might get wiped without recovery.
|
||||||
// TODO: Would be nice to have some SFX integrated, with bleeps and calculation nosies or something periodically
|
// TODO: Would be nice to have some SFX integrated, with bleeps and calculation nosies or something periodically
|
||||||
|
|
||||||
|
// TODO: Should rewrite the entire prompt prediction loop, so the UI pushes modification events to the session and receives a new Scene from time to time whenever the prediction engine thinks it should regenerate one.
|
||||||
|
|
||||||
/* Usage loop:
|
/* Usage loop:
|
||||||
- Prompt user to select one of:
|
- Prompt user to select one of:
|
||||||
- Select response 1 (1)
|
- Select response 1 (1)
|
||||||
@@ -150,6 +152,12 @@ impl App {
|
|||||||
ConversationEntry::SystemMessage(_) => Style::new().fg(style::Color::DarkGray),
|
ConversationEntry::SystemMessage(_) => Style::new().fg(style::Color::DarkGray),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let text_style = match entry {
|
||||||
|
ConversationEntry::StageDirection(_) => Style::new().fg(style::Color::Yellow),
|
||||||
|
ConversationEntry::SystemMessage(_) => Style::new().fg(style::Color::DarkGray),
|
||||||
|
_ => Style::new()
|
||||||
|
};
|
||||||
|
|
||||||
let text = match entry {
|
let text = match entry {
|
||||||
ConversationEntry::Eva(text) => text,
|
ConversationEntry::Eva(text) => text,
|
||||||
ConversationEntry::ShipComputer(text) => text,
|
ConversationEntry::ShipComputer(text) => text,
|
||||||
@@ -166,9 +174,9 @@ impl App {
|
|||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(idx, s)| {
|
.map(|(idx, s)| {
|
||||||
if idx == 0 {
|
if idx == 0 {
|
||||||
Line::from_iter([Span::from(prefix).style(style), Span::from(s[prefix.len()..].to_string())])
|
Line::from_iter([Span::from(prefix).style(style), Span::from(s[prefix.len()..].to_string()).style(text_style)])
|
||||||
} else {
|
} else {
|
||||||
Line::from(s.to_string())
|
Line::from(s.to_string()).style(text_style)
|
||||||
}
|
}
|
||||||
}).collect();
|
}).collect();
|
||||||
|
|
||||||
@@ -551,7 +559,6 @@ impl App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn reload_mixxx_playlist(&mut self) {
|
fn reload_mixxx_playlist(&mut self) {
|
||||||
// TODO: Should have some status message which states how many tracks are in the playlist
|
|
||||||
if let Err(err) = self.direction.reload_mixxx_playlist() {
|
if let Err(err) = self.direction.reload_mixxx_playlist() {
|
||||||
self.next_actions.push(ConversationEntry::SystemMessage(format!("Error while loading mixxx playlist: {:?}", err)));
|
self.next_actions.push(ConversationEntry::SystemMessage(format!("Error while loading mixxx playlist: {:?}", err)));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user