Pinned to the server's dev at 69f4800: a reply's end on the events route; a message whose arrival is unknown says so
CI / check (push) Canceled after 0s

The end frame is the one this app was built against: `reply` with `live`
false, once per reply (event_reply_end.json, read in SecondReviewTest with
what an end does to the list and to an open chat). Nothing in the handling
changed. Tokens and strings are read at the same commit.

A person's message with origin `unsure` (queued, never sent by itself: it was
handed to the linked computer and nobody heard whether it arrived) carries the
server's sentence in place of the queued line.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Fable 5.2 committed 2026-11-23 17:39:25 +00:00
1 parent a9bdfcc18a
commit 37574292cd
21 files changed
+91 -16

No files matched your search

@@ -150,6 +150,17 @@ fun drawn(message: Message, first: Boolean, reportChat: Boolean): Drawn = when {
/** The `origin` of a turn the linked computer's harness started by itself. */
const val ORIGIN_HARNESS = "harness"
/** The `origin` of a message handed to the linked computer whose arrival there was never heard. */
const val ORIGIN_UNSURE = "unsure"
/**
* Whether this is the person's message of which nobody knows whether it reached the linked
* computer (`origin` `unsure`, waiting): the instance never sends it by itself, so it is not
* "queued, two ahead" -- it says what it is, in the instance's sentence. Any other origin this
* app does not know is drawn as none.
*/
val Message.fateUnknown: Boolean get() = isUser && queued && origin == ORIGIN_UNSURE
/** Whether nobody typed this row: the server wrote it (`machine`), or a device's harness did. */
val Message.byMachine: Boolean get() = machine || origin == ORIGIN_HARNESS
@@ -455,9 +455,10 @@ data class ChatDetail(val chat: Chat, val messages: List<Message> = emptyList(),
/**
* `GET /events`, frame `reply`: a reply started in the chat [chatId] -- whoever started it, this
* app's own too. [messageId] is the reply's row; [live] false says it had already ended when the
* frame was sent. An event, not a state: it is said once (and, on a connection just opened, for
* every reply being written then).
* app's own too -- and, with [live] false, that it is over (`event_reply_end.json`): once per
* reply, however it ended; a reply shorter than the news of its start is said by that one frame
* alone. [messageId] is the reply's row. An event, not a state: a start is said once (and, on a
* connection just opened, for every reply being written then), an end once and never again.
*/
@Serializable
data class ReplyFrame(@SerialName("chat_id") val chatId: String = "", @SerialName("message_id") val messageId: String = "", val live: Boolean = false)
@@ -171,10 +171,11 @@ fun UserMessage(message: Message, canEdit: Boolean, onEdit: () -> Unit, modifier
}
if (message.queued) {
// The server's queued progress ("Queued, 2 ahead · 12s") where it sends one.
// Not one whose arrival at the computer is unknown: that one waits for the person, not for its turn.
Text(
progressLineOf(message.progress) ?: stringResource(R.string.queued),
if (message.fateUnknown) stringResource(R.string.fate_unknown) else progressLineOf(message.progress) ?: stringResource(R.string.queued),
style = MaterialTheme.typography.labelSmall,
color = palette.inkFaint,
color = if (message.fateUnknown) palette.warning else palette.inkFaint,
modifier = Modifier.padding(top = 4.dp, end = 4.dp),
)
}
@@ -1,4 +1,4 @@
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at 37a09bb6ee2f248ff23ab49df344e7ae0143b1ef. Do not edit.
// Generated by scripts/fetch-tokens.py from the LLeMbas server's tokens.css at 69f480095cfa77b5d25debf560aab3d26783e197. Do not edit.
package eu.llembas.android.ui.theme
import androidx.compose.ui.graphics.Color