Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ fun SessionChatScreen(
errorMessage = uiState.errorMessage,
reviewChangesSummary = uiState.reviewChangesSummary,
syncingIndicatorLabel = uiState.syncingIndicatorLabel,
workingIndicatorLabel = uiState.workingIndicatorLabel,
sessionTodosVisible = sessionTodosPillVisible,
sessionTodoCompletedCount = uiState.sessionTodoCompletedCount,
sessionTodoTotalCount = uiState.sessionTodoTotalCount,
Expand Down Expand Up @@ -563,9 +564,6 @@ fun SessionChatScreen(
hasPermission = uiState.permissionRequest != null,
hasQuestion = uiState.questionRequest != null,
)
uiState.workingIndicatorLabel?.let { label ->
SessionChatRunningAccessory(label = label)
}
val composerState =
when (composerKind) {
SessionChatComposerKind.Permission -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.opencode.mobile.ui.sessionchat

/**
* Composer-adjacent Session Running accessory. Show iff this session's
* Last-timeline-row Session Running chrome. Show iff this session's
* status is not idle. Optimistic busy on send is the same status. Do not
* inspect messages, streaming, tools, or thought rows. Hide only when a
* permission or question dock is waiting on the user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -87,6 +88,7 @@ internal data class SessionChatTimelineViewProps(
val errorMessage: String?,
val reviewChangesSummary: ReviewChangesSummary?,
val syncingIndicatorLabel: String? = null,
val workingIndicatorLabel: String? = null,
val sessionTodosVisible: Boolean = false,
val sessionTodoCompletedCount: Int = 0,
val sessionTodoTotalCount: Int = 0,
Expand Down Expand Up @@ -159,6 +161,7 @@ internal fun SessionChatTimelineView(
isRefreshing = props.isRefreshing,
reviewChangesSummary = props.reviewChangesSummary,
syncingIndicatorLabel = props.syncingIndicatorLabel,
workingIndicatorLabel = props.workingIndicatorLabel,
sessionTodosVisible = props.sessionTodosVisible,
sessionTodoCompletedCount = props.sessionTodoCompletedCount,
sessionTodoTotalCount = props.sessionTodoTotalCount,
Expand Down Expand Up @@ -188,6 +191,7 @@ private fun SessionChatTimelineReadyView(
isRefreshing: Boolean,
reviewChangesSummary: ReviewChangesSummary?,
syncingIndicatorLabel: String?,
workingIndicatorLabel: String?,
sessionTodosVisible: Boolean,
sessionTodoCompletedCount: Int,
sessionTodoTotalCount: Int,
Expand Down Expand Up @@ -278,6 +282,20 @@ private fun SessionChatTimelineReadyView(
bottom = bottomOverlayInset,
),
key = { message -> message.id },
statusIndicatorKey =
if (workingIndicatorLabel != null) {
SESSION_CHAT_STATUS_INDICATOR_KEY
} else {
null
},
statusIndicatorContent =
if (workingIndicatorLabel != null) {
{
SessionChatWorkingIndicatorRow(label = workingIndicatorLabel)
}
} else {
null
},
) { message, isNewestMessage, onContentSizeSettled ->
SessionChatMessageRow(
message = message,
Expand Down Expand Up @@ -683,6 +701,29 @@ private fun ToolStatus.toToolCallCardStatus(): OpenCodeToolCallCardStatus =
}

private const val SESSION_CHAT_BOTTOM_ANCHOR_KEY = "session-chat-timeline-bottom"
private const val SESSION_CHAT_STATUS_INDICATOR_KEY = "session-chat-status-indicators"

/** Feature-local Working/Retrying/Compacting status chrome (not prose). */
@Composable
private fun SessionChatWorkingIndicatorRow(label: String) {
Row(
modifier =
Modifier
.fillMaxWidth()
.padding(start = 4.dp, top = 12.dp, bottom = 8.dp)
.semantics { contentDescription = label },
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
SessionChatWorkingStatusDot()
Text(
text = label,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Spacer(modifier = Modifier.weight(1f))
}
}

@Composable
private fun SessionChatWorkingStatusDot() {
Expand Down
4 changes: 2 additions & 2 deletions docs/design-system/components/syncing-pill.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Feature screens own **when** the pill appears (`syncingIndicatorLabel` /

Presentational only. Does not accept taps. Callers overlay it centered near the
top of the scrolling timeline. Session busy chrome (`Working` / `Retrying` /
`Compacting…`) is the composer-adjacent Session Running accessory, not this
pill and not a timeline row. See
`Compacting…`) is the last-timeline-row Session Running chrome, not this
pill. See
[`session-chat` Session Running accessory](../../features/session-chat/plan.md#session-running-accessory).

Accessibility: expose the label as a status announcement (for example
Expand Down
29 changes: 14 additions & 15 deletions docs/features/session-chat/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ Still binding:
- `SessionChatViewModel` is a thin facade. Timeline, composer, and SessionInfo
are regions.
- Timeline is oldest-to-newest. Pin to bottom when auto-follow is armed.
- Session Running accessory (composer busy accessory): show iff this
session’s status is not idle. Optimistic busy on send is the same
status. Do not inspect messages, streaming, tools, or thought rows.
Pin it above the composer, left-aligned; do not put it in the
timeline. Labels from status only: `Working` (busy, including
optimistic busy after send), `Retrying`, `Compacting…`. Never
`Thinking` — that word stays on the thought row. Hide only when the
permission or question dock is up; child lockout does not hide it if
that session is still busy. The old hide-when-tools-run / hide-when-
last-turn-has-in-progress-assistant-content rule is revoked: it hid
the lamp for the stretch TUI still shows busy (`session_status !==
idle`). `WorkingTurnIndicator` collapses to status + compacting +
awaiting-user. SessionInfo owns session status; the composer region
owns accessory layout; the facade does not scan parts. The timeline
status-indicator slot is retired.
- Session Running chrome: show iff this session’s status is not idle.
Optimistic busy on send is the same status. Do not inspect messages,
streaming, tools, or thought rows. Place it as the last timeline row
with a stable list identity; do not pin it to the composer. Labels
from status only: `Working` (busy, including optimistic busy after
send), `Retrying`, `Compacting…`. Never `Thinking` — that word stays
on the thought row. Hide only when the permission or question dock is
up; child lockout does not hide it if that session is still busy. The
old hide-when-tools-run / hide-when-last-turn-has-in-progress-
assistant-content rule stays revoked: it hid the lamp for the stretch
TUI still shows busy (`session_status !== idle`).
`WorkingTurnIndicator` collapses to status + compacting +
awaiting-user. SessionInfo owns session status; the timeline owns
last-row layout; the facade does not scan parts.
- Child sessions are read-only from the composer.
- Device attachments use Photos/Files. Project `file://` browse was not in
the first attachment slice.
Expand Down
36 changes: 18 additions & 18 deletions docs/features/session-chat/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ is a thin facade. Any change to the facade is an architectural decision — see
- Composer selector changes for model, mode, and Variant.
- Session status bar showing session id copy, SSE state (`live`, `connecting`,
`offline`), and context usage when token and model-limit data are available.
- Session Running accessory above the composer when session status is not idle
- Session Running chrome as the last timeline row when session status is not idle
(`Working`, `Retrying`, `Compacting…`).

## Error States
Expand Down Expand Up @@ -97,23 +97,24 @@ is a thin facade. Any change to the facade is an architectural decision — see
- The attachment `+` opens native Photos and Files/document entry points through
the delivered [File Attachments](../file-attachments/plan.md) slice. It uses
**Add attachment** rather than the legacy **Attach context** label.
- When this session’s status is not idle, a Session Running accessory sits
above the composer. See [Session Running accessory](#session-running-accessory).
- When this session’s status is not idle, Session Running chrome is the last
timeline row. See [Session Running accessory](#session-running-accessory).

## Session Running accessory

Composer-adjacent busy chrome for the open session. Same left-aligned caption
Last-timeline-row busy chrome for the open session. Same left-aligned caption
plus pulsing 6pt/dp status dot as thought-row Working/Thinking chrome.
Feature-local: not a Component Collection primitive. It is Session Chat
composer-adjacent status only, the same visual as the thought-row streaming
timeline status only, the same visual as the thought-row streaming
dot, and is not used on other screens.

Show iff this session’s status is not idle. Optimistic busy on send counts as
the same status. Do not inspect messages, streaming, tools, or thought rows.
Always the last list entry while visible; do not pin it to the composer.

`SessionInfo` owns session status. `SessionChatComposer` owns accessory layout.
`WorkingTurnIndicator` collapses to status + compacting + awaiting-user. The
timeline status-indicator slot is retired.
`SessionInfo` owns session status. The timeline owns last-row layout and a
stable list identity. `WorkingTurnIndicator` collapses to status + compacting +
awaiting-user.

### Labels (one slot, status only)

Expand All @@ -125,16 +126,15 @@ Not `Thinking`. That word stays on the thought row while reasoning is open.

### Expected results (iOS and Android)

- [x] After Send, `Working` appears immediately (optimistic busy), above the
composer, left-aligned, and does not scroll with the timeline.
- [x] While SSE reports busy, `Working` stays visible, including while tools
run and after a thought row settles to `Thought` / `Thought · Nms`.
- [x] After Send, `Working` appears immediately (optimistic busy) as the last
timeline row, left-aligned.
- [x] While SSE reports busy, `Working` stays visible as that same last row,
including while tools run and after a thought row settles to `Thought` /
`Thought · Nms`.
- [x] Retry shows `Retrying`. Compact in flight shows `Compacting…`.
- [x] The accessory hides when session status is idle.
- [x] The accessory hides while the permission or question dock is up. Child
- [x] The row hides when session status is idle.
- [x] The row hides while the permission or question dock is up. Child
lockout does not hide it if that session is still busy.
- [x] Timeline bottom inset includes the accessory height so the last bubbles
are not covered.
- [x] Top-bar SSE chrome (`live` / `connecting` / `offline`) is unchanged.
- [x] Thought-row chrome is unchanged (`Thinking` with pulsing dot while
reasoning streams; `Thought` / `Thought · Nms` with no dot when finished).
Expand Down Expand Up @@ -173,6 +173,6 @@ Not `Thinking`. That word stays on the thought row while reasoning is open.
Variant).
- Use **`OpenCodeOutgoingMessage`** for sent prompts and
**`OpenCodeAssistantMessage`** for assistant text blocks.
- Session Running accessory is feature-local (pulsing 6pt/dp status dot already
- Session Running chrome is feature-local (pulsing 6pt/dp status dot already
used on thought-row chrome). Do not add it to Component Collection: it is
Session Chat composer-adjacent status only and is not used on other screens.
Session Chat last-timeline-row status only and is not used on other screens.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ struct SessionChatRow: Identifiable, Equatable {

extension SessionChatRow: MessageListTimelineHeightEstimating {
var timelineRowHeightEstimate: CGFloat {
if id == SessionChatStatusChrome.workingRowID {
return MessageListTimelineRowHeightEstimate.fallback(
characterCount: text.count,
style: .compact
)
}
let style: MessageListTimelineRowHeightEstimate.Style =
switch role {
case .user:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ struct SessionChatView: View {
errorMessage: viewModel.uiState.errorMessage,
reviewChangesSummary: viewModel.uiState.reviewChangesSummary,
syncingIndicatorLabel: viewModel.uiState.syncingIndicatorLabel,
workingIndicatorLabel: viewModel.uiState.workingIndicatorLabel,
sessionTodosVisible: sessionTodosPillVisible,
sessionTodoCompletedCount: viewModel.uiState.sessionTodoCompletedCount,
sessionTodoTotalCount: viewModel.uiState.sessionTodoTotalCount,
Expand Down Expand Up @@ -291,9 +292,6 @@ struct SessionChatView: View {
.padding(.bottom, 4)
}
}
if let label = viewModel.uiState.workingIndicatorLabel {
SessionChatRunningAccessory(label: label)
}
composer
}
// Match home SessionList dock measurement — preference keys from a
Expand Down
Loading
Loading