Add OnelinerState::Manual variant

This commit introduces a new `Manual` variant to the `OnelinerState`
enum, allowing for manual overrides of the oneliner text. This change
affects the client and server components to handle and display this new
state.

A `OnelinerOverrideRequest` struct is also added for API requests to set
manual oneliners. New tests are included to ensure the `Manual` variant
serializes and deserializes correctly.

The `compute_oneliner_display` function in
`server/src/routes/user_web.rs` is updated to treat `Manual` states the
same as `Ready` states for display purposes. The
`cases_needing_oneliner_in` function in
`server/src/transcribe/recovery.rs` is updated to not retry cases that
are in a `Manual` state.
This commit is contained in:
2026-04-26 15:44:13 +02:00
parent 1b689d1c8c
commit 73fa099b51
6 changed files with 86 additions and 19 deletions
+6 -2
View File
@@ -980,7 +980,9 @@ async fn compute_oneliner_display(
// Missing state collapses to Empty ("unbenannt"): no title is
// expected, regardless of why.
match state {
Some(OnelinerState::Ready { text, .. }) => OnelinerDisplay::Ready(text),
Some(OnelinerState::Ready { text, .. } | OnelinerState::Manual { text, .. }) => {
OnelinerDisplay::Ready(text)
}
Some(OnelinerState::Error { .. }) => OnelinerDisplay::Error,
Some(OnelinerState::Empty { .. }) | None => OnelinerDisplay::Empty,
}
@@ -989,7 +991,9 @@ async fn compute_oneliner_display(
// between transcript-write and state-write where the worker is
// still producing its result.
match state {
Some(OnelinerState::Ready { text, .. }) => OnelinerDisplay::Ready(text),
Some(OnelinerState::Ready { text, .. } | OnelinerState::Manual { text, .. }) => {
OnelinerDisplay::Ready(text)
}
Some(OnelinerState::Empty { .. }) => OnelinerDisplay::Empty,
Some(OnelinerState::Error { .. }) => OnelinerDisplay::Error,
None => OnelinerDisplay::Generating,