Add manual overview refresh actions
This commit is contained in:
1 parent
6f7a4399e5
commit
ad1cae7f18
4 files changed
+49
No files matched your search
@@ -326,12 +326,19 @@ private fun OpenClawRoot(appState: OpenClawAppState) {
|
|||||||
status = appState.repository.status,
|
status = appState.repository.status,
|
||||||
availableAgents = appState.repository.availableAgents,
|
availableAgents = appState.repository.availableAgents,
|
||||||
currentTheme = appState.themeMode,
|
currentTheme = appState.themeMode,
|
||||||
|
isRefreshing = appState.isSyncing,
|
||||||
onSelectAgent = { agent ->
|
onSelectAgent = { agent ->
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
appState.updateDefaultAgent(agent)
|
appState.updateDefaultAgent(agent)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelectTheme = appState::updateTheme,
|
onSelectTheme = appState::updateTheme,
|
||||||
|
onRefreshOverview = {
|
||||||
|
coroutineScope.launch {
|
||||||
|
appState.clearSyncError()
|
||||||
|
appState.syncRemoteIfNeeded()
|
||||||
|
}
|
||||||
|
},
|
||||||
onDisconnect = appState::disconnect,
|
onDisconnect = appState::disconnect,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -341,12 +348,19 @@ private fun OpenClawRoot(appState: OpenClawAppState) {
|
|||||||
status = appState.repository.status,
|
status = appState.repository.status,
|
||||||
availableAgents = appState.repository.availableAgents,
|
availableAgents = appState.repository.availableAgents,
|
||||||
currentTheme = appState.themeMode,
|
currentTheme = appState.themeMode,
|
||||||
|
isRefreshing = appState.isSyncing,
|
||||||
onSelectAgent = { agent ->
|
onSelectAgent = { agent ->
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
appState.updateDefaultAgent(agent)
|
appState.updateDefaultAgent(agent)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelectTheme = appState::updateTheme,
|
onSelectTheme = appState::updateTheme,
|
||||||
|
onRefreshOverview = {
|
||||||
|
coroutineScope.launch {
|
||||||
|
appState.clearSyncError()
|
||||||
|
appState.syncRemoteIfNeeded()
|
||||||
|
}
|
||||||
|
},
|
||||||
onDisconnect = appState::disconnect,
|
onDisconnect = appState::disconnect,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+26
@@ -66,6 +66,32 @@ fun SessionListScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
) {
|
||||||
|
if (isLoading) {
|
||||||
|
CircularProgressIndicator(modifier = Modifier.padding(end = 4.dp))
|
||||||
|
Text(
|
||||||
|
text = "同步中",
|
||||||
|
style = MaterialTheme.typography.bodySmall,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
modifier = Modifier.weight(1f),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Text(
|
||||||
|
text = "",
|
||||||
|
modifier = Modifier.weight(1f),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
TextButton(onClick = onRetry, enabled = !isLoading) {
|
||||||
|
Text("刷新")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
item {
|
item {
|
||||||
Card(modifier = Modifier.fillMaxWidth()) {
|
Card(modifier = Modifier.fillMaxWidth()) {
|
||||||
|
|||||||
+8
@@ -28,8 +28,10 @@ fun SettingsScreen(
|
|||||||
status: ServerStatus,
|
status: ServerStatus,
|
||||||
availableAgents: List<String>,
|
availableAgents: List<String>,
|
||||||
currentTheme: AppThemeMode,
|
currentTheme: AppThemeMode,
|
||||||
|
isRefreshing: Boolean,
|
||||||
onSelectAgent: (String) -> Unit,
|
onSelectAgent: (String) -> Unit,
|
||||||
onSelectTheme: (AppThemeMode) -> Unit,
|
onSelectTheme: (AppThemeMode) -> Unit,
|
||||||
|
onRefreshOverview: () -> Unit,
|
||||||
onDisconnect: () -> Unit,
|
onDisconnect: () -> Unit,
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
@@ -138,6 +140,12 @@ fun SettingsScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Button(onClick = onRefreshOverview, modifier = Modifier.fillMaxWidth(), enabled = !isRefreshing) {
|
||||||
|
Text(if (isRefreshing) "同步中…" else "立即同步")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
Button(onClick = onDisconnect, modifier = Modifier.fillMaxWidth()) {
|
Button(onClick = onDisconnect, modifier = Modifier.fillMaxWidth()) {
|
||||||
Text("退出登录并重新连接")
|
Text("退出登录并重新连接")
|
||||||
|
|||||||
@@ -457,3 +457,4 @@ Android/iOS App
|
|||||||
- 2026-03-07:继续收会话列表层级:最近访问卡降级成更轻的普通卡片,入口文案从“继续”改成“打开”;列表项把更新时间提到标题行右侧,底部只保留必要状态,置顶操作从文字按钮降成星标符号按钮,减少每项底部操作重量。
|
- 2026-03-07:继续收会话列表层级:最近访问卡降级成更轻的普通卡片,入口文案从“继续”改成“打开”;列表项把更新时间提到标题行右侧,底部只保留必要状态,置顶操作从文字按钮降成星标符号按钮,减少每项底部操作重量。
|
||||||
- 2026-03-07:继续压缩会话页头部:SectionHeader 标题字号和行距再收一档,统计文案改成更短的辅助信息;列表整体纵向间距减小,搜索框去掉表单式 label,改成更轻的 placeholder 搜索,减少头部在首屏占用的垂直空间。
|
- 2026-03-07:继续压缩会话页头部:SectionHeader 标题字号和行距再收一档,统计文案改成更短的辅助信息;列表整体纵向间距减小,搜索框去掉表单式 label,改成更轻的 placeholder 搜索,减少头部在首屏占用的垂直空间。
|
||||||
- 2026-03-07:继续细化聊天时间线层级:system notice 改成更轻的窄条样式,thinking 去掉大 pill 改为更轻的 loading 行,tool error 文案收成“执行失败”并统一到更明显的错误容器语义,让过渡态 / 系统态 / 错误态和正式聊天消息的层级更清楚。
|
- 2026-03-07:继续细化聊天时间线层级:system notice 改成更轻的窄条样式,thinking 去掉大 pill 改为更轻的 loading 行,tool error 文案收成“执行失败”并统一到更明显的错误容器语义,让过渡态 / 系统态 / 错误态和正式聊天消息的层级更清楚。
|
||||||
|
- 2026-03-07:开始补主动自救能力:会话页新增常驻“刷新”入口,不再只有报错卡里才有重试;设置页新增“立即同步”入口,让用户能主动拉取状态 / agents / 会话列表,而不是只能等后台轮询或进详情页触发刷新。
|
||||||
Reference in new issue
Block a user