Description
When a user enters their own Stellar address, every explanation flips to first-person language: 'You sent 50 XLM to...' instead of 'GABC... sent 50 XLM to GDCD...'. This makes the app feel personal and dramatically more useful for anyone reviewing their own transaction history.
What To Build
src/hooks/usePersonalMode.ts
- Stores
myAddress in localStorage under stellar-explain-my-address
- Exports:
setMyAddress(), clearMyAddress(), personalise(text: string): string
personalise() replaces myAddress occurrences in explanation text with 'you' / 'your account'
src/components/common/PersonalModeToggle.tsx
- A 'Personalise ✦' button in the result area header
- Clicking opens a popover: 'Enter your address to personalise explanations'
- On submit: validates address (G-prefix, 56 chars), saves, re-renders all explanations with substitutions
- While active: button shows 'Personal mode on · [truncated address]' with ✕ to clear
Apply personalise() to:
TransactionResult → summary, payment from/to/summary fields
AccountResult → summary field
Key Files
src/hooks/usePersonalMode.ts
src/components/common/PersonalModeToggle.tsx
src/components/TransactionResult.tsx
src/components/AccountResult.tsx
Acceptance Criteria
Complexity: High · 200 pts
Stage: S10 — Power Features (Wave 2)
Depends on: UI #6, UI #7
Description
When a user enters their own Stellar address, every explanation flips to first-person language: 'You sent 50 XLM to...' instead of 'GABC... sent 50 XLM to GDCD...'. This makes the app feel personal and dramatically more useful for anyone reviewing their own transaction history.
What To Build
src/hooks/usePersonalMode.tsmyAddressinlocalStorageunderstellar-explain-my-addresssetMyAddress(),clearMyAddress(),personalise(text: string): stringpersonalise()replacesmyAddressoccurrences in explanation text with 'you' / 'your account'src/components/common/PersonalModeToggle.tsxApply
personalise()to:TransactionResult→summary, paymentfrom/to/summaryfieldsAccountResult→summaryfieldKey Files
src/hooks/usePersonalMode.tssrc/components/common/PersonalModeToggle.tsxsrc/components/TransactionResult.tsxsrc/components/AccountResult.tsxAcceptance Criteria
Complexity: High · 200 pts
Stage: S10 — Power Features (Wave 2)
Depends on: UI #6, UI #7