feat(apps): 重构 UI 架构为 presentation 层并新增 l10n 国际化支持
This commit is contained in:
@@ -8,6 +8,12 @@ This file governs `apps/**` (Flutter). Keep rules strict, short, and reusable.
|
||||
- If rules conflict, apply the stricter one.
|
||||
- Visual language source of truth: `apps/rules/visual_design_language.md`.
|
||||
|
||||
## Flutter Directory Contract (Must)
|
||||
|
||||
- `apps/lib` only allows these second-level directories: `app/`, `core/`, `data/`, `features/`, `shared/`, `l10n/`.
|
||||
- `apps/lib/main.dart` is the only allowed root entry file.
|
||||
- Do not add new second-level directories under `apps/lib` without explicit approval.
|
||||
|
||||
## UI Design System (Must)
|
||||
|
||||
- Use design tokens only from `apps/lib/core/theme/design_tokens.dart` (`AppColors`, `AppSpacing`, `AppRadius`).
|
||||
@@ -33,6 +39,14 @@ This file governs `apps/**` (Flutter). Keep rules strict, short, and reusable.
|
||||
- Lifecycle events are mandatory: `RUN_STARTED` and exactly one of `RUN_FINISHED` or `RUN_ERROR`.
|
||||
- Text streaming flow must be `TEXT_MESSAGE_START -> TEXT_MESSAGE_CONTENT -> TEXT_MESSAGE_END`.
|
||||
|
||||
## HTTP Error Parse Contract (Must)
|
||||
|
||||
- Frontend must parse backend errors as RFC7807: `type/title/status/detail/instance` + extension `code/params`.
|
||||
- Error code registry single source of truth: `docs/protocols/common/http-error-codes.md`.
|
||||
- Frontend mapping must be based on documented `code` only (`code -> l10n key`), not inferred from `detail` text.
|
||||
- Any new/changed code requires protocol doc update first, then frontend mapping update.
|
||||
- Unknown code fallback order: status-generic localized message -> safe generic localized message.
|
||||
|
||||
## High-Risk Modules (Must)
|
||||
|
||||
### Auth
|
||||
|
||||
Reference in New Issue
Block a user