Commit 4c92d58
chore: 12-iter autonomous maintenance pass — dispose-hazard sweep, pana 160/160, RTL story
Twelve iterations of unattended package maintenance on a 9-min /loop. No
version bump (deferred to next release tag); all changes additive and
backwards-compatible. 278 → 330 tests, pana 160/160, zero analyzer issues.
Code quality:
- Timer-leak audit: `Future.delayed` / `Timer` calls across `lib/src/` are
now tracked + cancelled in `dispose()` on `ChatMessagesController`,
`ActionController`, `StreamingTextWidget`, `AnimatedBubble`,
`CopilotTextarea`. Fixes the `!timersPending` test failures plus a
latent `setState`-from-dispose crash in `CopilotTextarea._hideSuggestions`.
- StreamSubscription audit: `AgentOrchestrator` now tracks per-agent state
subscriptions and cancels them on `unregisterAgent` / before its
broadcast controllers close. Re-registering an agent under an existing
id cancels the orphan.
- Frame-callback audit: `mounted` guards on the two real
`addPostFrameCallback` hazards (`SmartChatInput` autoFocus,
`CustomChatWidget` scroll-controller connection).
Tests (+52): new `test/agents/example_agents_test.dart` (21),
`test/controllers/agent_orchestrator_test.dart` (24 covering registration,
routing, delegation, collaboration, streaming, error handling, dispose,
stream-sub lifecycle), `test/widgets/dispose_hazard_test.dart`,
`test/widgets/rtl_chat_test.dart`.
Docs / SEO / discoverability:
- New `AGENTS.md` — LLM-tuned package reference for AI coding assistants
picking dependencies.
- `pubspec.yaml` topics expanded to 10 (ai, chat, llm, streaming, agent,
markdown, rtl, openai, anthropic, gemini); description rewritten.
- README: Quick Start moved above Features, new RTL section with verified
snippet, install snippet bumped to ^2.11.1, example menu synced.
- Dartdoc raised on top public types (`AiChatWidget`,
`ChatMessagesController`, `ChatMessage`, `AiActionProvider`,
`AiActionConfig`, `AiActionHook`, `AiActionBuilder`, `AgentOrchestrator`)
— class summaries, primary-constructor docs, runnable code-example
blocks, per-member docs. `dart doc --validate-links` clean.
Dependencies:
- `flutter_streaming_text_markdown` ^1.4.0 → ^1.8.0 (lands the 1.7.0
Arabic/RTL word-splitting fix + emoji-resume fix + trailing-fade fix).
- `google_fonts` ^8.0.1 → ^8.1.0.
Tooling:
- New `.github/workflows/ci.yml`: `dart format --set-exit-if-changed`,
`flutter analyze --fatal-infos` (root + example), `flutter test` on
push / PR to main. The formatter step exists because
`flutter analyze` does not catch formatter drift and pana's
lint+format check (50/50 of pub.dev score) silently dropped during
iter 6 from a dartdoc edit exceeding 80 cols.
RTL example app:
- New `example/lib/examples/rtl_chat.dart` with `Directionality(rtl)` wrap
and Arabic streaming markdown. Wired into `home_screen.dart` and
`main.dart` (`/rtl` route).
Onboarding audit:
- `doc/ONBOARDING_AUDIT.md` — cold-read journey audit caught 4 broken
code snippets in `AGENTS.md` and `ai_action_provider.dart` dartdoc that
would not have compiled on first paste (`ActionParameter.integer`
doesn't exist; `ActionResult.success(data:...)` should be
`createSuccess(...)`; `updateMessage(id, text:...)` takes a `ChatMessage`).
All fixed.
Verification:
- `flutter analyze` clean (root + example/).
- `flutter test` 330/330 pass.
- `dart format --output=none --set-exit-if-changed .` clean (153 files).
- `pana --no-warning` 160/160 across all 11 sections.
- Zero open issues, zero open PRs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 598a077 commit 4c92d58
43 files changed
Lines changed: 4599 additions & 564 deletions
File tree
- .github/workflows
- doc
- example
- ios
- Flutter
- Runner
- lib
- examples
- lib/src
- controllers
- models/chat
- widgets
- test
- agents
- controllers
- widgets
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
0 commit comments