diff --git a/package-lock.json b/package-lock.json index 82e270e47..cfd391e52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25681,12 +25681,14 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.8.10", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.10.tgz", - "integrity": "sha512-uLfgBi+7IBNay8ECBO2mVMGZAc1VgZWEChxm4lv+TobGdG82LnXMjuNGo/BSSZZL4UmkWhxEHP2f5ziLNwGWMA==", - "license": "Apache-2.0", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz", + "integrity": "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==", "bin": { - "baseline-browser-mapping": "dist/cli.js" + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" } }, "node_modules/basic-auth": { @@ -26798,9 +26800,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001746", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001746.tgz", - "integrity": "sha512-eA7Ys/DGw+pnkWWSE/id29f2IcPHVoE8wxtvE5JdvD2V28VTDPy1yEeo11Guz0sJ4ZeGRcm3uaTcAqK1LXaphA==", + "version": "1.0.30001775", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001775.tgz", + "integrity": "sha512-s3Qv7Lht9zbVKE9XoTyRG6wVDCKdtOFIjBGg3+Yhn6JaytuNKPIjBMTMIY1AnOH3seL5mvF+x33oGAyK3hVt3A==", "funding": [ { "type": "opencollective", @@ -26814,8 +26816,7 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" + ] }, "node_modules/capture-exit": { "version": "2.0.0", diff --git a/src/components/unsupported-kubo-version/unsupported-kubo-version.tsx b/src/components/unsupported-kubo-version/unsupported-kubo-version.tsx index 288ac2f5c..96f6a9027 100644 --- a/src/components/unsupported-kubo-version/unsupported-kubo-version.tsx +++ b/src/components/unsupported-kubo-version/unsupported-kubo-version.tsx @@ -26,7 +26,7 @@ const UnsupportedKuboVersion: React.FC = () => { }, [agentVersionObject]) if (agentVersionObject == null) { - return null + return
{t('dhtProvide.screen.loading')}
} return ( diff --git a/src/contexts/ProvideStat/provide-context.tsx b/src/contexts/ProvideStat/provide-context.tsx index 7d49b34a7..ae7768d0d 100644 --- a/src/contexts/ProvideStat/provide-context.tsx +++ b/src/contexts/ProvideStat/provide-context.tsx @@ -99,7 +99,7 @@ export const ProvideProvider: React.FC<{ children: React.ReactNode }> = ({ child autoRefreshEnabled, setAutoRefreshEnabled, isAgentVersionSupported - }), [data, loading, error, lastUpdated, refresh, autoRefreshEnabled, isAgentVersionSupported, setAutoRefreshEnabled]) + }), [data, loading, error, lastUpdated, refresh, autoRefreshEnabled, setAutoRefreshEnabled, isAgentVersionSupported]) return ( diff --git a/src/diagnostics/diagnostics-content.tsx b/src/diagnostics/diagnostics-content.tsx index d62c31c86..3af57ee4a 100644 --- a/src/diagnostics/diagnostics-content.tsx +++ b/src/diagnostics/diagnostics-content.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef } from 'react' +import React, { useEffect } from 'react' import { useTranslation } from 'react-i18next' import LogsScreen from './logs-screen/logs-screen.js' import { LogsProvider } from '../contexts/logs/index' @@ -8,10 +8,7 @@ import { useBridgeSelector } from '../helpers/context-bridge' import { RouteInfo } from '../bundles/routes-types' import { ProvideProvider } from '../contexts/ProvideStat' -interface DiagnosticsContentProps { -} - -type TabKey = 'logs' | 'retrieval-check' | 'dht-provide' +type TabKey = 'logs' | 'retrieval' | 'provider' function getTabKeyFromUrl (path: string): { tab: TabKey, remainder?: string } { const parts = path.split('/').filter(p => p) // Remove empty strings @@ -57,32 +54,21 @@ const TabButton = ({ tabKey, label, active }: TabButtonProps) => ( ) -const DiagnosticsContent: React.FC = () => { +const DiagnosticsContent: React.FC = () => { const { t } = useTranslation('diagnostics') const routeInfo = useBridgeSelector('selectRouteInfo') - const path = routeInfo?.params.path ?? '' + const path = routeInfo?.params?.path ?? '' const { tab: activeTab, remainder } = getTabKeyFromUrl(path) // Redirect from /diagnostics or /diagnostics/ to /diagnostics/logs useEffect(() => { - // Check if we're still loading route info if (!routeInfo) return - - // Only redirect from true root paths const isRootDiagnostics = routeInfo.url === '/diagnostics' || routeInfo.url === '/diagnostics/' if (isRootDiagnostics && (path === '' || path === '/')) { window.location.replace('#/diagnostics/logs') } }, [path, routeInfo]) - const isMounted = useRef(false) - useEffect(() => { - isMounted.current = true - return () => { - isMounted.current = false - } - }, []) - const renderTabContent = () => { switch (activeTab) { case 'logs': @@ -93,12 +79,11 @@ const DiagnosticsContent: React.FC = () => { ) - case 'retrieval-check': + case 'retrieval': return ( ) - case 'dht-provide': { - // Lazy-load the DHT provide screen to keep bundle size small + case 'provider': { const DhtProvideScreen = require('./dht-provide/dht-provide-screen').default return ( @@ -119,8 +104,8 @@ const DiagnosticsContent: React.FC = () => {
diff --git a/src/files/FilesPage.js b/src/files/FilesPage.js index 3051a3bb2..a72ab8cc6 100644 --- a/src/files/FilesPage.js +++ b/src/files/FilesPage.js @@ -161,7 +161,7 @@ const FilesPage = ({ const onInspect = (cid) => doUpdateHash(`/explore/${cid}`) const onCheckRetrieval = (cid) => { doFilesCidProvide(cid) // Trigger background provide - doUpdateHash(`/diagnostics/retrieval-check/${cid}`) + doUpdateHash(`/diagnostics/retrieval/${cid}`) } const showModal = (modal, files = null) => setModals({ show: modal, files }) const hideModal = () => setModals({}) diff --git a/src/files/file-not-found/index.tsx b/src/files/file-not-found/index.tsx index 7eb658413..9975eefe5 100644 --- a/src/files/file-not-found/index.tsx +++ b/src/files/file-not-found/index.tsx @@ -38,7 +38,7 @@ const FileNotFound = ({ path, error }: FileNotFoundProps) => {
  • - If you have a CID you believe should work, run Retrieval Diagnostics. + If you have a CID you believe should work, run Retrieval Diagnostics.
  • diff --git a/src/settings/SettingsPage.js b/src/settings/SettingsPage.js index d814c656b..a7c4e48b6 100644 --- a/src/settings/SettingsPage.js +++ b/src/settings/SettingsPage.js @@ -105,7 +105,7 @@ export const SettingsPage = ({

    ipfs-check - retrieval diagnostics + retrieval diagnostics

    diff --git a/test/e2e/diagnostics-dht-provide.test.js b/test/e2e/diagnostics-dht-provide.test.js index e55691444..3ba178c64 100644 --- a/test/e2e/diagnostics-dht-provide.test.js +++ b/test/e2e/diagnostics-dht-provide.test.js @@ -19,7 +19,7 @@ const dhtProvide = { test.describe('DHT Provide diagnostics page', () => { test.beforeEach(async ({ page }) => { - await page.goto('/#/diagnostics/dht-provide') + await page.goto('/#/diagnostics/provider') // wait for the stats grid to appear (indicates data has loaded) await expect(dhtProvide.grid(page)).toBeVisible({ timeout: 15000 }) })