Sheet's busy bar still in previews; new-chat choice and greeting scroll
CI / check (push) Canceled after 0s

- The assistant sheet's indeterminate progress bar is an endless animation,
  which kept the screenshot test for "writing" from ever settling (CI run 28
  sat in the unit tests). In inspection mode it is a still bar, as Writing()
  already does for its dots.
- Run 27's 360x640 at 1.5x type showed the Chat / Agent chat cards pushing the
  greeting off the page. The choice and the greeting now share one scroll; on a
  tall phone the greeting still sits in the middle of what is left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-11-10 08:36:03 +00:00
1 parent 21e5de2d73
commit 6a7d129d09
2 files changed
+41 -30

No files matched your search

@@ -240,7 +240,9 @@ fun ColumnScope.AssistSheetContent(
}
}
if (state.busy) {
LinearProgressIndicator(Modifier.fillMaxWidth().padding(horizontal = 16.dp).height(2.dp))
val bar = Modifier.fillMaxWidth().padding(horizontal = 16.dp).height(2.dp)
// A preview (the screenshot tests) cannot wait out an endless animation: a still bar there.
if (LocalInspectionMode.current) LinearProgressIndicator(progress = { 0.4f }, modifier = bar) else LinearProgressIndicator(bar)
} else {
Spacer(Modifier.height(2.dp))
}
@@ -10,6 +10,7 @@ import androidx.compose.foundation.gestures.scrollBy
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.IntrinsicSize
@@ -431,39 +432,47 @@ private fun Greeting(
modifier: Modifier = Modifier,
) {
val palette = LocalPalette.current
Column(modifier.fillMaxSize()) {
if (onKind != null) KindChoice(agent, onKind, Modifier.padding(horizontal = 16.dp, vertical = 8.dp))
if (agent && state.devices.isEmpty() && !state.loading) {
if (agent && state.devices.isEmpty() && !state.loading) {
Column(modifier.fillMaxSize()) {
if (onKind != null) KindChoice(agent, onKind, Modifier.padding(horizontal = 16.dp, vertical = 8.dp))
LinkComputer(state.instanceBase, onRecheck, Modifier.weight(1f))
return@Column
}
Column(
Modifier.weight(1f).fillMaxWidth().padding(horizontal = 32.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
if (agent) {
Box(Modifier.size(64.dp).background(palette.accentSoft, RoundedCornerShape(20.dp)), contentAlignment = Alignment.Center) {
Icon(Icons.Filled.Terminal, contentDescription = null, tint = palette.accent, modifier = Modifier.size(32.dp))
}
Spacer(Modifier.height(20.dp))
Text(stringResource(R.string.agent_greeting), style = MaterialTheme.typography.headlineSmall, textAlign = TextAlign.Center)
Spacer(Modifier.height(8.dp))
val device = state.device
val where = when {
device == null -> stringResource(R.string.agent_no_device)
return
}
// One scroll for the choice and the greeting, so a small phone at large type still reaches
// both; on a tall one the greeting sits in the middle of what is left.
BoxWithConstraints(modifier.fillMaxSize()) {
val room = maxHeight
Column(Modifier.fillMaxSize().verticalScroll(rememberScrollState())) {
if (onKind != null) KindChoice(agent, onKind, Modifier.padding(horizontal = 16.dp, vertical = 8.dp))
Column(
Modifier.fillMaxWidth().heightIn(min = room * 0.6f).padding(horizontal = 32.dp, vertical = 16.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
if (agent) {
Box(Modifier.size(64.dp).background(palette.accentSoft, RoundedCornerShape(20.dp)), contentAlignment = Alignment.Center) {
Icon(Icons.Filled.Terminal, contentDescription = null, tint = palette.accent, modifier = Modifier.size(32.dp))
}
Spacer(Modifier.height(20.dp))
Text(stringResource(R.string.agent_greeting), style = MaterialTheme.typography.headlineSmall, textAlign = TextAlign.Center)
Spacer(Modifier.height(8.dp))
val device = state.device
val where = when {
device == null -> stringResource(R.string.agent_no_device)
else -> stringResource(
R.string.agent_runs_on,
device.name.ifBlank { device.host },
state.draft.directory.ifBlank { stringResource(R.string.agent_directory_default) },
)
else -> stringResource(
R.string.agent_runs_on,
device.name.ifBlank { device.host },
state.draft.directory.ifBlank { stringResource(R.string.agent_directory_default) },
)
}
TextButton(onClick = onTune) { Text(where, textAlign = TextAlign.Center, color = palette.inkMuted) }
} else {
ModelAvatar(state.modelInfo, state.modelId ?: "?", size = 64.dp)
Spacer(Modifier.height(20.dp))
Text(stringResource(R.string.empty_chat), style = MaterialTheme.typography.headlineSmall, textAlign = TextAlign.Center)
}
TextButton(onClick = onTune) { Text(where, textAlign = TextAlign.Center, color = palette.inkMuted) }
} else {
ModelAvatar(state.modelInfo, state.modelId ?: "?", size = 64.dp)
Spacer(Modifier.height(20.dp))
Text(stringResource(R.string.empty_chat), style = MaterialTheme.typography.headlineSmall, textAlign = TextAlign.Center)
}
}
}