Skip to content

Conversation

@zensgit
Copy link
Owner

@zensgit zensgit commented Sep 28, 2025

Adds SharedPreferences-backed persistence for TransactionController grouping and collapsed groups (tx_grouping, tx_group_collapse). Includes unit test covering persistence. No UI changes in this PR; follow-ups will wire UI toggles.\n\nNotes:\n- Scoped to controller; keys not yet namespaced per ledger (planned follow-up).\n- Ran targeted test: test/transactions/transaction_controller_grouping_test.dart — passed.\n

…nce.share/shareXFiles in QR + ShareService; remove local stub
…ignores; fix template onCancel and batch dialogs snackbars
…rs (accounts/dashboard types, const-eval, family settings void, email Address stub); wire A/B/C entrances
…oup toggle in TransactionList; optional filter icon in RecentTransactions
…sactions; finalize TransactionList search bar impl
@zensgit zensgit marked this pull request as ready for review September 29, 2025 00:55
Copilot AI review requested due to automatic review settings September 29, 2025 00:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds SharedPreferences-backed persistence for transaction controller grouping functionality and includes unit tests. It introduces the foundation for transaction grouping by date/category/account with the ability to persist collapsed group states. This is part of Phase B1 of the transaction filtering and grouping feature implementation.

  • Adds TransactionGrouping enum and persistence methods to TransactionController
  • Implements unit tests for grouping persistence functionality using SharedPreferences
  • Adds new user assets screen with routing and navigation entry points

Reviewed Changes

Copilot reviewed 51 out of 55 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/transactions/transaction_controller_grouping_test.dart New unit test file covering transaction controller grouping and collapse persistence
lib/providers/transaction_provider.dart Adds TransactionGrouping enum, state fields, and SharedPreferences persistence methods
lib/screens/accounts/user_assets_screen.dart New screen for displaying user asset overview with net worth calculations
lib/core/router/app_router.dart Adds routing configuration for user assets screen
Various UI files Multiple code quality improvements including context capture before async operations and constant value fixes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +259 to +260
final prefs = await SharedPreferences.getInstance();
final groupingStr = prefs.getString("tx_grouping");
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The persistence keys 'tx_grouping' and 'tx_group_collapse' are not namespaced per ledger as mentioned in the PR description. Consider adding ledger context to these keys to support multiple ledgers properly.

Copilot uses AI. Check for mistakes.
final messenger = ScaffoldMessenger.of(context);
final router = GoRouter.of(context);

setState(() { _isLoading = true;
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

The setState call appears to have a formatting issue with the opening brace placement. It should be properly formatted as setState(() {\n_isLoading = true;\n});

Suggested change
setState(() { _isLoading = true;
setState(() {
_isLoading = true;

Copilot uses AI. Check for mistakes.
Comment on lines 106 to 107
? '超支 ${remaining.abs().toStringAsFixed(2)}'
: '剩余 ${remaining.toStringAsFixed(2)}',
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The currency formatting has been simplified to use toStringAsFixed(2) which removes proper currency formatting with symbols and locale-specific number formatting. This may impact user experience in different locales.

Copilot uses AI. Check for mistakes.
Comment on lines 213 to 214
final body = [if (text != null && text.isNotEmpty) text, file.path].whereType<String>().join('\n\n');
await Share.share(body);
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

[nitpick] The share functionality has been simplified to text-only sharing, which may not provide the same user experience as the original file sharing implementation. Consider documenting this limitation or implementing proper file sharing.

Copilot uses AI. Check for mistakes.
Resolved conflicts in:
- transaction_provider.dart: removed duplicate imports, enum, and methods
- family_activity_log_screen.dart: use direct stats assignment
- theme_management_screen.dart: use pre-captured messenger
- family_settings_service.dart: use method signatures with parameters
@zensgit zensgit merged commit 23dee3b into main Oct 8, 2025
@zensgit zensgit deleted the feature/transactions-phase-b1 branch October 8, 2025 03:03
@zensgit zensgit mentioned this pull request Oct 15, 2025
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.

2 participants