refactor: 移除前端 Mock API,新增共享组件,优化认证流程
- 删除 mock_api_client、mock_calendar_service、mock_history_service - 新增 fixed_length_code_input、link_button、message_composer 共享组件 - 优化登录/注册/密码重置页面使用新组件 - 简化 injection.dart 移除 mock 分支 - 更新 env.dart 配置(BACKEND_URL 替换 API_URL) - 后端 agentscope 工具和测试更新 - 重构 AGENTS.md 文档结构 - 新增 deploy/ 目录和 protocol 文档
This commit is contained in:
+16
-11
@@ -2,6 +2,13 @@
|
||||
|
||||
This document defines **hard constraints** for Flutter mobile development. Treat all items as **non-negotiable** unless explicitly overridden.
|
||||
|
||||
## 0) Scope and Precedence (MUST)
|
||||
|
||||
- This file applies to all changes under `apps/**`.
|
||||
- It extends root routing rules in `AGENTS.md` and workspace global runtime rules.
|
||||
- If rules conflict, apply the stricter requirement.
|
||||
- Keep Flutter-specific constraints in this file; avoid duplicating them in root `AGENTS.md`.
|
||||
|
||||
## 1) Design Tokens (MUST)
|
||||
|
||||
- **MUST** use design tokens from `apps/lib/core/theme/design_tokens.dart`:
|
||||
@@ -32,13 +39,17 @@ This document defines **hard constraints** for Flutter mobile development. Treat
|
||||
- If persistent header/footer regions exist, **MUST** center primary content within the remaining usable region.
|
||||
- **MUST** prioritize *visual centering* over purely geometric centering when they differ.
|
||||
|
||||
## 5) Quality Gate for Important Screens (MUST)
|
||||
## 5) Testing Strategy (MUST)
|
||||
|
||||
For important screens:
|
||||
Follow lightweight testing strategy - prioritize value over coverage:
|
||||
|
||||
- **MUST** add widget tests to reduce layout regression risk:
|
||||
- Verify primary content stays centered relative to the usable viewport.
|
||||
- Include at least one constrained scenario (e.g., small height **or** large text scale).
|
||||
**Write tests for:**
|
||||
- Model / DTO parsing (json → model)
|
||||
- Service layer logic (business rules, API call handling)
|
||||
- Complex custom widgets with rich interactions
|
||||
|
||||
**Skip for:**
|
||||
- Simple UI pages, regular buttons, basic layouts
|
||||
|
||||
## 6) UI Feedback System (MUST)
|
||||
|
||||
@@ -62,9 +73,3 @@ Agent chat functionality **MUST** follow the AG-UI protocol. **Use the `ag-ui` s
|
||||
- **MUST NOT** return non-streaming responses for agent chat.
|
||||
- **MUST NOT** omit required lifecycle events.
|
||||
- **MUST NOT** use non-AG-UI event formats (except where the spec explicitly allows).
|
||||
|
||||
## 8) Debugging Behavior (MUST)
|
||||
|
||||
- **MUST NOT** automatically start Flutter app debugging or running.
|
||||
- After code changes, **MUST** instruct the user to run manually (user-controlled):
|
||||
- `flutter run --dart-define=MOCK_API=true -d emulator-5554`
|
||||
|
||||
Reference in New Issue
Block a user