From ac7bb7c436aea3565dda1b6b8a72096d1bfa524b Mon Sep 17 00:00:00 2001 From: plebeius Date: Sun, 12 Oct 2025 22:27:36 +0200 Subject: [PATCH 1/5] feat(challenge modal): improve iframe challenge confirmation message --- .../challenge-modal.module.css | 2 ++ .../challenge-modal/challenge-modal.tsx | 28 +++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/challenge-modal/challenge-modal.module.css b/src/components/challenge-modal/challenge-modal.module.css index b761d5a6..682230c4 100644 --- a/src/components/challenge-modal/challenge-modal.module.css +++ b/src/components/challenge-modal/challenge-modal.module.css @@ -110,6 +110,8 @@ font-size: 14px; text-align: center; padding: 20px 0; + word-break: break-word; + overflow-wrap: break-word; } .iframeWrapper { diff --git a/src/components/challenge-modal/challenge-modal.tsx b/src/components/challenge-modal/challenge-modal.tsx index d10321ab..4898718e 100644 --- a/src/components/challenge-modal/challenge-modal.tsx +++ b/src/components/challenge-modal/challenge-modal.tsx @@ -26,6 +26,7 @@ const ChallengeHeader = ({ publicationType, votePreview, parentCid, parentAddres return ( <> + {/* TODO: update translation to "Anti-spam challenge from p/{{subplebbit}}" */}
{t('challenge_from', { subplebbit })}
{publicationType === 'vote' && votePreview + ' '} @@ -101,6 +102,25 @@ const RegularChallengeContent = ({ challenge, closeModal }: RegularChallengeCont } }; + // Get URL for iframe challenge confirmation (hostname only for whitelisted sites, full URL otherwise) + const getChallengeUrl = () => { + try { + const iframeUrl = currentChallenge?.challenge; + if (!iframeUrl) return ''; + const url = new URL(iframeUrl); + + // Whitelist mintpass.org - only show hostname for trusted sites + if (url.hostname === 'mintpass.org') { + return url.hostname; + } + + // For other sites, show full URL for transparency + return url.href; + } catch { + return ''; + } + }; + const handleLoadIframe = () => { const iframeUrl = currentChallenge?.challenge; if (!iframeUrl) return; @@ -203,14 +223,16 @@ const RegularChallengeContent = ({ challenge, closeModal }: RegularChallengeCont <>
- {t('iframe_challenge_warning', { - defaultValue: 'This challenge requires loading an external website. Loading it will reveal your IP address to that website. Do you want to continue?', + {t('iframe_challenge_open_confirmation', { + subplebbit, + url: decodeURIComponent(getChallengeUrl()), + defaultValue: `p/${subplebbit} anti-spam challenge wants to open ${decodeURIComponent(getChallengeUrl())}`, })}
- +
From cc524d4595dd9e011849dd5bdad09a23ae513581 Mon Sep 17 00:00:00 2001 From: plebeius Date: Sun, 12 Oct 2025 22:38:27 +0200 Subject: [PATCH 2/5] Remove 'anti-spam' wording from challenge UI --- src/components/challenge-modal/challenge-modal.tsx | 3 +-- src/views/subplebbit-settings/subplebbit-settings.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/challenge-modal/challenge-modal.tsx b/src/components/challenge-modal/challenge-modal.tsx index 4898718e..4b4f1c3b 100644 --- a/src/components/challenge-modal/challenge-modal.tsx +++ b/src/components/challenge-modal/challenge-modal.tsx @@ -26,7 +26,6 @@ const ChallengeHeader = ({ publicationType, votePreview, parentCid, parentAddres return ( <> - {/* TODO: update translation to "Anti-spam challenge from p/{{subplebbit}}" */}
{t('challenge_from', { subplebbit })}
{publicationType === 'vote' && votePreview + ' '} @@ -226,7 +225,7 @@ const RegularChallengeContent = ({ challenge, closeModal }: RegularChallengeCont {t('iframe_challenge_open_confirmation', { subplebbit, url: decodeURIComponent(getChallengeUrl()), - defaultValue: `p/${subplebbit} anti-spam challenge wants to open ${decodeURIComponent(getChallengeUrl())}`, + defaultValue: `p/${subplebbit} challenge wants to open ${decodeURIComponent(getChallengeUrl())}`, })}
diff --git a/src/views/subplebbit-settings/subplebbit-settings.tsx b/src/views/subplebbit-settings/subplebbit-settings.tsx index 4558a34f..5cba568c 100644 --- a/src/views/subplebbit-settings/subplebbit-settings.tsx +++ b/src/views/subplebbit-settings/subplebbit-settings.tsx @@ -582,7 +582,7 @@ const SubplebbitSettings = () => { )} {isReadOnly && !userIsOwnerOrAdmin &&
{t('owner_settings_notice')}
} {isOffline &&
{offlineTitle}
} - {isChallengesReadOnly &&
cannot read or write anti-spam challenges, community node isn't reachable.
} + {isChallengesReadOnly &&
cannot read or write challenges, community node isn't reachable.
} <Description isReadOnly={isReadOnly} /> {!isInCreateSubplebbitView && <Address isReadOnly={isReadOnly} />} From 58548ffb05f57cd18cf9df95091474cb4d100c1f Mon Sep 17 00:00:00 2001 From: plebeius <tom@plebbit.com> Date: Thu, 23 Oct 2025 21:43:04 +0200 Subject: [PATCH 3/5] Update .gitignore --- .gitignore | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 87ea7d89..8996fca1 100644 --- a/.gitignore +++ b/.gitignore @@ -159,11 +159,8 @@ yarn-debug.log* yarn-error.log* .vscode - -# YoYo AI version control directory -.yoyo/ - -# cursor .cursor +.playwright-mcp -.playwright-mcp \ No newline at end of file +# YoYo AI version control directory +.yoyo/ \ No newline at end of file From 4b076ced7066f53d426172cf2926046a5eb675c6 Mon Sep 17 00:00:00 2001 From: plebeius <tom@plebbit.com> Date: Thu, 23 Oct 2025 21:43:37 +0200 Subject: [PATCH 4/5] fix(settings): some plebbit options weren't loading because their naming changed --- src/views/settings/plebbit-options/plebbit-options.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/settings/plebbit-options/plebbit-options.tsx b/src/views/settings/plebbit-options/plebbit-options.tsx index dc8775ac..f811ca5a 100644 --- a/src/views/settings/plebbit-options/plebbit-options.tsx +++ b/src/views/settings/plebbit-options/plebbit-options.tsx @@ -46,8 +46,8 @@ const IPFSGatewaysSettings = ({ ipfsGatewayUrlsRef, mediaIpfsGatewayUrlRef }: Se const PubsubProvidersSettings = ({ pubsubProvidersRef }: SettingsProps) => { const account = useAccount(); const { plebbitOptions } = account || {}; - const { pubsubHttpClientsOptions } = plebbitOptions || {}; - const pubsubProvidersDefaultValue = pubsubHttpClientsOptions?.join('\n'); + const { pubsubKuboRpcClientsOptions } = plebbitOptions || {}; + const pubsubProvidersDefaultValue = pubsubKuboRpcClientsOptions?.join('\n'); return ( <div className={styles.pubsubProvidersSettings}> @@ -57,7 +57,7 @@ const PubsubProvidersSettings = ({ pubsubProvidersRef }: SettingsProps) => { autoCorrect='off' autoComplete='off' spellCheck='false' - rows={pubsubHttpClientsOptions?.length || 3} + rows={pubsubKuboRpcClientsOptions?.length || 3} /> </div> ); From ccb104d910c5dfd278498064d8d5c883bf6f797f Mon Sep 17 00:00:00 2001 From: plebeius <tom@plebbit.com> Date: Thu, 23 Oct 2025 21:48:39 +0200 Subject: [PATCH 5/5] fix(plebbit options): correct pubsub providers property name mismatch --- src/views/settings/plebbit-options/plebbit-options.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/settings/plebbit-options/plebbit-options.tsx b/src/views/settings/plebbit-options/plebbit-options.tsx index f811ca5a..015f2398 100644 --- a/src/views/settings/plebbit-options/plebbit-options.tsx +++ b/src/views/settings/plebbit-options/plebbit-options.tsx @@ -200,7 +200,7 @@ const PlebbitOptions = () => { const mediaIpfsGatewayUrl = mediaIpfsGatewayUrlRef.current?.value.trim() || undefined; - const pubsubHttpClientsOptions = pubsubProvidersRef.current?.value + const pubsubKuboRpcClientsOptions = pubsubProvidersRef.current?.value .split('\n') .map((url) => url.trim()) .filter((url) => url !== ''); @@ -242,7 +242,7 @@ const PlebbitOptions = () => { const newPlebbitOptions: any = {}; if (ipfsGatewayUrls?.length) newPlebbitOptions.ipfsGatewayUrls = ipfsGatewayUrls; - if (pubsubHttpClientsOptions?.length) newPlebbitOptions.pubsubHttpClientsOptions = pubsubHttpClientsOptions; + if (pubsubKuboRpcClientsOptions?.length) newPlebbitOptions.pubsubKuboRpcClientsOptions = pubsubKuboRpcClientsOptions; if (httpRoutersOptions?.length) newPlebbitOptions.httpRoutersOptions = httpRoutersOptions; if (plebbitRpcClientsOptions) newPlebbitOptions.plebbitRpcClientsOptions = plebbitRpcClientsOptions; if (dataPath) newPlebbitOptions.dataPath = dataPath;