Skip to content

Commit 4c92d58

Browse files
hooshyarclaude
andcommitted
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
# Lightweight CI gate for the flutter_gen_ai_chat_ui package.
4+
#
5+
# What this catches:
6+
# - Formatter drift (`dart format --set-exit-if-changed`). The local
7+
# `flutter analyze` step does NOT catch formatter drift, and pub.dev's
8+
# `pana` deducts 10 points if any file is unformatted (iter-7 of the
9+
# internal maintenance log surfaced this as a real recurring risk
10+
# introduced by dartdoc edits).
11+
# - Static analyzer warnings (`flutter analyze`).
12+
# - Unit + widget test regressions (`flutter test`).
13+
#
14+
# Intentionally not in scope here:
15+
# - `dart pub publish --dry-run` (the user controls releases and
16+
# gitignored-file state).
17+
# - `pana` (slow; runs locally as part of the release-prep checklist).
18+
# - Integration tests under `example/integration_test/` (require a
19+
# running device/simulator; gated by the package's "do not run app on
20+
# simulators in CI" policy).
21+
22+
on:
23+
push:
24+
branches: [main]
25+
pull_request:
26+
branches: [main]
27+
workflow_dispatch:
28+
29+
jobs:
30+
analyze-format-test:
31+
name: Analyze, format, and test
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 15
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Flutter
39+
uses: subosito/flutter-action@v2
40+
with:
41+
channel: stable
42+
cache: true
43+
44+
- name: Print Flutter and Dart versions
45+
run: |
46+
flutter --version
47+
dart --version
48+
49+
- name: Install dependencies
50+
run: flutter pub get
51+
52+
- name: Check formatting
53+
# The leading `dart format --set-exit-if-changed` is the iter-8
54+
# guardrail. If any file is unformatted this step fails the build
55+
# before analyze/tests run, surfacing the issue immediately.
56+
run: dart format --output=none --set-exit-if-changed .
57+
58+
- name: Analyze
59+
run: flutter analyze --fatal-infos
60+
61+
- name: Analyze example app
62+
# The example/ directory has its own pubspec and is outside the
63+
# package's analyzer scope. Iter-10 surfaced 9 lints there that
64+
# the main `flutter analyze` step did not catch, so we gate
65+
# example-app regressions explicitly.
66+
run: |
67+
cd example
68+
flutter pub get
69+
flutter analyze --fatal-infos
70+
71+
- name: Test
72+
run: flutter test --reporter expanded

0 commit comments

Comments
 (0)