Optional block explorer links after sending#1109
Optional block explorer links after sending#1109kunal-595 wants to merge 3 commits intojoinmarket-webui:v2from
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an opt-in setting to display block explorer links after a successful send, generating mempool.space URLs per network and hiding links on unsupported networks (e.g. regtest).
Changes:
- Add
showBlockExplorersetting persisted injamSettingsStore(default off) and expose a toggle in Display settings. - Add
getExplorerUrl()helper for mempool.space tx/address links by network. - Append an optional “View in explorer” link to the send success alert when enabled.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/store/jamSettingsStore.ts | Adds persisted showBlockExplorer setting (default off). |
| src/lib/utils.ts | Introduces getExplorerUrl() helper for explorer link generation. |
| src/i18n/locales/en/translation.json | Adds UI strings for the new setting and link text. |
| src/components/settings/SettingsPage.tsx | Adds Display setting switch to toggle explorer links. |
| src/components/send/SendPage.tsx | Shows optional explorer link on successful send based on setting + network. |
Comments suppressed due to low confidence (1)
src/store/jamSettingsStore.ts:38
- Because this store persists a nested
stateobject, Zustand's defaultpersistmerge will replacestatewholesale from localStorage. Existing users with an older stored value won't get the newshowBlockExplorerdefault, so it can beundefinedat runtime (and future settings additions will have the same issue). Consider adding aversion+migrate, or a custommergethat deep-mergesstatewithinitialso new keys are backfilled.
const initial: JamSettings = {
developerMode: isDevMode(),
privateMode: false,
currencyUnit: 'sats',
cheatsheetForceOpenAt: undefined,
showBlockExplorer: false,
}
export const jamSettingsStore = createStore<JamSettingsStoreState>()(
persist(
(set) => ({
state: initial,
update: (val) => set((state) => ({ state: { ...state.state, ...val } })),
clear: () => set({ state: initial }),
}),
{
name: 'jam-settings-store',
storage: createJSONStorage(() => localStorage),
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I am not sure about this one @kunal-595. |
|
@kunal-595 Would you make the url configurable and potentially add a component that displays txids with a link if an explorer is configured? |
|
I will make the URL configurable via a template and add the conditional component for txid links , will update the pr shortly. |
|
I agree the idea is good. But having leading people to third party block explorers is bad for privacy. |
|
Closing as wont do for now! |
Toggle in Display settings (off by default), when on the send success alert gets a mempool.space link.
Returns null for regtest so no broken link shows up
Recording.2026-02-17.161851.mp4