feat(phase17): account & identity management - #68
Conversation
…enerate new user, reputation gating - lib/features/account/providers/privacy_mode_provider.dart: PrivacyModeNotifier StateNotifierProvider wrapping set_privacy_mode() with TODO(bridge) for Phase 18+ FFI - account_screen.dart: wire privacy mode options (remove Opacity/Coming-soon stub); tapping Reputation/Full-Privacy Mode updates provider; Generate New User dialog updated with correct warning and post-confirm flow (showBackupReminder → walkthrough navigation) - take_order_screen.dart: watch privacyModeProvider; hide creator reputation card (rating, trade count, days active) when privacy mode is active
… feedback, web persistence warning, eventual-consistency doc
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 6 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe PR introduces a privacy mode state provider and integrates it across the account and order screens with interactive UI controls. It systematically replaces debug-only assertions for missing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
lib/features/account/screens/account_screen.dart (1)
294-302: Consider awaitingshowBackupReminder()before navigation.
showBackupReminder()is async and persists toSharedPreferences. Navigating immediately viacontext.go()could race with the persistence operation, potentially causing the backup reminder to not appear if the user force-closes the app mid-navigation.♻️ Suggested fix: await the reminder activation
FilledButton( - onPressed: () { + onPressed: () async { Navigator.pop(context); // TODO(bridge): call create_identity() via FFI (Phase 18+). - ref + await ref .read(backupReminderProvider.notifier) .showBackupReminder(); - context.go(AppRoute.walkthrough); + if (context.mounted) { + context.go(AppRoute.walkthrough); + } }, child: const Text('Continue'), ),Note: The existing walkthrough completion flow (
walkthrough_screen.dart:161-167) also doesn't awaitshowBackupReminder(), so this matches current patterns. However, generating a new identity is a more critical operation where ensuring persistence completes is valuable.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/features/account/screens/account_screen.dart` around lines 294 - 302, The onPressed handler for the FilledButton calls the async method showBackupReminder() via ref.read(backupReminderProvider.notifier).showBackupReminder() but does not await it before navigating (Navigator.pop and context.go(AppRoute.walkthrough)), risking a race with persistence; make the onPressed callback async, await the call to showBackupReminder() (optionally with try/catch to surface failures) and only then perform Navigator.pop(context) and context.go(AppRoute.walkthrough) so persistence completes before navigation.lib/features/chat/widgets/info_panels.dart (1)
36-37: Consider centralizing this null-guard pattern to reduce repetition.The same
Theme.of(context).extension<AppColors>()+StateErrorblock is repeated in both widgets. A smallBuildContexthelper would keep this consistent and easier to maintain.♻️ Suggested refactor
+extension AppColorsX on BuildContext { + AppColors get appColors => + Theme.of(this).extension<AppColors>() ?? + (throw StateError('AppColors theme extension must be registered')); +}- final colors = Theme.of(context).extension<AppColors>(); - if (colors == null) throw StateError('AppColors theme extension must be registered'); + final colors = context.appColors;Also applies to: 137-138
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/features/chat/widgets/info_panels.dart` around lines 36 - 37, Centralize the repeated null-guard by adding a BuildContext extension (e.g., a getter like requireAppColors or appColorsOrThrow) that calls Theme.of(this).extension<AppColors>() and throws the StateError if null; then replace the inline pattern in InfoPanel widgets (references: Theme.of(context).extension<AppColors>() and the existing StateError usage in info_panels.dart) with the new context extension to keep the check consistent and DRY across both occurrences.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@rust/src/api/settings.rs`:
- Around line 170-171: The sync-fallback in set_logging_enabled currently uses
try_write() and silently drops updates on contention; replace the
non-deterministic try_write() usage with a blocking write() (or an explicit loop
that waits for the RwLock write guard) so the flag update is always applied and
the broadcast behavior matches the documented “flag is always set” behavior;
apply the same change to the analogous sync-fallback update block(s) in this
file that currently use try_write() so no updates are silently discarded.
---
Nitpick comments:
In `@lib/features/account/screens/account_screen.dart`:
- Around line 294-302: The onPressed handler for the FilledButton calls the
async method showBackupReminder() via
ref.read(backupReminderProvider.notifier).showBackupReminder() but does not
await it before navigating (Navigator.pop and context.go(AppRoute.walkthrough)),
risking a race with persistence; make the onPressed callback async, await the
call to showBackupReminder() (optionally with try/catch to surface failures) and
only then perform Navigator.pop(context) and context.go(AppRoute.walkthrough) so
persistence completes before navigation.
In `@lib/features/chat/widgets/info_panels.dart`:
- Around line 36-37: Centralize the repeated null-guard by adding a BuildContext
extension (e.g., a getter like requireAppColors or appColorsOrThrow) that calls
Theme.of(this).extension<AppColors>() and throws the StateError if null; then
replace the inline pattern in InfoPanel widgets (references:
Theme.of(context).extension<AppColors>() and the existing StateError usage in
info_panels.dart) with the new context extension to keep the check consistent
and DRY across both occurrences.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fbc00db8-b6b9-4f6d-8daa-8a2011801462
📒 Files selected for processing (29)
lib/features/about/screens/about_screen.dartlib/features/account/providers/privacy_mode_provider.dartlib/features/account/screens/account_screen.dartlib/features/chat/screens/chat_room_screen.dartlib/features/chat/screens/chat_rooms_screen.dartlib/features/chat/widgets/chat_list_item.dartlib/features/chat/widgets/encrypted_file_message.dartlib/features/chat/widgets/encrypted_image_message.dartlib/features/chat/widgets/info_panels.dartlib/features/chat/widgets/message_bubble.dartlib/features/chat/widgets/message_input.dartlib/features/disputes/screens/dispute_chat_screen.dartlib/features/disputes/widgets/dispute_list_item.dartlib/features/disputes/widgets/dispute_message_input.dartlib/features/disputes/widgets/dispute_messages_list.dartlib/features/disputes/widgets/disputes_list.dartlib/features/notifications/providers/notifications_provider.dartlib/features/order/screens/take_order_screen.dartlib/features/rate/screens/rate_counterpart_screen.dartlib/features/settings/screens/log_report_screen.dartlib/features/settings/screens/notification_settings_screen.dartlib/features/settings/widgets/currency_selector_dialog.dartlib/features/settings/widgets/language_selector.dartlib/features/settings/widgets/relay_management_card.dartlib/features/trades/screens/trades_screen.dartlib/features/trades/widgets/trades_list_item.dartlib/l10n/app_localizations.dartrust/src/api/settings.rsspecs/004-mostro-p2p-client/tasks.md
…flag, await backup reminder before navigation
Summary by CodeRabbit
Release Notes
New Features
Improvements
Documentation