Skip to content

Account screen redesigned#208

Merged
grunch merged 1 commit into
mainfrom
feat/new-style-acount-screen
Jul 19, 2025
Merged

Account screen redesigned#208
grunch merged 1 commit into
mainfrom
feat/new-style-acount-screen

Conversation

@grunch

@grunch grunch commented Jul 19, 2025

Copy link
Copy Markdown
Member

✅ Completed Tasks:

  1. Added new localization keys to all ARB files (English, Spanish, Italian)
  2. Updated account screen structure to match about screen styling
  3. Implemented secret words card with mask/unmask functionality
  4. Implemented privacy card with new styling
  5. Implemented current trade index card
  6. Updated generate new user button with confirmation dialog
  7. Added dialog and helper methods
  8. Generated localization files with build_runner
  9. Tested functionality - all tests passing

🎨 New Design Features:

  • 3 distinct cards with proper spacing and styling:
    • Secret Words Card: Key icon + info dialog + mask/unmask functionality
    • Privacy Card: Shield icon + info dialog + updated switch design
    • Current Trade Index Card: Refresh icon + info dialog + prominent number display
  • Enhanced Secret Words functionality:
    • Show/Hide toggle button with eye/eye-off icons
    • Masked display showing first 2 and last 2 words with dots in between
    • Secure monospace font display
  • Improved Privacy Settings:
    • Modern switch design with descriptive text
    • Clear mode indicators ("Reputation mode" vs "Full privacy mode")
  • Confirmation Dialog for Generate New User:
    • Styled dialog matching the new theme
    • Clear warning message about reputation loss
    • Green "Continue" button and cancel option

🔧 Technical Implementation:

  • Added LucideIcons import for new icons (key, shield, refreshCcw, userPlus, download)
  • Removed dependency on CustomCard widget
  • Implemented _maskSeedPhrase helper function as requested
  • Added state management for show/hide secret words (_showSecretWords)
  • Updated app bar styling to match new theme
  • Used proper card decoration with AppTheme.backgroundCard and borders
  • Preserved all existing key management functionality
  • Fixed localization key conflict with reserved keyword continue → continueButton

📱 User Experience Improvements:

  • Info dialogs provide helpful explanations for each setting
  • Visual feedback for all interactive elements
  • Consistent styling across all cards and dialogs
  • Proper spacing and responsive design
  • Disabled import button as requested (functionality preserved for future)

Summary by CodeRabbit

  • New Features

    • Improved account management screen with enhanced UI, clearer privacy settings, and better handling for sensitive information display.
    • Added the ability to show or hide secret recovery words with masking for increased security.
    • Introduced informative dialogs for secret words, privacy modes, and trade index explanations.
  • Localization

    • Added new informational and UI text for account and privacy features in English, Spanish, and Italian.

✅ Completed Tasks:

1. Added new localization keys to all ARB files (English, Spanish, Italian)
2. Updated account screen structure to match about screen styling
3. Implemented secret words card with mask/unmask functionality
4. Implemented privacy card with new styling
5. Implemented current trade index card
6. Updated generate new user button with confirmation dialog
7. Added dialog and helper methods
8. Generated localization files with build_runner
9. Tested functionality - all tests passing

🎨 New Design Features:

- 3 distinct cards with proper spacing and styling:
  - Secret Words Card: Key icon + info dialog + mask/unmask functionality
  - Privacy Card: Shield icon + info dialog + updated switch design
  - Current Trade Index Card: Refresh icon + info dialog + prominent number display
- Enhanced Secret Words functionality:
  - Show/Hide toggle button with eye/eye-off icons
  - Masked display showing first 2 and last 2 words with dots in between
  - Secure monospace font display
- Improved Privacy Settings:
  - Modern switch design with descriptive text
  - Clear mode indicators ("Reputation mode" vs "Full privacy mode")
- Confirmation Dialog for Generate New User:
  - Styled dialog matching the new theme
  - Clear warning message about reputation loss
  - Green "Continue" button and cancel option

🔧 Technical Implementation:

- Added LucideIcons import for new icons (key, shield, refreshCcw, userPlus, download)
- Removed dependency on CustomCard widget
- Implemented _maskSeedPhrase helper function as requested
- Added state management for show/hide secret words (_showSecretWords)
- Updated app bar styling to match new theme
- Used proper card decoration with AppTheme.backgroundCard and borders
- Preserved all existing key management functionality
- Fixed localization key conflict with reserved keyword continue → continueButton

📱 User Experience Improvements:

- Info dialogs provide helpful explanations for each setting
- Visual feedback for all interactive elements
- Consistent styling across all cards and dialogs
- Proper spacing and responsive design
- Disabled import button as requested (functionality preserved for future)
@coderabbitai

coderabbitai Bot commented Jul 19, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes refactor the key management screen in the Flutter app, improving UI structure, modularizing widgets, and enhancing sensitive data handling with masking and toggle features. New informational dialogs and updated privacy controls are introduced. Localization files for English, Spanish, and Italian are expanded with new strings supporting these UI and dialog updates.

Changes

File(s) Change Summary
lib/features/key_manager/key_management_screen.dart Refactored UI structure, modularized widgets, added seed phrase masking/toggle, new dialogs, and updated privacy controls.
lib/l10n/intl_en.arb, lib/l10n/intl_es.arb, lib/l10n/intl_it.arb Added new localization strings for dialogs, privacy modes, UI labels, and informational content in English, Spanish, and Italian.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant KeyManagementScreen
    participant Dialog

    User->>KeyManagementScreen: Opens Key Management Screen
    KeyManagementScreen->>User: Displays masked secret words
    User->>KeyManagementScreen: Taps "Show/Hide" button
    KeyManagementScreen->>User: Toggles visibility of secret words
    User->>KeyManagementScreen: Taps info icon
    KeyManagementScreen->>Dialog: Shows informational dialog
    Dialog->>User: Displays info (secret words, privacy, trade index)
    User->>KeyManagementScreen: Toggles privacy mode switch
    KeyManagementScreen->>User: Updates privacy mode display
Loading

Poem

In the warren of code, a new screen appears,
With secrets well-hidden from prying ears.
Toggle and tap, let privacy bloom,
In English, Español, and Italiano—no gloom!
Dialogs now whisper what rabbits should know,
As the UI grows gentle, in a carrot-bright glow.
🥕✨


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
lib/features/key_manager/key_management_screen.dart (1)

376-386: Consider UX clarity for privacy switch behavior.

The switch logic is inverted - ON enables reputation mode (less privacy) while OFF enables full privacy. Consider either:

  1. Reversing the logic so ON = more privacy
  2. Adding clearer visual indicators about what each state means

The current implementation works but might confuse users expecting a privacy switch to increase privacy when turned ON.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between acf233b and a65b0fc.

📒 Files selected for processing (4)
  • lib/features/key_manager/key_management_screen.dart (4 hunks)
  • lib/l10n/intl_en.arb (1 hunks)
  • lib/l10n/intl_es.arb (1 hunks)
  • lib/l10n/intl_it.arb (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
lib/l10n/intl_{en,es,it}.arb

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • CLAUDE.md
**/*.dart

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • CLAUDE.md
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Always use localized strings: Replace hardcoded text with `S.of(context)!.keyName`
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Use `S.of(context).yourKey` for all user-facing strings
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Pass BuildContext to methods that need localization
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Keep UI code declarative and side-effect free
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: All changes should pass `flutter analyze` before commit
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Use post-frame callbacks for side effects like SnackBars/dialogs
lib/l10n/intl_en.arb (2)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Use proper ARB metadata for parameterized strings
lib/l10n/intl_es.arb (2)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Use proper ARB metadata for parameterized strings
lib/l10n/intl_it.arb (2)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Use proper ARB metadata for parameterized strings
lib/features/key_manager/key_management_screen.dart (9)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Always use localized strings: Replace hardcoded text with `S.of(context)!.keyName`
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Use `S.of(context).yourKey` for all user-facing strings
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Keep UI code declarative and side-effect free
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Pass BuildContext to methods that need localization
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Use post-frame callbacks for side effects like SnackBars/dialogs
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/*.{dart} : Use Riverpod for all state management
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, Riverpod code generation is used with `@Riverpod` annotations. Providers like `eventStorageProvider` are generated in `.g.dart` files from annotated functions in the main provider files. These providers are accessible by importing the main provider file (e.g., `mostro_service_provider.dart`), not by importing a separate provider file.
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T20:24:34.836Z
Learning: Applies to lib/features/**/{screens,widgets}/*.dart : Always check `mounted` before using context after async operations
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (10)
lib/l10n/intl_it.arb (1)

677-691: LGTM! Localization keys properly added.

The new Italian localization strings for the account screen info dialogs are correctly formatted and consistent with the ARB structure.

lib/l10n/intl_en.arb (1)

637-651: LGTM! English localization keys match the Italian translations.

The new English strings for account info dialogs are clear and well-written. They maintain consistency with the existing localization structure.

lib/l10n/intl_es.arb (1)

669-683: LGTM! Spanish translations complete the localization triad.

All new account info dialog strings are properly translated to Spanish and maintain consistency with the English and Italian versions.

lib/features/key_manager/key_management_screen.dart (7)

5-5: LGTM! Required import for new UI icons.

The lucide_icons import is necessary for the new icons used in the redesigned cards.


24-24: Good security practice! Seed phrase hidden by default.

The _showSecretWords state variable ensures sensitive mnemonic phrases are masked by default, improving security UX.


74-95: Import functionality preserved for future use.

The _importKey method is intentionally disabled as mentioned in the PR summary. Consider adding a TODO comment explaining when this will be re-enabled.


97-108: Excellent security enhancement for seed phrase display!

The masking function cleverly shows only the first 2 and last 2 words, allowing users to verify their seed phrase without exposing all sensitive data.


110-170: Clean refactoring improves code organization.

The build method is now more maintainable with dedicated builder methods for each UI component. The consistent theming enhances the visual design.


177-178: Correctly uses latest Flutter color API.

Good job using withValues(alpha:) instead of the deprecated withOpacity() throughout the file.

Also applies to: 231-232, 291-292, 345-346, 401-402, 455-456, 526-526, 538-539, 546-547, 563-564, 607-608


555-661: Well-structured dialog implementations.

Both dialogs follow best practices:

  • Consistent styling with AppTheme
  • Proper use of dialogContext for navigation
  • Clear warning about reputation loss in the generate user dialog
  • All strings properly localized

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