feat: Chat-Kopf mit Persona- und Stimmenwahl (CHAT-01, #1122)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 07:51:59 +01:00
parent 114fbf1465
commit 5edc1aa3ae
3 changed files with 20 additions and 3 deletions

View File

@ -110,15 +110,20 @@ pub(super) async fn page(State(state): State<Arc<AppState>>, headers: HeaderMap)
.collect();
format!(
"<label>Sprachausgabe <select id=\"chat-sprache\"><option value=\"\">aus</option>{options}</select></label>\
<label>Stimme <select id=\"chat-stimme\"><option value=\"\">(zuerst Sprachausgabe wählen)</option></select></label>\
<label><input type=\"checkbox\" id=\"chat-live\"> Live vorlesen</label>\
<button class=\"sm\" type=\"button\" id=\"chat-vorlesen-stopp\" hidden>Vorlesen stoppen</button>"
)
};
// CHAT-01: Kopf mit Persona und Stimme. Die Stimme gibt es nur mit einem Sprachmodell.
let stimme_kopf = if sprachmodelle.is_empty() {
String::new()
} else {
"<label>Stimme <select id=\"chat-stimme\"><option value=\"\">(zuerst Sprachausgabe wählen)</option></select></label>".to_string()
};
format!(
"<section class=\"card\" id=\"chat\">\
<div class=\"zeile chat-kopf\" id=\"chat-kopf\"><label>Persona <select id=\"chat-persona\"><option value=\"\">aus</option>{persona_options}</select></label>{stimme_kopf}</div>\
<div class=\"zeile\"><label>Modell <select id=\"chat-modell\">{options}</select></label>\
<label>Persona <select id=\"chat-persona\"><option value=\"\">aus</option>{persona_options}</select></label>\
<label>Denkstufe <select id=\"chat-denkstufe\"><option value=\"\">Engine-Voreinstellung</option><option value=\"none\">aus</option><option value=\"low\">niedrig</option><option value=\"medium\" selected>mittel</option><option value=\"high\">hoch</option></select></label>\
<label>Max. Tokens <input id=\"chat-max\" type=\"number\" min=\"1\" max=\"{MAX_TOKENS_LIMIT}\" value=\"{DEFAULT_MAX_TOKENS}\"></label>{sprache}\
<span class=\"rechts\"><button class=\"sm\" type=\"button\" id=\"chat-neu\">Neuer Chat</button></span></div>\

View File

@ -1502,6 +1502,18 @@ async fn playground_sagt_wenn_die_antwort_an_der_tokengrenze_abgeschnitten_wird(
assert!(js.contains("finish_reason") && js.contains("Antwort abgeschnitten"));
}
#[tokio::test]
async fn chat_kopf_hat_persona_vor_der_modellwahl() {
// CHAT-01: Persona steht im Kopf, vor der Modellwahl.
let gw = gateway(0, false).await;
let (cookie, _) = ui_session(&gw, &gw.key_ui).await;
let (_, _, seite) = ui_get(&gw, "/ui/chat", Some(&cookie)).await;
let kopf = seite.find("id=\"chat-kopf\"").expect("Kopf fehlt");
let persona = seite.find("id=\"chat-persona\"").expect("Persona fehlt");
let modell = seite.find("id=\"chat-modell\"").expect("Modell fehlt");
assert!(kopf < persona && persona < modell);
}
#[tokio::test]
async fn modelle_zeigen_faehigkeiten_mit_herkunft() {
let gw = gateway(0, false).await;