feat: human error states, operator toasts and a queue/origin view in the omp UI
- classify transport and API failures into a short state with the next step - count undelivered messages and show them next to the sent counter - toast on owner paired, connection recovered and reply not delivered (throttled) - second status line previews the next queued turns - host spinner names the Telegram prompt while its turn runs - sanitize every Telegram-controlled string that reaches the widget
This commit is contained in:
1 parent
9435ff709b
commit
057281a3bb
19 files changed
+862
-22
No files matched your search
@@ -499,6 +499,25 @@ export function formatQueuedTelegramItemsStatus<TContext = unknown>(
|
||||
return items.length === 0 ? "" : ` +${items.length}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Summaries of the waiting items in dispatch order, for the status preview.
|
||||
* Display must never break the status update, so a malformed item only
|
||||
* costs the ordering.
|
||||
*/
|
||||
export function formatQueuedTelegramItemsPreview<TContext = unknown>(
|
||||
items: TelegramQueueItem<TContext>[],
|
||||
): string[] {
|
||||
let ordered = items;
|
||||
try {
|
||||
ordered = [...items].sort(compareTelegramQueueItems);
|
||||
} catch {
|
||||
// Keep the store order.
|
||||
}
|
||||
return ordered
|
||||
.map((item) => item.statusSummary.trim())
|
||||
.filter((summary) => summary.length > 0);
|
||||
}
|
||||
|
||||
export function truncateTelegramQueueSummary(
|
||||
text: string,
|
||||
maxWords = 5,
|
||||
|
||||
Reference in new issue
Block a user