|
| 1 | +TODO-Plan.md |
| 2 | + |
| 3 | +The plan uses short (3–10 day) focused sprints with clear acceptance criteria. Priorities reflect: |
| 4 | + |
| 5 | +- Risk reduction (crashes, data loss, auth breakage) |
| 6 | +- User experience & polish |
| 7 | +- Long-term maintainability |
| 8 | +- Production readiness (builds, testing, observability) |
| 9 | + |
| 10 | +### Sprint 0 – Pre-Release Hardening (4–6 days) |
| 11 | +Goal: Make the app safe to ship (no data loss, no hard crashes). |
| 12 | + |
| 13 | +1. [ ] Implement **pending local mutations queue** in Hive |
| 14 | + → Offline created/updated/closed issues → stored as list of operations |
| 15 | + → Replay on next successful sync (in order) |
| 16 | + → Show “Pending sync (3 changes)” badge |
| 17 | + |
| 18 | +2. [ ] Add **optimistic updates + rollback** on issue create/edit/close |
| 19 | + → Use Riverpod AsyncNotifier + .whenData() pattern |
| 20 | + → Rollback UI + show snackbar on sync failure |
| 21 | + |
| 22 | +3. [ ] Fix / complete **SyncService** edge cases |
| 23 | + → Handle 401/403/422 properly (force re-auth) |
| 24 | + → Exponential backoff retry (3 attempts) |
| 25 | + → Debounce network change events properly (dispose subscription) |
| 26 | + |
| 27 | +4. [ ] Wrap entire app in global **ErrorBoundary** widget |
| 28 | + → Catch unhandled exceptions → show “Something went wrong” screen + report button (copy logs) |
| 29 | + |
| 30 | +5. [ ] Add **Dio** instead of raw `http` package |
| 31 | + → Auth interceptor (token from secure storage) |
| 32 | + → Logging interceptor (debug only) |
| 33 | + → Connectivity-aware retry |
| 34 | + |
| 35 | +**Acceptance**: |
| 36 | +- Can work fully offline → make changes → reconnect → changes appear on GitHub |
| 37 | +- App never hard-crashes on network errors / JSON parse fails |
| 38 | +- Build succeeds with `--release --analyze-size` |
| 39 | + |
| 40 | +### Sprint 1 – Navigation & Routing (3–5 days) |
| 41 | +Goal: Replace fragile initial-route logic with real navigation. |
| 42 | + |
| 43 | +1. [ ] Add **go_router** + riverpod integration |
| 44 | + → Typed routes for all 7 screens |
| 45 | + → `/dashboard`, `/issue/:id`, `/project/:nodeId/board`, etc. |
| 46 | + |
| 47 | +2. [ ] Implement **auth redirect guard** |
| 48 | + → Unauthenticated → `/onboarding` |
| 49 | + → Authenticated but no repo selected → `/onboarding?step=repo` |
| 50 | + → Deep link support (issue URLs) |
| 51 | + |
| 52 | +3. [ ] Migrate all `Navigator.push` → `context.go()` / `context.push()` |
| 53 | + |
| 54 | +**Acceptance**: |
| 55 | +- No more manual `if (token != null)` in main.dart |
| 56 | +- Back button / system navigation works correctly everywhere |
| 57 | +- Can open issue detail from search / dashboard |
| 58 | + |
| 59 | +### Sprint 2 – Models & Code Generation (4–7 days) |
| 60 | +Goal: Stop manual JSON hell, make models safe & immutable. |
| 61 | + |
| 62 | +1. [ ] Add **freezed** + **json_serializable** (or built_value) |
| 63 | + → Convert Item → IssueItem, ProjectItem, RepoItem to @freezed |
| 64 | + |
| 65 | +2. [ ] Add **hive_generator** + @HiveType / @HiveField |
| 66 | + → Generate adapters for all models |
| 67 | + → Register adapters in main.dart |
| 68 | + |
| 69 | +3. [ ] Replace manual toJson/fromJson everywhere |
| 70 | + → Use .toJson() / .fromJson() from freezed |
| 71 | + |
| 72 | +4. [ ] Add **copyWith** usage in forms & state updates |
| 73 | + |
| 74 | +**Acceptance**: |
| 75 | +- No more `UnimplementedError` in fromJson |
| 76 | +- Hive boxes read/write complex objects without crashes |
| 77 | +- Models are immutable → easier reasoning & testing |
| 78 | + |
| 79 | +### Sprint 3 – Testing & Quality Gates (5–8 days) |
| 80 | +Goal: Stop regressions before they reach users. |
| 81 | + |
| 82 | +1. [ ] Write **widget tests** for critical flows (30–40 tests) |
| 83 | + → Onboarding → auth → dashboard load |
| 84 | + → Issue create/edit → sync indicator changes |
| 85 | + |
| 86 | +2. [ ] Add **golden tests** for main screens (dark mode only) |
| 87 | + |
| 88 | +3. [ ] Add **very basic integration test** (one happy path: login → create issue → close) |
| 89 | + |
| 90 | +4. [ ] Set up **GitHub Actions** CI (flutter analyze + test + build apk/ios) |
| 91 | + |
| 92 | +**Acceptance**: |
| 93 | +- CI passes on every push |
| 94 | +- At least 60–70% coverage on business logic (models + services) |
| 95 | +- No new lint warnings |
| 96 | + |
| 97 | +### Sprint 4 – Production & Release Polish (5–7 days) |
| 98 | +Goal: Ship something people can install & love. |
| 99 | + |
| 100 | +1. [ ] Add **skeleton loading** (skeletonizer package) on dashboard & lists |
| 101 | + |
| 102 | +2. [ ] Implement **pull-to-refresh** + loading indicators everywhere data is fetched |
| 103 | + |
| 104 | +3. [ ] Final UI micro-polish pass |
| 105 | + → Consistent spacing/padding (use constants/) |
| 106 | + → Fix any layout overflows on small devices |
| 107 | + → Improve sync icon states & animations |
| 108 | + |
| 109 | +4. [ ] Write proper **release build instructions** in README |
| 110 | + → Signing, fastlane / codemagic snippet, version bumping |
| 111 | + |
| 112 | +5. [ ] Create **v1.0.0 tag** + GitHub Release with changelog |
| 113 | + |
| 114 | +**Acceptance**: |
| 115 | +- App feels snappy & professional |
| 116 | +- Users can install APK / TestFlight without docs gymnastics |
| 117 | +- First public release published |
| 118 | + |
| 119 | +### Post 1.0 – Quick Wins Phase (after release, 2–4 weeks) |
| 120 | + |
| 121 | +**Sprint A – Background & Reliability** (priority) |
| 122 | +- Add workmanager → background sync every 15–30 min (when online) |
| 123 | +- Add simple crash reporting (Sentry / Firebase Crashlytics free tier) |
| 124 | + |
| 125 | +**Sprint B – User Requested Features** (vote-based) |
| 126 | +- Issue comments read/write |
| 127 | +- Pagination (issues list > 30 items) |
| 128 | +- Light theme toggle (low effort now that design system exists) |
| 129 | + |
| 130 | +**Sprint C – Maintainability** |
| 131 | +- Replace reorderables → native ReorderableListView / SliverReorderableList |
| 132 | +- Introduce Talker / Logger instead of print |
| 133 | +- Extract clean repository pattern (IssueRepository, ProjectRepository) |
| 134 | + |
| 135 | +This plan keeps sprints **short & outcome-focused**. You can release after Sprint 4 with confidence that core offline/sync/auth/edit flows are robust. |
| 136 | + |
| 137 | +If you want any sprint expanded into detailed subtasks / file change suggestions / example code structure — tell me which one and I'll go deeper. Good luck shipping! |
0 commit comments