Extract shared request-state boundary for popup data screens
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start with PR #2779 and commit 232c3d04b1768f79378d581d12d871830be3355b to review the existing request-state guards in AddAsset, Wallets, SwapAmount, SendAmount, and AssetVisibility. Trace those five popup call sites and define the shared boundary around their repeated loading, error, reroute, and resolved behavior. Done means all five screens use the shared boundary and resolved children receive the success payload safely.
Written by the indexing model from the issue text.
Description
Follow-up from #2758 (Guard popup views against RequestState.ERROR data dereferences).
Context
PR #2779 fixed the RequestState.ERROR crashes in SwapAmount, SendAmount, and AssetVisibility by hand-applying the same loading → error → reroute → resolved guard sequence already present in AddAsset and Wallets. The pattern is now duplicated across at least five popup screens (AddAsset, Wallets, SwapAmount, SendAmount, AssetVisibility), each with its own __fetch-fail div, <Notification variant="error">, and const data = state.data binding. The next view that wires up a useGetAppData-style hook will almost certainly forget one of these guards and reintroduce the crash class.
What needs to happen
Extract a shared boundary that takes a State<NeedsReRoute | TResolved, E> plus per-screen title / message strings and a children: (data: TResolved) => ReactNode render prop, and returns either the loader, the error Notification, the reroute Navigate, or children(data). Migrate all five existing call sites to use it. Consider a typed useResolvedState projection variant so call sites only ever see the success payload.
Dependencies
None.
References
- Parent issue: #2758
- Implementation PR: #2779
- Implementation commit: 232c3d04b1768f79378d581d12d871830be3355b
- Reviewer recommendation in #2758 (review-fix r1, verdict SOUND)
- Dominant language
- TypeScript
- Stars
- 122
- Forks
- 62
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 41
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stellar/freighter
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Write the banner publishing guidePossibly taken @aristidesstaffieri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
stellar/freighter#3152 · 1 assignee ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
Dont call blockaid on empty token listMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
All issues in stellar/freighter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zabuton-app/meguri#875 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
iruzen-dono/workless#117 ·
Maintainers usually reply within 1 day
-
area:api area:web wave wave:trivial
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vetro-protocol/vetro-monorepo#1321 ·
Maintainers usually reply within 1 day