feat(apps): 重构 UI 架构为 presentation 层并新增 l10n 国际化支持

This commit is contained in:
qzl
2026-03-27 14:05:03 +08:00
parent b1f0eb8921
commit c592cc7854
178 changed files with 10748 additions and 5764 deletions
@@ -2,10 +2,10 @@ import 'package:json_annotation/json_annotation.dart';
part 'tool_result.g.dart';
/// Schema 版本常量
/// Default schema version.
const _defaultSchemaVersion = 'v1';
/// 工具执行结果(给 AI 的原始数据)
/// Raw tool execution result used by the assistant runtime.
@JsonSerializable()
class ToolResult {
final String? eventId;
@@ -20,7 +20,7 @@ class ToolResult {
Map<String, dynamic> toJson() => _$ToolResultToJson(this);
}
/// UI 卡片 Schema(给 UI 渲染)
/// UI card schema consumed by frontend renderers.
@JsonSerializable()
class UiCard {
@JsonKey(name: 'type')
@@ -44,7 +44,7 @@ class UiCard {
Map<String, dynamic> toJson() => _$UiCardToJson(this);
}
/// 卡片操作按钮
/// Action button metadata for a UI card.
@JsonSerializable()
class CardAction {
final String type;
@@ -65,7 +65,7 @@ class CardAction {
Map<String, dynamic> toJson() => _$CardActionToJson(this);
}
/// 日历卡片数据
/// Calendar card payload data.
@JsonSerializable()
class CalendarCardData {
final String id;
@@ -5,7 +5,7 @@ import 'dart:typed_data';
import 'package:dio/dio.dart';
import 'package:image_picker/image_picker.dart';
import 'package:social_app/core/api/i_api_client.dart';
import 'package:social_app/core/network/i_api_client.dart';
import '../models/ag_ui_event.dart';
@@ -155,8 +155,8 @@ class AgUiService {
}
bool hasEarlierHistory(DateTime fromDate) {
// 历史是否还有更多由后端 history snapshothasMore 驱动。
// 参数保留是为了兼容 ChatBloc 现有调用签名。
// Whether earlier history exists is driven by backend snapshot.hasMore.
// Keep the parameter for compatibility with the current ChatBloc signature.
final _ = fromDate;
return _hasMoreHistory;
}