mirror of
https://github.com/block/buzz.git
synced 2026-10-27 12:40:30 +00:00
[codex] Add mobile chat timeline rendering and hardening (#327)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
49
AGENTS.md
49
AGENTS.md
@@ -129,6 +129,55 @@ just desktop-app # full Tauri app with native shell
|
||||
|
||||
---
|
||||
|
||||
## Mobile App (Flutter)
|
||||
|
||||
The mobile app lives in `mobile/` — a Flutter app using Riverpod + Hooks.
|
||||
|
||||
### Architecture
|
||||
|
||||
- **State management:** Riverpod + `flutter_hooks` (`HookConsumerWidget`)
|
||||
- **Theme:** Catppuccin Latte (light) / Macchiato (dark) — matches desktop
|
||||
- **Features:** Isolated under `lib/features/`, shared code in `lib/shared/`
|
||||
- **Nostr models:** `lib/shared/relay/nostr_models.dart` — event kinds must
|
||||
stay in sync with `desktop/src/shared/constants/kinds.ts`
|
||||
|
||||
### Rules
|
||||
|
||||
- **NEVER use `StatefulWidget`** — always use `HookConsumerWidget` or
|
||||
`ConsumerWidget` with `flutter_hooks` for local state.
|
||||
- **NEVER run `flutter run`, `flutter build`, `flutter clean`, or
|
||||
`flutter upgrade`** — only `flutter test`, `flutter analyze`, and
|
||||
`dart format` are safe for agents to run.
|
||||
- **Do NOT use `print()`** — use `debugPrint()` or structured logging.
|
||||
- Prefer `context.colors` and `context.textTheme` (via theme extensions)
|
||||
over raw `Theme.of(context)` calls.
|
||||
- Keep widgets small and composable.
|
||||
- Feature modules must not import from other feature modules — only from
|
||||
`shared/`.
|
||||
- Use `Grid` tokens for spacing, `Radii` for border radius.
|
||||
|
||||
### Quality Checks
|
||||
|
||||
```bash
|
||||
cd mobile
|
||||
dart format --output=none --set-exit-if-changed .
|
||||
flutter analyze
|
||||
flutter test
|
||||
```
|
||||
|
||||
Or from repo root: `just mobile-check` and `just mobile-test`.
|
||||
|
||||
### Testing Conventions
|
||||
|
||||
- Prefer **widget tests** over unit tests for UI components — test the
|
||||
whole widget tree, not individual methods.
|
||||
- Use `ProviderScope(overrides: [...])` to inject fake notifiers.
|
||||
- Fake notifiers should extend the real notifier class and override `build()`.
|
||||
- Use the `WidgetHelpers.testable()` wrapper for simple widget tests or
|
||||
build a custom `ProviderScope` + `MaterialApp` when you need specific overrides.
|
||||
|
||||
---
|
||||
|
||||
## See Also
|
||||
|
||||
- [CONTRIBUTING.md](CONTRIBUTING.md) — setup, code style, PR process, how to add event kinds / MCP tools / API endpoints
|
||||
|
||||
Reference in New Issue
Block a user