|
|
|
@@ -3,6 +3,8 @@ package net.awan.pipelines.ui.chat
|
|
|
|
|
import androidx.compose.foundation.BorderStroke
|
|
|
|
|
import androidx.compose.foundation.background
|
|
|
|
|
import androidx.compose.foundation.clickable
|
|
|
|
|
import androidx.compose.foundation.gestures.animateScrollBy
|
|
|
|
|
import androidx.compose.foundation.gestures.scrollBy
|
|
|
|
|
import androidx.compose.foundation.horizontalScroll
|
|
|
|
|
import androidx.compose.foundation.interaction.DragInteraction
|
|
|
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
|
|
@@ -20,8 +22,8 @@ import androidx.compose.foundation.layout.padding
|
|
|
|
|
import androidx.compose.foundation.layout.size
|
|
|
|
|
import androidx.compose.foundation.layout.widthIn
|
|
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
|
|
import androidx.compose.foundation.lazy.LazyListState
|
|
|
|
|
import androidx.compose.foundation.lazy.items
|
|
|
|
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
|
|
|
|
import androidx.compose.foundation.rememberScrollState
|
|
|
|
|
import androidx.compose.foundation.verticalScroll
|
|
|
|
|
import androidx.compose.foundation.shape.CircleShape
|
|
|
|
@@ -62,6 +64,7 @@ import androidx.compose.material3.SnackbarDuration
|
|
|
|
|
import androidx.compose.material3.SnackbarHost
|
|
|
|
|
import androidx.compose.material3.SnackbarHostState
|
|
|
|
|
import androidx.compose.material3.SnackbarResult
|
|
|
|
|
import androidx.compose.material3.SmallFloatingActionButton
|
|
|
|
|
import androidx.compose.material3.Surface
|
|
|
|
|
import androidx.compose.material3.Text
|
|
|
|
|
import androidx.compose.material3.TextButton
|
|
|
|
@@ -69,12 +72,15 @@ import androidx.compose.material3.TopAppBar
|
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
|
import androidx.compose.runtime.DisposableEffect
|
|
|
|
|
import androidx.compose.runtime.LaunchedEffect
|
|
|
|
|
import androidx.compose.runtime.derivedStateOf
|
|
|
|
|
import androidx.compose.runtime.getValue
|
|
|
|
|
import androidx.compose.runtime.key
|
|
|
|
|
import androidx.compose.runtime.mutableLongStateOf
|
|
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
|
|
|
import androidx.compose.runtime.remember
|
|
|
|
|
import androidx.compose.runtime.rememberCoroutineScope
|
|
|
|
|
import androidx.compose.runtime.rememberUpdatedState
|
|
|
|
|
import androidx.compose.runtime.saveable.rememberSaveable
|
|
|
|
|
import androidx.compose.runtime.setValue
|
|
|
|
|
import androidx.compose.ui.Alignment
|
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
@@ -116,6 +122,7 @@ import net.awan.pipelines.ui.components.RunStatusPalette
|
|
|
|
|
import net.awan.pipelines.ui.components.SlidingPaneStack
|
|
|
|
|
import net.awan.pipelines.ui.formatDuration
|
|
|
|
|
import net.awan.pipelines.ui.theme.CHAT_BUBBLE_MAX_WIDTH_DP
|
|
|
|
|
import net.awan.pipelines.ui.theme.CHAT_FOLLOW_THRESHOLD_DP
|
|
|
|
|
import net.awan.pipelines.ui.theme.CHAT_TITLE_MAX_WIDTH_DP
|
|
|
|
|
import net.awan.pipelines.ui.theme.HAIRLINE_DP
|
|
|
|
|
import net.awan.pipelines.ui.theme.ICON_BUTTON_SMALL_DP
|
|
|
|
@@ -693,24 +700,42 @@ private fun ChatConversationPane(
|
|
|
|
|
thread: ChatThread,
|
|
|
|
|
modifier: Modifier,
|
|
|
|
|
) {
|
|
|
|
|
val listState = rememberLazyListState(
|
|
|
|
|
initialFirstVisibleItemIndex = thread.scroll.index,
|
|
|
|
|
initialFirstVisibleItemScrollOffset = thread.scroll.offset,
|
|
|
|
|
)
|
|
|
|
|
// Persist the scroll position when the operator leaves this chat, so switching
|
|
|
|
|
// away and back returns them exactly where they were.
|
|
|
|
|
DisposableEffect(thread.sessionId) {
|
|
|
|
|
onDispose { vm.saveChatScroll(thread.sessionId, listState.firstVisibleItemIndex, listState.firstVisibleItemScrollOffset) }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val approval = approvalCard(thread.permission, thread.permissionAnswer)
|
|
|
|
|
val awaiting = approval?.actionable == true
|
|
|
|
|
// A turn blocked on an approval is not generating, so the running indicator
|
|
|
|
|
// (and its ticking clock) stands down while the card is unanswered.
|
|
|
|
|
val showRunning = thread.running && !awaiting
|
|
|
|
|
// The card is the transcript's last item; the top bar's approval action jumps
|
|
|
|
|
// to it so a pending request is reachable without scrolling the whole chat.
|
|
|
|
|
val approvalIndex = thread.messages.size + if (showRunning) 1 else 0
|
|
|
|
|
// The count of the transcript's items: the messages, the running indicator
|
|
|
|
|
// while a turn is in flight and a pending approval card, which is the last item
|
|
|
|
|
// the top bar's approval action jumps to.
|
|
|
|
|
val itemCount = thread.messages.size + (if (showRunning) 1 else 0) + (if (approval != null) 1 else 0)
|
|
|
|
|
// The position the operator left this conversation at, read once: a
|
|
|
|
|
// conversation with none of its own opens at its newest message instead (see
|
|
|
|
|
// chatOpensAtNewest), so the current turn is never hunted for.
|
|
|
|
|
val savedScroll = remember(thread.sessionId) { thread.scroll }
|
|
|
|
|
// The list state is created the moment the conversation first has content, so
|
|
|
|
|
// its very first measure is already at the newest item rather than at the top:
|
|
|
|
|
// opening a chat must not show anything else first. It is still saveable, so a
|
|
|
|
|
// rotation or process death keeps the operator's position.
|
|
|
|
|
val listState = rememberSaveable(thread.sessionId, itemCount > 0, saver = LazyListState.Saver) {
|
|
|
|
|
val first = chatFirstScroll(savedScroll, itemCount)
|
|
|
|
|
LazyListState(
|
|
|
|
|
firstVisibleItemIndex = first.index,
|
|
|
|
|
firstVisibleItemScrollOffset = first.offset,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
// Persist the scroll position when the operator leaves this chat, so switching
|
|
|
|
|
// away and back returns them exactly where they were. Keyed on the list state,
|
|
|
|
|
// so the position saved is the one that was actually shown; a state that never
|
|
|
|
|
// held content (replaced when the conversation first loaded) saves nothing,
|
|
|
|
|
// leaving the conversation with no position of its own to open at its newest.
|
|
|
|
|
DisposableEffect(listState) {
|
|
|
|
|
onDispose {
|
|
|
|
|
if (listState.layoutInfo.totalItemsCount > 0) {
|
|
|
|
|
vm.saveChatScroll(thread.sessionId, listState.firstVisibleItemIndex, listState.firstVisibleItemScrollOffset)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
val scope = rememberCoroutineScope()
|
|
|
|
|
|
|
|
|
|
Scaffold(
|
|
|
|
@@ -733,7 +758,10 @@ private fun ChatConversationPane(
|
|
|
|
|
if (awaiting) {
|
|
|
|
|
IconButton(
|
|
|
|
|
onClick = {
|
|
|
|
|
scope.launch { listState.animateScrollToItem(approvalIndex.coerceAtLeast(0)) }
|
|
|
|
|
// The transcript's one scroll path, so a pending
|
|
|
|
|
// request is brought into view the same way new
|
|
|
|
|
// content is.
|
|
|
|
|
scope.launch { listState.scrollToEnd(itemCount, animated = true) }
|
|
|
|
|
},
|
|
|
|
|
) {
|
|
|
|
|
Icon(
|
|
|
|
@@ -771,6 +799,8 @@ private fun ChatConversationPane(
|
|
|
|
|
else -> ChatTranscript(
|
|
|
|
|
thread = thread,
|
|
|
|
|
listState = listState,
|
|
|
|
|
savedScroll = savedScroll,
|
|
|
|
|
itemCount = itemCount,
|
|
|
|
|
approval = approval,
|
|
|
|
|
showRunning = showRunning,
|
|
|
|
|
onDecision = { decision ->
|
|
|
|
@@ -802,64 +832,200 @@ private fun ChatConversationPane(
|
|
|
|
|
* freshly opened chat sits against the composer) and the running indicator sits
|
|
|
|
|
* at the newest end while a turn is in flight.
|
|
|
|
|
*
|
|
|
|
|
* While a turn streams it follows the newest content with a hard jump (not an
|
|
|
|
|
* animation, which a fast-growing reply outruns), exactly like the reference
|
|
|
|
|
* transcript, unless the operator has scrolled up to read; returning to the end
|
|
|
|
|
* resumes following.
|
|
|
|
|
* The transcript has one scroll path ([scrollToEnd] / [closeBottomGap]) and one
|
|
|
|
|
* decision for whether it follows new content. It opens at the newest message
|
|
|
|
|
* (placed by the pane's initial position, with any part of a last message taller
|
|
|
|
|
* than the viewport closed instantly here), and then — while the operator intends
|
|
|
|
|
* to read the newest part — every arrival (a message, a streamed delta, a tool
|
|
|
|
|
* chip, a grown composer or the appearing keyboard) is followed smoothly, so the
|
|
|
|
|
* newest content stays in view. An item that arrives entirely below the fold is
|
|
|
|
|
* brought in rather than left there. A freshly arrived approval card is followed
|
|
|
|
|
* the same way. Once the operator has scrolled up to read history nothing moves
|
|
|
|
|
* under them, and the jump-to-latest affordance is offered instead.
|
|
|
|
|
*/
|
|
|
|
|
@Composable
|
|
|
|
|
private fun ChatTranscript(
|
|
|
|
|
thread: ChatThread,
|
|
|
|
|
listState: androidx.compose.foundation.lazy.LazyListState,
|
|
|
|
|
listState: LazyListState,
|
|
|
|
|
savedScroll: ChatScrollPosition?,
|
|
|
|
|
itemCount: Int,
|
|
|
|
|
approval: ApprovalCard?,
|
|
|
|
|
showRunning: Boolean,
|
|
|
|
|
onDecision: (String) -> Unit,
|
|
|
|
|
) {
|
|
|
|
|
var follow by remember(thread.sessionId) { mutableStateOf(true) }
|
|
|
|
|
// Only a *user* drag changes whether the transcript follows: programmatic
|
|
|
|
|
// jumps (below) never touch `interactionSource`, so they cannot un-stick the
|
|
|
|
|
// view. A drag away from the end stops the follow; releasing at the very end
|
|
|
|
|
// (no content below) resumes it.
|
|
|
|
|
LaunchedEffect(listState) {
|
|
|
|
|
val scope = rememberCoroutineScope()
|
|
|
|
|
val density = LocalDensity.current
|
|
|
|
|
val thresholdPx = remember(density) { with(density) { CHAT_FOLLOW_THRESHOLD_DP.roundToPx() } }
|
|
|
|
|
// The transcript's item count, read at use time: the drag collector and the
|
|
|
|
|
// derived state below outlive any single recomposition, so a count captured
|
|
|
|
|
// when they were created would go stale as messages arrive and the follow
|
|
|
|
|
// would measure against how many items there used to be.
|
|
|
|
|
val currentItemCount by rememberUpdatedState(itemCount)
|
|
|
|
|
// Whether the operator wants the newest content kept in view. Only their own
|
|
|
|
|
// drag changes it — a programmatic scroll never touches the list's
|
|
|
|
|
// interactionSource, so it cannot un-stick the view — and a drag that settles
|
|
|
|
|
// at (or within the threshold of) the bottom resumes the follow. Its real
|
|
|
|
|
// value is settled once the transcript is placed, when the live distance to
|
|
|
|
|
// the bottom is known.
|
|
|
|
|
// Saved, so a rotation or process death while the operator is reading history
|
|
|
|
|
// restores "not following" too, rather than the restored transcript being
|
|
|
|
|
// yanked to the bottom by the placement the new composition would otherwise run.
|
|
|
|
|
var following by rememberSaveable(thread.sessionId) { mutableStateOf(true) }
|
|
|
|
|
LaunchedEffect(listState, thresholdPx) {
|
|
|
|
|
listState.interactionSource.interactions.collect { interaction ->
|
|
|
|
|
when (interaction) {
|
|
|
|
|
is DragInteraction.Start -> follow = false
|
|
|
|
|
is DragInteraction.Start -> following = false
|
|
|
|
|
is DragInteraction.Stop, is DragInteraction.Cancel ->
|
|
|
|
|
follow = !listState.canScrollForward
|
|
|
|
|
following = chatFollowsAt(
|
|
|
|
|
distanceFromBottomPx = listState.bottomDistancePx(currentItemCount),
|
|
|
|
|
thresholdPx = thresholdPx,
|
|
|
|
|
itemCount = currentItemCount,
|
|
|
|
|
)
|
|
|
|
|
else -> Unit
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
val awaiting = approval?.actionable == true
|
|
|
|
|
val itemCount = thread.messages.size + (if (showRunning) 1 else 0) + (if (approval != null) 1 else 0)
|
|
|
|
|
// Follow the newest content while a turn streams, and scroll a freshly
|
|
|
|
|
// arrived approval card into view the same way so a pending request is not
|
|
|
|
|
// left below the fold.
|
|
|
|
|
LaunchedEffect(thread.running, thread.messages, follow, itemCount, awaiting) {
|
|
|
|
|
if (follow && itemCount > 0 && (thread.running || awaiting)) {
|
|
|
|
|
listState.scrollToItem(itemCount - 1)
|
|
|
|
|
// The distance to the transcript's end, read through a derived state so the
|
|
|
|
|
// affordance's visibility is recomputed only when it actually changes rather
|
|
|
|
|
// than on every scrolled pixel. The item count is read through
|
|
|
|
|
// [currentItemCount] so the derived value also recomputes as content arrives.
|
|
|
|
|
val showJumpToLatest by remember(listState, thresholdPx) {
|
|
|
|
|
derivedStateOf {
|
|
|
|
|
chatShowJumpToLatest(
|
|
|
|
|
following = following,
|
|
|
|
|
distanceFromBottomPx = listState.bottomDistancePx(currentItemCount),
|
|
|
|
|
thresholdPx = thresholdPx,
|
|
|
|
|
itemCount = currentItemCount,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
LazyColumn(
|
|
|
|
|
state = listState,
|
|
|
|
|
modifier = Modifier.fillMaxSize(),
|
|
|
|
|
contentPadding = PaddingValues(horizontal = CHAT_GUTTER, vertical = CHAT_ITEM_GAP),
|
|
|
|
|
verticalArrangement = Arrangement.spacedBy(CHAT_ITEM_GAP, Alignment.Bottom),
|
|
|
|
|
) {
|
|
|
|
|
items(thread.messages, key = { it.id }) { message ->
|
|
|
|
|
MessageItem(message)
|
|
|
|
|
// The transcript is placed once, when it first has content, and only after it
|
|
|
|
|
// has been measured; the viewport height is an input too, so a grown composer
|
|
|
|
|
// or the appearing keyboard re-follows rather than leaving the newest message
|
|
|
|
|
// hidden behind it. Placement itself is saved, so restoring a rotation does not
|
|
|
|
|
// re-place (and re-follow) a transcript the operator had scrolled up.
|
|
|
|
|
var placed by rememberSaveable(thread.sessionId) { mutableStateOf(false) }
|
|
|
|
|
val viewportHeight by remember(listState) { derivedStateOf { listState.layoutInfo.viewportSize.height } }
|
|
|
|
|
LaunchedEffect(thread.messages, thread.running, approval?.requestId, viewportHeight) {
|
|
|
|
|
if (itemCount <= 0) return@LaunchedEffect
|
|
|
|
|
if (!placed) {
|
|
|
|
|
// Wait for the first measure: placement run before it would no-op and
|
|
|
|
|
// leave the first display to the measured re-run, which animates, and
|
|
|
|
|
// the first display must not animate.
|
|
|
|
|
if (viewportHeight <= 0) return@LaunchedEffect
|
|
|
|
|
placed = true
|
|
|
|
|
if (chatOpensAtNewest(savedScroll)) {
|
|
|
|
|
// No position of the operator's own: bring the newest item fully
|
|
|
|
|
// into view, instantly — the first display must not animate — and
|
|
|
|
|
// through the same path the follow uses, so placement and follow
|
|
|
|
|
// cannot disagree about what the newest item is (a last message
|
|
|
|
|
// taller than the viewport has its below-the-fold part closed by
|
|
|
|
|
// the same call), then follow.
|
|
|
|
|
listState.scrollToEnd(itemCount, animated = false)
|
|
|
|
|
following = true
|
|
|
|
|
} else {
|
|
|
|
|
// A position the operator left: follow only if it was the bottom, so
|
|
|
|
|
// returning to a chat never yanks the view.
|
|
|
|
|
following = chatFollowsAt(listState.bottomDistancePx(itemCount), thresholdPx, itemCount)
|
|
|
|
|
}
|
|
|
|
|
return@LaunchedEffect
|
|
|
|
|
}
|
|
|
|
|
if (showRunning) {
|
|
|
|
|
item(key = "pending") { RunningIndicator(thread) }
|
|
|
|
|
if (following) listState.scrollToEnd(itemCount, animated = true)
|
|
|
|
|
}
|
|
|
|
|
Box(Modifier.fillMaxSize()) {
|
|
|
|
|
LazyColumn(
|
|
|
|
|
state = listState,
|
|
|
|
|
modifier = Modifier.fillMaxSize(),
|
|
|
|
|
contentPadding = PaddingValues(horizontal = CHAT_GUTTER, vertical = CHAT_ITEM_GAP),
|
|
|
|
|
verticalArrangement = Arrangement.spacedBy(CHAT_ITEM_GAP, Alignment.Bottom),
|
|
|
|
|
) {
|
|
|
|
|
items(thread.messages, key = { it.id }) { message ->
|
|
|
|
|
MessageItem(message)
|
|
|
|
|
}
|
|
|
|
|
if (showRunning) {
|
|
|
|
|
item(key = "pending") { RunningIndicator(thread) }
|
|
|
|
|
}
|
|
|
|
|
if (approval != null) {
|
|
|
|
|
// Keyed by request id so switching between requests swaps the card
|
|
|
|
|
// instead of reusing the previous one's state.
|
|
|
|
|
item(key = "approval-" + approval.requestId) { ApprovalCardItem(approval, onDecision) }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (approval != null) {
|
|
|
|
|
// Keyed by request id so switching between requests swaps the card
|
|
|
|
|
// instead of reusing the previous one's state.
|
|
|
|
|
item(key = "approval-" + approval.requestId) { ApprovalCardItem(approval, onDecision) }
|
|
|
|
|
// Offered only once the transcript is placed and the operator has left the
|
|
|
|
|
// bottom, so it never covers the newest content it would return to.
|
|
|
|
|
if (placed && showJumpToLatest) {
|
|
|
|
|
SmallFloatingActionButton(
|
|
|
|
|
onClick = {
|
|
|
|
|
following = true
|
|
|
|
|
scope.launch { listState.scrollToEnd(itemCount, animated = true) }
|
|
|
|
|
},
|
|
|
|
|
modifier = Modifier.align(Alignment.BottomEnd).padding(CHAT_GUTTER),
|
|
|
|
|
) {
|
|
|
|
|
Icon(Icons.Default.KeyboardArrowDown, contentDescription = "Jump to latest")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The transcript's one scroll path, shared by the first placement, the follow,
|
|
|
|
|
* the app-bar approval jump and the jump-to-latest affordance. The newest item is
|
|
|
|
|
* brought into view when it sits entirely below the fold — an item appended past
|
|
|
|
|
* the viewport's edge, so no pixel of it is on screen and the remaining distance
|
|
|
|
|
* cannot be measured — and any part of it still below the fold (a message taller
|
|
|
|
|
* than the viewport) is then closed by exactly that distance. An item that is
|
|
|
|
|
* already partly visible is only gap-closed, never moved up first. [animated] is
|
|
|
|
|
* false only for the first placement, which must not animate.
|
|
|
|
|
*
|
|
|
|
|
* [itemCount] is the transcript's *content* count, which can be ahead of the
|
|
|
|
|
* layout's: an appended item exists in the content before the recomposition that
|
|
|
|
|
* measures it, and the effect that follows it is dispatched ahead of that measure,
|
|
|
|
|
* so the layout still describes the previous items and its own last visible item
|
|
|
|
|
* reads as the end. Measuring against [itemCount] — see [bottomDistancePx] — is
|
|
|
|
|
* what stops an appended item from being mistaken for the already-visible end and
|
|
|
|
|
* left below the fold: it has no pixel on screen, so it is unknown-distance and is
|
|
|
|
|
* brought into view rather than gap-closed at zero.
|
|
|
|
|
*/
|
|
|
|
|
private suspend fun LazyListState.scrollToEnd(itemCount: Int, animated: Boolean) {
|
|
|
|
|
if (itemCount <= 0) return
|
|
|
|
|
if (bottomDistancePx(itemCount) == null) {
|
|
|
|
|
if (animated) animateScrollToItem(itemCount - 1) else scrollToItem(itemCount - 1)
|
|
|
|
|
}
|
|
|
|
|
closeBottomGap(itemCount, animated)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Scrolls the transcript's end into view by exactly the distance it sits below
|
|
|
|
|
* the viewport, measured against the same [itemCount] the decisions above use.
|
|
|
|
|
*/
|
|
|
|
|
private suspend fun LazyListState.closeBottomGap(itemCount: Int, animated: Boolean) {
|
|
|
|
|
val remaining = bottomDistancePx(itemCount) ?: return
|
|
|
|
|
if (remaining <= 0) return
|
|
|
|
|
if (animated) animateScrollBy(remaining.toFloat()) else scrollBy(remaining.toFloat())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The distance from the transcript's end to the viewport's bottom, measured
|
|
|
|
|
* against [itemCount] — the transcript's *content* count, not the layout's. The
|
|
|
|
|
* two differ on the frame content arrives: the layout still describes the
|
|
|
|
|
* previous items, so its own last visible item reads as the end and the appended
|
|
|
|
|
* item's absence is invisible. Measuring against the content count makes the
|
|
|
|
|
* appended item read exactly as [chatBottomDistancePx] defines it — no pixel on
|
|
|
|
|
* screen — so the scroll path above brings it into view rather than trusting a
|
|
|
|
|
* stale layout's "already at the end". [itemCount] is what the transcript
|
|
|
|
|
* renders, so the two counts agree as soon as the layout catches up.
|
|
|
|
|
*/
|
|
|
|
|
private fun LazyListState.bottomDistancePx(itemCount: Int): Int? {
|
|
|
|
|
val info = layoutInfo
|
|
|
|
|
val last = info.visibleItemsInfo.lastOrNull()
|
|
|
|
|
return chatBottomDistancePx(
|
|
|
|
|
lastVisibleIndex = last?.index ?: -1,
|
|
|
|
|
lastVisibleEndPx = last?.let { it.offset + it.size } ?: 0,
|
|
|
|
|
itemCount = itemCount,
|
|
|
|
|
viewportEndPx = info.viewportEndOffset,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The in-flight turn indicator: a spinner, `Working…` and the turn's live elapsed
|
|
|
|
|
* time. The elapsed value is derived from the turn's own start ([ChatThread.elapsedMillis]),
|
|
|
|
|