## Overview **Context:** NexaNote's data is stored in a Python backend (SQLite via FastAPI, `nexanote/storage/database.py`). The Flutter app has no local storage — it fetches everything from the backend API. The backend must be running for the app to work. Currently, if the backend is not running when the user opens the app, `AppState.connect()` fails and the `ConnectScreen` shows a generic error. But if the backend goes down *after* connecting — while the user is on the home screen — subsequent API calls fail silently or produce unhandled exceptions. This issue focuses on making startup and early connection failures clear and recoverable. ## What needs to be done - [ ] In `app_state.dart`, ensure `connect()` catches all HTTP exceptions and sets a clear error message (not just timeout — also connection refused, DNS failure, etc.) - [ ] In `ConnectScreen` (`connect_screen.dart`), display the specific error reason (e.g., "Connection refused — is the backend running?") rather than a generic message - [ ] After a failed connection, show a **"Retry"** button that re-runs `connect()` without requiring the user to retype the URL - [ ] In `home_screen.dart`, if an API call fails (e.g., `loadNotes()` throws), show a `SnackBar` with a message like "Lost connection to backend. Please check that it's running." instead of crashing - [ ] Add the backend start command (`python main.py`) in the `ConnectScreen` help box so the user knows how to fix it ## Goal A user who forgets to start the backend gets a clear, actionable message on the connect screen. If the backend goes down mid-session, the app shows a snackbar and stays functional (notes already loaded remain visible) rather than crashing. ## Where to look - `app/lib/screens/connect_screen.dart` - `app/lib/services/app_state.dart` — `connect()`, `loadNotes()`, `loadNotebooks()` - `app/lib/screens/home_screen.dart` ## Notes > No backend changes needed. All work is in the Flutter app. Related to: #8, #24, #26