feat: 增强 HomeScreen 录音交互与 ChatBloc 状态管理
- 新增录音启动延迟处理,解决权限未就绪时的竞态问题 - 实现历史分页滚动位置保持,提升加载体验 - 添加文本输入框点击键盘显示与焦点管理 - 优化 ChatBloc provider 到 MultiBlocProvider 支持 - 修复 ApiException 429 错误详情解析(支持 JSON 字符串 body) - 改进 LocalNotificationService 精确闹钟权限请求 - 优化 UiSchemaRenderer GridView children 生成 - 支持导航 action 的 replace 参数 - 移除 Agent router 速率限制逻辑(_allow_run_request, _allow_transcribe_request) - 补充相关单元测试与集成测试
This commit is contained in:
@@ -75,7 +75,6 @@ class UiSchemaRenderer {
|
||||
).whereType<Map<String, dynamic>>().map(_renderNode).toList();
|
||||
final columns = _asInt(node['columns'], fallback: 2).clamp(1, 3);
|
||||
final gap = _asDouble(node['gap'], fallback: AppSpacing.sm);
|
||||
final tiles = List.generate(children.length, (index) => children[index]);
|
||||
return _wrapSurface(
|
||||
node,
|
||||
GridView.count(
|
||||
@@ -85,7 +84,7 @@ class UiSchemaRenderer {
|
||||
childAspectRatio: 1.6,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
children: tiles,
|
||||
children: children,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -233,6 +232,7 @@ class UiSchemaRenderer {
|
||||
}
|
||||
|
||||
final params = _asMap(action['params']);
|
||||
final replace = action['replace'] == true;
|
||||
final queryParams = _extractNavigationQueryParams(params);
|
||||
try {
|
||||
final baseUri = Uri.parse(path);
|
||||
@@ -240,7 +240,12 @@ class UiSchemaRenderer {
|
||||
final targetUri = baseUri.replace(
|
||||
queryParameters: mergedQueryParams.isEmpty ? null : mergedQueryParams,
|
||||
);
|
||||
context.go(targetUri.toString());
|
||||
final target = targetUri.toString();
|
||||
if (replace) {
|
||||
context.replace(target);
|
||||
return;
|
||||
}
|
||||
context.push(target);
|
||||
} on FormatException {
|
||||
Toast.show(context, '导航路径无效', type: ToastType.warning);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user