Skip to content

Feature/add onboarding page#61

Merged
PropzSaladaz merged 7 commits into
masterfrom
feature/add-onboarding-page
Apr 26, 2026
Merged

Feature/add onboarding page#61
PropzSaladaz merged 7 commits into
masterfrom
feature/add-onboarding-page

Conversation

@PropzSaladaz
Copy link
Copy Markdown
Owner

No description provided.

@PropzSaladaz PropzSaladaz self-assigned this Apr 26, 2026
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
laze Ready Ready Preview, Comment Apr 26, 2026 5:12pm

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add comprehensive onboarding flow and gesture guide

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add five-page onboarding flow with first-launch and replay modes
• Persist onboarding completion state in device settings repository
• Route to onboarding on first app launch, with replay option in settings
• Add gesture guide modal to mousepad with help button
• Auto-save device name with debouncing instead of manual save button
• Add url_launcher dependency for opening external download URLs
Diagram
flowchart LR
  A["App Launch"] -->|Check onboarding flag| B["DeviceSettingsRepository"]
  B -->|Not completed| C["OnboardingScreen<br/>First-run mode"]
  B -->|Completed| D["HomeScreen"]
  C -->|Complete/Skip| E["Set onboarding_completed<br/>Navigate to Home"]
  F["Settings Screen"] -->|Help & Tutorial card| G["OnboardingScreen<br/>Replay mode"]
  G -->|Close| F
  H["MousePad"] -->|Help button| I["Gesture Guide Modal"]
  J["OnboardingScreen"] -->|Download link| K["url_launcher<br/>Open external URL"]
Loading

Grey Divider

File Changes

1. mobile_client/lib/data/repositories/device/device_settings_repository.dart ✨ Enhancement +12/-0

Add onboarding completion flag persistence

mobile_client/lib/data/repositories/device/device_settings_repository.dart


2. mobile_client/lib/main.dart ✨ Enhancement +12/-3

Route to onboarding on first launch

mobile_client/lib/main.dart


3. mobile_client/lib/presentation/onboarding/onboarding_screen.dart ✨ Enhancement +361/-0

Create five-page onboarding flow with modes

mobile_client/lib/presentation/onboarding/onboarding_screen.dart


View more (9)
4. mobile_client/lib/presentation/home/widgets/mousepad.dart ✨ Enhancement +128/-0

Add gesture guide modal and help button

mobile_client/lib/presentation/home/widgets/mousepad.dart


5. mobile_client/lib/presentation/settings/settings_screen.dart ✨ Enhancement +109/-57

Auto-save device name and add help card

mobile_client/lib/presentation/settings/settings_screen.dart


6. mobile_client/test/widget_test.dart 🧪 Tests +1/-1

Update test to pass showOnboarding parameter

mobile_client/test/widget_test.dart


7. mobile_client/pubspec.yaml Dependencies +3/-0

Add url_launcher dependency

mobile_client/pubspec.yaml


8. mobile_client/linux/flutter/generated_plugin_registrant.cc ⚙️ Configuration changes +4/-0

Register url_launcher_linux plugin

mobile_client/linux/flutter/generated_plugin_registrant.cc


9. mobile_client/windows/flutter/generated_plugin_registrant.cc ⚙️ Configuration changes +3/-0

Register url_launcher_windows plugin

mobile_client/windows/flutter/generated_plugin_registrant.cc


10. mobile_client/linux/flutter/generated_plugins.cmake ⚙️ Configuration changes +1/-0

Add url_launcher_linux to plugin list

mobile_client/linux/flutter/generated_plugins.cmake


11. mobile_client/windows/flutter/generated_plugins.cmake ⚙️ Configuration changes +1/-0

Add url_launcher_windows to plugin list

mobile_client/windows/flutter/generated_plugins.cmake


12. mobile_client/macos/Flutter/GeneratedPluginRegistrant.swift ⚙️ Configuration changes +2/-0

Register url_launcher_macos plugin

mobile_client/macos/Flutter/GeneratedPluginRegistrant.swift


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 26, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Unawaited settings persistence🐞 Bug ☼ Reliability
Description
SettingsScreen._onDeviceNameChanged fire-and-forgets DeviceSettingsRepository.setDeviceName and
updates _lastSavedDeviceName before the write succeeds; a Hive write failure becomes an unhandled
async exception and the UI may believe the value is saved when it is not.
Code

mobile_client/lib/presentation/settings/settings_screen.dart[R60-68]

+  void _onDeviceNameChanged() {
+    _deviceNameDebounce?.cancel();
+    _deviceNameDebounce = Timer(const Duration(milliseconds: 350), () {
+      final trimmed = _deviceNameController.text.trim();
+      if (trimmed.isEmpty || trimmed == _lastSavedDeviceName) return;
+      _lastSavedDeviceName = trimmed;
+      Provider.of<DeviceSettingsRepository>(context, listen: false)
+          .setDeviceName(trimmed);
  });
-
-    try {
-      final deviceSettings =
-          Provider.of<DeviceSettingsRepository>(context, listen: false);
-      await deviceSettings.setDeviceName(_deviceNameController.text.trim());
-
-      if (mounted) {
-        _showSuccess('Settings updated');
-      }
-    } catch (e) {
-      if (mounted) {
-        _showError('Failed to save device name: $e');
-      }
-    } finally {
-      if (mounted) {
-        setState(() {
-          _isSaving = false;
-        });
-      }
-    }
-  }
-
-  void _showError(String message) {
-    final appColors = Theme.of(context).extension<AppColors>()!;
-    ScaffoldMessenger.of(context).showSnackBar(
-      SnackBar(
-        content: Text(message),
-        backgroundColor: appColors.error,
-        duration: const Duration(seconds: 3),
-      ),
-    );
-  }
-
-  void _showSuccess(String message) {
-    final appColors = Theme.of(context).extension<AppColors>()!;
-    ScaffoldMessenger.of(context).showSnackBar(
-      SnackBar(
-        content: Text(message),
-        backgroundColor: appColors.success,
-        duration: const Duration(seconds: 2),
-      ),
-    );
Evidence
The settings screen invokes an async persistence method without awaiting/catching errors, and
advances the "last saved" marker prior to successful persistence. The repository implementation
awaits Hive _box.put(), which can throw; without awaiting/catching at the call site, failures will
be unhandled and state can become inconsistent.

mobile_client/lib/presentation/settings/settings_screen.dart[60-68]
mobile_client/lib/data/repositories/device/device_settings_repository.dart[43-51]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`SettingsScreen._onDeviceNameChanged` calls `setDeviceName()` without awaiting or handling errors, and it updates `_lastSavedDeviceName` before the write completes. If the Hive write fails, the exception is unhandled and the UI state can incorrectly treat the name as saved.
### Issue Context
`DeviceSettingsRepository.setDeviceName()` is async and awaits `_box.put(...)`, so it can throw.
### Fix Focus Areas
- Add error handling + await persistence: 
- mobile_client/lib/presentation/settings/settings_screen.dart[60-68]
- (Optional) Only update `_lastSavedDeviceName` after a successful save (and consider showing a snackbar on failure):
- mobile_client/lib/presentation/settings/settings_screen.dart[60-68]
- Reference the async repository method being called:
- mobile_client/lib/data/repositories/device/device_settings_repository.dart[43-51]
### Suggested approach
- Make the debounce callback `async` and `await` the repository write.
- Wrap the write in `try/catch` (or `catchError`) and restore `_lastSavedDeviceName` / show an error if it fails.
- Consider guarding with `if (!mounted) return;` inside the timer callback before using `context`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread mobile_client/lib/presentation/settings/settings_screen.dart
@PropzSaladaz PropzSaladaz merged commit d56cca8 into master Apr 26, 2026
4 checks passed
@PropzSaladaz PropzSaladaz deleted the feature/add-onboarding-page branch April 26, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant