Phase 4 Stage 8: returning-user shell + Tanya Admin sheet
Bestie Choice Sheet on home Mulai Curhat CTA. When the user has at least one prior session (bestieHistoryHasItemsProvider hits the chat- sessions history endpoint), the CTA opens a HaloBottomSheet with two cards: 'bestie yang udah kenal' -> /chat/history, 'bestie baru' -> /payment/entry. Empty history -> direct to /payment/entry. Bestie history list visual upgrade: HaloOrb (mitraId seed) + name + last-session date + topic pills + sessions count + ONLINE pill. Backend getCustomerHistory now returns topics, mitra_is_online, sessions_count in a single payload (no per-row presence round-trip). BestieOfflinePopup with two variants (returning | new_) replacing the legacy BestieUnavailableDialog. tanya admin ghost CTA on both variants opens the new TanyaAdminSheet. Stage 5's targeted-wait declined stub + Stage 7's chat-screen 409 stub + searching-screen call site all migrated to the real component. TanyaAdminSheet: HaloBottomSheet with WA + Telegram buttons, deeplinks fetched via supportHandlesProvider (CC-config-driven). url_launcher added to client_app; ios LSApplicationQueriesSchemes covers https/http/whatsapp/tg. Stage 2's OTP-blocked popup hubungi admin SnackBar stub also migrated to TanyaAdminSheet. Dev-only POST /internal/_test/seed-history-session lets Maestro 08 flow seed a history row before exercising the choice sheet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart';
|
||||
import '../../../core/pairing/pairing_notifier.dart';
|
||||
import '../../../core/theme/halo_tokens.dart';
|
||||
import '../../../core/theme/widgets/widgets.dart';
|
||||
import '../widgets/bestie_unavailable_dialog.dart';
|
||||
|
||||
/// Phase 4 Stage 5 — `SWaitingBestie` overlay.
|
||||
///
|
||||
@@ -16,9 +17,9 @@ import '../../../core/theme/widgets/widgets.dart';
|
||||
/// The countdown is purely cosmetic; the server owns the auto-reject timer.
|
||||
/// - `accepted` (PairingBestieFoundData / PairingActiveData) — routes into
|
||||
/// the chat screen immediately.
|
||||
/// - `declined` (PairingTargetedUnavailableData) — shows the bestie-offline
|
||||
/// popup. TODO(stage8): swap this stub for the proper BestieOfflinePopup
|
||||
/// component once Stage 8 lands.
|
||||
/// - `declined` (PairingTargetedUnavailableData) — shows the
|
||||
/// [BestieOfflinePopup] returning variant; the popup may offer a
|
||||
/// fallback-to-blast CTA when other besties are reachable.
|
||||
class TargetedWaitingScreen extends ConsumerStatefulWidget {
|
||||
final String mitraId;
|
||||
const TargetedWaitingScreen({super.key, required this.mitraId});
|
||||
@@ -58,21 +59,13 @@ class _TargetedWaitingScreenState extends ConsumerState<TargetedWaitingScreen> {
|
||||
}
|
||||
if (next is PairingTargetedUnavailableData && !_popupShown) {
|
||||
_popupShown = true;
|
||||
// TODO(stage8): replace stub with the production BestieOfflinePopup
|
||||
// (Stage 8 owns the proper variant + fallback-to-blast surface).
|
||||
// ignore: discarded_futures
|
||||
HaloPopup.show(
|
||||
BestieOfflinePopup.show(
|
||||
context,
|
||||
title: '${next.mitraName} lagi nggak online',
|
||||
body:
|
||||
'bestie kamu belum bisa nerima chat sekarang. coba bestie lain atau balik ke beranda dulu ya.',
|
||||
primary: HaloPopupAction(
|
||||
label: 'kembali ke home',
|
||||
onPressed: () {
|
||||
ref.read(pairingProvider.notifier).reset();
|
||||
if (mounted) context.go('/home');
|
||||
},
|
||||
),
|
||||
variant: BestieOfflineVariant.returning,
|
||||
mitraName: next.mitraName,
|
||||
paymentSessionId: next.paymentSessionId,
|
||||
topicSensitivity: next.topicSensitivity,
|
||||
).then((_) {
|
||||
if (mounted) _popupShown = false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user