This repository has been archived on 2026-06-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FabledApp/pubspec.yaml
T
bvandeusen 6ef658558a feat(offline): tier 2 phase 1 — Drift cache + read-through for notes
First slice of the tier 2 offline mode work tracked in Fable #147.
Notes are the only domain wired so far; this PR establishes the
shape and proves the round-trip end-to-end before extending to tasks
/ projects / events / etc. in phase 2.

Local store
- Adds drift ^2.20.0 + sqlite3_flutter_libs ^0.5.24 + path ^1.9.0
  runtime deps and drift_dev / build_runner dev deps.
- New lib/data/local/database.dart: FabledDatabase with CachedNotes
  (mirroring the Note model 1:1; tags stored as JSON-encoded text) and
  SyncMetadata (per-domain last_synced_at). Database file lives at
  $appDocs/fabled_cache.sqlite; opened lazily in a background isolate.
- fabledDatabaseProvider on the existing api_client_provider; closes
  the DB when the ProviderScope disposes.

Repository pattern
- NotesRepository now takes (NotesApi, FabledDatabase). Reads attempt
  the network first; on success the response is written to the cache.
  On NetworkException reads fall back to the cache (rethrowing if it
  is empty so fresh-install offline still surfaces the network error).
- Writes (create/update/delete) hit the server then sync the cache;
  offline write queueing is phase 3 and explicitly not wired here.
- AuthStatus.offline stays owned by AuthNotifier.verify()'s heartbeat;
  this repo deliberately doesn't poke that state.

OfflineBanner
- Reads notesRepository.lastSyncedAt(); when present, swaps
  "Offline — showing cached data." for "Offline — last sync X min
  ago." A 30s timer refreshes the relative-time string while the
  banner is mounted.
- Falls back to the generic message if no cache exists yet (fresh
  install offline).

Verification
- flutter analyze: No issues found

Out of scope (later phases per the task body)
- Tasks / projects / milestones / events / conversation list / journal
  day caching (phase 2 — same wrapper pattern, repeated)
- Generic write queue with conflict resolution on updated_at (phase 3)
- Read-only UI indicators on screens that depend on cached data
  (phase 4)
- Full offline chat (out of scope; needs a local model)
- RAG / search over cached content (out of scope)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 21:08:06 -04:00

65 lines
1.5 KiB
YAML

name: fabled_app
description: "FabledAssistant mobile client for Android."
publish_to: 'none'
version: 0.0.0+0 # overridden at build time via --build-name / --build-number
environment:
sdk: ^3.11.0
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.8
lucide_icons: ^0.257.0
flutter_riverpod: ^3.3.1
go_router: ^17.1.0
dio: ^5.6.0
cookie_jar: ^4.0.8
dio_cookie_manager: ^3.1.1
path_provider: ^2.1.4
shared_preferences: ^2.3.2
markdown: ^7.2.2
package_info_plus: ^9.0.0
open_file: ^3.3.2
permission_handler: ^11.3.1
flutter_inappwebview: ^6.1.5
flutter_markdown_plus: ^1.0.7
google_fonts: ^8.0.2
flutter_timezone: ^5.0.2
url_launcher: ^6.3.1
record: ^6.2.0
vad: ^0.0.7
just_audio: ^0.9.39
table_calendar: ^3.1.2
# Tier 2 offline mode — local SQL store via Drift (sqlite3 under the hood).
# Drift was preferred over Hive in the design since the repo already mirrors
# well-defined backend schemas (notes/tasks/projects/etc.) one-to-one.
drift: ^2.20.0
sqlite3_flutter_libs: ^0.5.24
path: ^1.9.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^6.0.0
flutter_launcher_icons: ^0.14.3
drift_dev: ^2.20.0
build_runner: ^2.4.13
flutter_launcher_icons:
android: true
ios: false
remove_alpha_ios: false
image_path: "assets/icon/app_icon_fg.png"
adaptive_icon_background: "assets/icon/app_icon_bg_transparent.png"
adaptive_icon_foreground: "assets/icon/app_icon_fg.png"
min_sdk_android: 21
flutter:
uses-material-design: true
assets:
- assets/icon/