Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
94383e8
Make user-created orders also appear in the order book, not just in M…
chebizarro Jul 2, 2025
d5fcfc0
display correct role (buying/selling) in order list item label
chebizarro Jul 2, 2025
8c06529
feat: add invoice text display above copy button in payment widget Fi…
chebizarro Jul 2, 2025
aa24b8a
Remove lightning invoice text and add shared btn
grunch Jul 3, 2025
40bcf54
Fixes: Add confirmation message before starting cooperative cancellat…
chebizarro Jul 2, 2025
2524484
feat: add sendDm action to order state transitions and simplify cance…
chebizarro Jul 3, 2025
d847461
feat: add conditional cancel message for peer-initiated cooperative c…
chebizarro Jul 3, 2025
be2353c
Delete generated by compilation files
grunch Jul 3, 2025
fc6def5
Replace wildcard with complete file names
grunch Jul 3, 2025
3ec9534
Remove claude file, it is not related to this
grunch Jul 3, 2025
e8146e9
feat: implement comprehensive Spanish localization
grunch Jul 3, 2025
d609ce4
feat: Complete comprehensive Spanish localization integration
grunch Jul 3, 2025
9b8dc33
feat: Complete comprehensive Spanish localization for all remaining h…
grunch Jul 3, 2025
4afabd0
fix: Remove duplicate keys from Spanish ARB file
grunch Jul 4, 2025
aff1c86
fix: Remove duplicate keys from Italian ARB file (lines 159-197)
grunch Jul 4, 2025
37d729b
fix: Remove duplicate keys from English ARB file
grunch Jul 4, 2025
8b59b5b
feat: Complete comprehensive localization for remaining hardcoded str…
grunch Jul 4, 2025
148654e
fix: correct timeLeft localization display in trade detail screen
grunch Jul 4, 2025
39ddaac
fix: implement proper timeago localization for order timestamps
grunch Jul 4, 2025
39acbcf
fix: resolve all Flutter analyze warnings and errors
grunch Jul 4, 2025
ffd5c07
fix: suppress false-positive BuildContext async warnings
grunch Jul 4, 2025
81e28bb
docs: add comprehensive CLAUDE.md project documentation
grunch Jul 5, 2025
2362771
refactor: update trade session handling and localize buy/sell labels
chebizarro Jul 8, 2025
160d4d9
Merge branch 'main' into chebizarro/issue68
chebizarro Jul 8, 2025
5e13b8f
fix: remove duplicate timestamp text in trade detail screen
chebizarro Jul 8, 2025
9689bb8
chore: update flutter action version to 3.32.5 and clean up formatting
chebizarro Jul 8, 2025
e755706
merge upstream
chebizarro Jul 15, 2025
40c19ee
refactor: remove duplicate DateTime assignment and unused collection …
chebizarro Jul 15, 2025
63ca6e1
Merge main
chebizarro Jul 21, 2025
688ceed
fix: optimize session lookup
chebizarro Jul 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.32.4'
flutter-version: '3.32.5'

- name: Install dependencies
run: flutter pub get
Expand Down
5 changes: 0 additions & 5 deletions lib/features/home/providers/home_order_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,20 @@ import 'package:mostro_mobile/data/models/enums/order_type.dart';
import 'package:mostro_mobile/data/models/enums/status.dart';
import 'package:mostro_mobile/data/models/nostr_event.dart';
import 'package:mostro_mobile/shared/providers/order_repository_provider.dart';
import 'package:mostro_mobile/shared/providers/session_notifier_provider.dart';

final homeOrderTypeProvider = StateProvider((ref) => OrderType.sell);

final filteredOrdersProvider = Provider<List<NostrEvent>>((ref) {
final allOrdersAsync = ref.watch(orderEventsProvider);
final orderType = ref.watch(homeOrderTypeProvider);
final sessions = ref.watch(sessionNotifierProvider);

return allOrdersAsync.maybeWhen(
data: (allOrders) {
final orderIds = sessions.map((s) => s.orderId).toSet();

allOrders
.sort((o1, o2) => o1.expirationDate.compareTo(o2.expirationDate));

final filtered = allOrders.reversed
.where((o) => o.orderType == orderType)
.where((o) => !orderIds.contains(o.orderId))
.where((o) => o.status == Status.pending)
.toList();
return filtered;
Expand Down
26 changes: 22 additions & 4 deletions lib/features/home/widgets/order_list_item.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:collection/collection.dart';
import 'package:dart_nostr/nostr/model/event/event.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:mostro_mobile/core/app_theme.dart';
import 'package:mostro_mobile/data/models/enums/order_type.dart';
import 'package:mostro_mobile/data/enums.dart';
import 'package:mostro_mobile/data/models/nostr_event.dart';
import 'package:mostro_mobile/shared/providers/session_notifier_provider.dart';
import 'package:mostro_mobile/shared/providers/time_provider.dart';
import 'package:mostro_mobile/shared/utils/currency_utils.dart';
import 'package:mostro_mobile/generated/l10n.dart';
Expand Down Expand Up @@ -33,6 +35,18 @@ class OrderListItem extends ConsumerWidget {
? "(+$premiumValue%)"
: "($premiumValue%)";

String orderLabel = order.orderType == OrderType.buy
? S.of(context)!.buying.toUpperCase()
: S.of(context)!.selling.toUpperCase();

final session = ref.watch(sessionProvider(order.orderId!));
if (session != null && session.role != null) {
final selling = session.role == Role.seller
? S.of(context)!.youAreSelling.toUpperCase()
: S.of(context)!.youAreBuying.toUpperCase();
orderLabel = selling;
}

return Container(
margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
decoration: BoxDecoration(
Expand All @@ -50,6 +64,12 @@ class OrderListItem extends ConsumerWidget {
child: InkWell(
borderRadius: BorderRadius.circular(20),
onTap: () {
final sessions = ref.watch(sessionNotifierProvider);
final session = sessions.firstWhereOrNull((s) => s.orderId == order.orderId);
if (session != null && session.role != null) {
context.push('/trade_detail/${session.orderId}');
return;
}
order.orderType == OrderType.buy
? context.push('/take_buy/${order.orderId}')
: context.push('/take_sell/${order.orderId}');
Expand Down Expand Up @@ -88,9 +108,7 @@ class OrderListItem extends ConsumerWidget {
],
),
child: Text(
order.orderType == OrderType.buy
? S.of(context)!.buying
: S.of(context)!.selling,
orderLabel,
style: const TextStyle(
color: Colors.white70,
fontSize: 12,
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@
"sell": "SELL",
"buying": "BUYING",
"selling": "SELLING",
"youAreBuying": "YOU ARE BUYING",
"youAreSelling": "YOU ARE SELLING",
"marketPrice": "Market Price",
"forSats": "For {amount} sats",
"@forSats": {
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@
"sell": "VENDER",
"buying": "COMPRANDO",
"selling": "VENDIENDO",
"youAreBuying": "ESTÁS COMPRANDO",
"youAreSelling": "ESTÁS VENDIENDO",
"marketPrice": "Precio de Mercado",
"forSats": "Por {amount} sats",
"@forSats": {
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl_it.arb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@
"sell": "VENDI",
"buying": "COMPRANDO",
"selling": "VENDENDO",
"youAreBuying": "STAI COMPRANDO",
"youAreSelling": "STAI VENDENDO",
"marketPrice": "Prezzo di Mercato",
"forSats": "Per {amount} sats",
"@forSats": {
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/providers/session_notifier_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ final sessionNotifierProvider =
});

final sessionProvider = StateProvider.family<Session?, String>((ref, id) {
final notifier = ref.watch(sessionNotifierProvider.notifier);
return notifier.getSessionByOrderId(id);
final notifier = ref.watch(sessionNotifierProvider);
return notifier.where((s) => s.orderId == id).firstOrNull;
});