Skip to content

Commit 0d4f869

Browse files
Gaubeeclaude
andcommitted
chore: scaffold add-notification-system change (T011)
Phase 7 Notification System: - T011.1: NotificationStore (~6 tests) - T011.2: NotificationPermissionSheet (~6 tests) - T011.3: NotificationCenter (~8 tests) - T011.4: TransactionNotification (~6 tests) Route: /notifications Estimated: ~26 tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 77bd76f commit 0d4f869

4 files changed

Lines changed: 176 additions & 3 deletions

File tree

docs/por/POR.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
- Bet 2: TanStack ecosystem provides type-safe routing and state | Probe: integration tests | Evidence: pending | Window: Phase 2
1818

1919
## Roadmap (Now/Next/Later)
20-
- Now (<= 2 weeks): Wallet management, address book
21-
- Next (<= 6 weeks): Advanced features, notifications
22-
- Later (> 6 weeks): Staking, DWEB/Plaoc integration, biometric auth
20+
- Now (<= 2 weeks): Notifications, token price display
21+
- Next (<= 6 weeks): Staking (Epic 5), DWEB/Plaoc integration (Epic 8)
22+
- Later (> 6 weeks): Biometric auth, multi-language enhancement
2323

2424
## Decision & Pivot Log (recent 5)
2525
- 2025-12-10 | T001 complete | 8 core components delivered with 90 new tests | 453 total tests passing | archived
@@ -46,6 +46,7 @@
4646
- Phase 5 Transaction History: **COMPLETE** ✅ (hook + list + detail)
4747
- T010 Wallet Management: **complete** (committed, S1-S4 all done)
4848
- Phase 6 Wallet Management: **COMPLETE** ✅ (wallet list + edit + address book)
49+
- T011 Notification System: **pending** (scaffolded, S1-S4 pending)
4950

5051
## Operating Principles (short)
5152
- Falsify before expand; one decidable next step; stop with pride when wrong; Done = evidence.
@@ -70,6 +71,7 @@
7071
- 2025-12-11 06:55 | PeerB | T010.1-2 committed (fa8aad1) | 828 tests, 17 new | WalletListPage + WalletEditSheet done
7172
- 2025-12-11 06:58 | PeerB | T010.3 committed (e22e51d) | 835 tests, 7 new | AddressBookStore with CRUD + persistence
7273
- 2025-12-11 07:00 | PeerB | T010.4 committed | 843 tests, 8 new | Phase 6 Wallet Management COMPLETE
74+
- 2025-12-11 07:05 | PeerB | T011 change scaffolded (add-notification-system) | Phase 7 Notifications start
7375

7476
<!-- Generated on 2025-12-10T10:02:26+00:00 by por_manager.ensure_por 0.1.1 ; template_sha1=7342dc47bce1342e40656c7ab0c32577632e15a2 -->
7577

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
id: T011
2+
name: Notification System
3+
goal: Implement in-app notification system for transaction status and wallet events per PDR Epic 9
4+
status: pending
5+
steps:
6+
- id: S1
7+
name: NotificationStore
8+
done: Notification state with persistence
9+
status: pending
10+
- id: S2
11+
name: NotificationPermissionSheet
12+
done: Push permission flow
13+
status: pending
14+
- id: S3
15+
name: NotificationCenter
16+
done: Notification list page
17+
status: pending
18+
- id: S4
19+
name: TransactionNotification
20+
done: Transaction status toasts
21+
status: pending
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Proposal: Add Notification System
2+
3+
## Summary
4+
5+
Implement an in-app notification system to provide real-time feedback on transaction status and other important events. This enhances user trust by keeping them informed about their wallet activities.
6+
7+
## Motivation
8+
9+
Per PDR Epic 9 (Personalization) and user expectations:
10+
- Users need immediate feedback when transactions are sent/received
11+
- Transaction status changes (pending → confirmed → complete) should be visible
12+
- Important wallet events (backup reminders, security alerts) need a delivery mechanism
13+
14+
## Scope
15+
16+
### In Scope
17+
- NotificationStore for state management and persistence
18+
- Permission flow for push notifications (future native integration)
19+
- In-app notification center UI
20+
- Transaction status notifications/toasts
21+
22+
### Out of Scope
23+
- Native push notification integration (Capacitor/Plaoc - Later phase)
24+
- Email notifications
25+
- SMS notifications
26+
27+
## Design
28+
29+
### Components
30+
31+
1. **NotificationStore** (`src/stores/notification.ts`)
32+
- Notification type with id, type, title, message, timestamp, read status
33+
- Actions: add, markRead, markAllRead, clear
34+
- localStorage persistence
35+
36+
2. **NotificationPermissionSheet** (`src/components/notification/permission-sheet.tsx`)
37+
- Request permission flow
38+
- Explain benefits
39+
- Handle denied state gracefully
40+
41+
3. **NotificationCenter** (`src/pages/notifications/index.tsx`)
42+
- List all notifications
43+
- Mark as read on view
44+
- Clear all option
45+
- Route: /notifications
46+
47+
4. **TransactionNotification** (`src/components/notification/transaction-toast.tsx`)
48+
- Toast component for transaction updates
49+
- States: pending, confirmed, failed
50+
- Dismissible with auto-hide
51+
52+
### Routes
53+
- `/notifications` - Notification center
54+
55+
## Task Breakdown
56+
57+
| Task | Description | Tests |
58+
|------|-------------|-------|
59+
| T011.1 | NotificationStore | ~6 |
60+
| T011.2 | NotificationPermissionSheet | ~6 |
61+
| T011.3 | NotificationCenter | ~8 |
62+
| T011.4 | TransactionNotification | ~6 |
63+
| **Total** | | **~26** |
64+
65+
## Dependencies
66+
67+
- TanStack Store (exists)
68+
- BottomSheet (exists)
69+
- PageHeader (exists)
70+
71+
## Risks
72+
73+
- **Low**: Push permission may be denied - graceful fallback to in-app only
74+
- **Low**: Notification overload - implement rate limiting for transaction notifications
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Tasks: Notification System
2+
3+
## T011: Notification System
4+
5+
### Status: pending
6+
7+
### Tasks
8+
9+
#### T011.1: NotificationStore
10+
- [ ] Create `src/stores/notification.ts`
11+
- [ ] Define Notification type (id, type, title, message, timestamp, read, data?)
12+
- [ ] NotificationType enum (transaction, security, system)
13+
- [ ] Actions: add, markRead, markAllRead, clearAll
14+
- [ ] localStorage persistence
15+
- [ ] Write tests (~6 tests)
16+
17+
**Acceptance**: Notifications persist across page reloads
18+
19+
---
20+
21+
#### T011.2: NotificationPermissionSheet
22+
- [ ] Create `src/components/notification/permission-sheet.tsx`
23+
- [ ] Explain push notification benefits
24+
- [ ] Request permission button
25+
- [ ] Handle denied state with "Settings" link
26+
- [ ] Skip option for later
27+
- [ ] Write tests (~6 tests)
28+
- [ ] Write Storybook story
29+
30+
**Acceptance**: Permission flow handles all states (granted, denied, default)
31+
32+
---
33+
34+
#### T011.3: NotificationCenter
35+
- [ ] Create `src/pages/notifications/index.tsx`
36+
- [ ] List notifications with grouping by date
37+
- [ ] Empty state when no notifications
38+
- [ ] Mark as read on tap
39+
- [ ] Clear all button in header
40+
- [ ] Add route `/notifications`
41+
- [ ] Write tests (~8 tests)
42+
- [ ] Write Storybook story
43+
44+
**Acceptance**: Can view and manage all notifications
45+
46+
---
47+
48+
#### T011.4: TransactionNotification
49+
- [ ] Create `src/components/notification/transaction-toast.tsx`
50+
- [ ] Toast states: pending, confirmed, failed
51+
- [ ] Icon and color per state
52+
- [ ] Auto-dismiss after 5s (configurable)
53+
- [ ] Tap to view transaction detail
54+
- [ ] Write tests (~6 tests)
55+
- [ ] Write Storybook story
56+
57+
**Acceptance**: Transaction status visible as toast during send flow
58+
59+
---
60+
61+
## Dependencies
62+
63+
- TanStack Store (exists)
64+
- BottomSheet (exists)
65+
- PageHeader (exists)
66+
- useToast hook (may need to create)
67+
68+
## Estimated Test Count
69+
70+
| Task | Tests |
71+
|------|-------|
72+
| T011.1 NotificationStore | ~6 |
73+
| T011.2 NotificationPermissionSheet | ~6 |
74+
| T011.3 NotificationCenter | ~8 |
75+
| T011.4 TransactionNotification | ~6 |
76+
| **Total** | **~26** |

0 commit comments

Comments
 (0)