diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a6fb21ded..55c2c6d29a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased — desktop help and next steps + +- Add **Help** to the desktop sidebar, linking the guide, the Darkbloom Slack and GitHub Discussions, and offer **Get help** next to failures: failed operation notifications, an unreachable runtime, failed sign-in (beside **Try again**), and a failed runtime install or repair. + ## Unreleased — desktop hardware load - Serve real whole-machine load to the desktop app over the authenticated loopback control API: per-core CPU load with the chip's tier and cluster layout (including M5 Super cores), GPU utilization and memory, ANE activity, memory use and pressure, thermal state, and Darkbloom's share of GPU time. Sampling runs in the desktop API process only while the app is looking, without root, and never reaches heartbeats, logs or the coordinator. diff --git a/desktop-app/src/renderer/App.tsx b/desktop-app/src/renderer/App.tsx index 64751a992b..c9e04cc4c5 100644 --- a/desktop-app/src/renderer/App.tsx +++ b/desktop-app/src/renderer/App.tsx @@ -12,6 +12,7 @@ import { Onboarding } from './components/Onboarding'; import { onboardingScenario } from './previewEligibility'; import { Earnings } from './features/Earnings'; import { Appearance } from './components/Appearance'; +import { GetHelp, HelpControl } from './components/Help'; import { AccountControl } from './components/AccountControl'; import { SocialLinks } from './components/SocialLinks'; const navigation = [ @@ -71,6 +72,7 @@ export default function App() { ))}
+
@@ -89,7 +91,13 @@ export default function App() { className={`page-content ${machineRoute ? 'machine-page' : route === 'home' ? 'home-page' : ''}`} > {backend.status.state !== 'ready' && ( - {backend.status.message || 'Connecting to this Mac…'} + + {backend.status.message || 'Connecting to this Mac…'} + {/* Waiting needs no next step; a runtime that can't be reached does. */} + {backend.status.state !== 'connecting' && backend.status.state !== 'installing' && ( + + )} + )} {route === 'home' && ( diff --git a/desktop-app/src/renderer/components/Help.tsx b/desktop-app/src/renderer/components/Help.tsx new file mode 100644 index 0000000000..45df96cbdc --- /dev/null +++ b/desktop-app/src/renderer/components/Help.tsx @@ -0,0 +1,74 @@ +import { ArrowUpRight, LifeBuoy } from 'lucide-react'; +import { useCallback, useState } from 'react'; +import { createPortal } from 'react-dom'; +import type { DesktopAPI } from '../../shared/contracts'; +import { api } from '../useBackend'; +import { External, Modal } from './UI'; +import styles from './help.module.css'; + +const resources: { + target: Parameters[0]; + title: string; + description: string; +}[] = [ + { + target: 'docs', + title: 'Read the guide', + description: 'Setting up, serving, earnings, and troubleshooting.', + }, + { + target: 'slack', + title: 'Ask in Slack', + description: 'Get help from the Darkbloom team and other providers.', + }, + { + target: 'community', + title: 'Community discussions', + description: 'Search questions and answers on GitHub, or ask your own.', + }, +]; + +// The next step for a failure the app can't fix by itself: the guide covers troubleshooting. +export function GetHelp() { + return Get help; +} + +export function HelpControl({ version }: { version?: string }) { + const [open, setOpen] = useState(false); + const close = useCallback(() => setOpen(false), []); + return ( + <> + + {open && + createPortal( + +
    + {resources.map(({ target, title, description }) => ( +
  • + +
  • + ))} +
+ {version && ( +

When you ask, mention Darkbloom {version}.

+ )} +
, + document.body, + )} + + ); +} diff --git a/desktop-app/src/renderer/components/account/AccountSignInProgress.tsx b/desktop-app/src/renderer/components/account/AccountSignInProgress.tsx index 741306f8a4..d10d703973 100644 --- a/desktop-app/src/renderer/components/account/AccountSignInProgress.tsx +++ b/desktop-app/src/renderer/components/account/AccountSignInProgress.tsx @@ -2,6 +2,7 @@ import { ArrowUpRight, Check, Copy, LoaderCircle } from 'lucide-react'; import { useState } from 'react'; import type { Operation } from '../../../shared/contracts'; import { api, type BackendState } from '../../useBackend'; +import { GetHelp } from '../Help'; import styles from './account.module.css'; export function AccountSignInProgress({ @@ -74,9 +75,16 @@ export function AccountSignInProgress({ {backend.error}

)} - +
+ + +
); return ( diff --git a/desktop-app/src/renderer/components/account/account.module.css b/desktop-app/src/renderer/components/account/account.module.css index 5d3a5c6a72..c1ec2b24f1 100644 --- a/desktop-app/src/renderer/components/account/account.module.css +++ b/desktop-app/src/renderer/components/account/account.module.css @@ -122,7 +122,8 @@ width: 100%; justify-content: center; } -.signInActions > :global(.quiet) { +.signInActions > :global(.quiet), +.signInActions > :global(.text-link) { justify-self: center; } diff --git a/desktop-app/src/renderer/components/help.module.css b/desktop-app/src/renderer/components/help.module.css new file mode 100644 index 0000000000..693b025ab0 --- /dev/null +++ b/desktop-app/src/renderer/components/help.module.css @@ -0,0 +1,79 @@ +.trigger { + display: flex; + align-items: center; + gap: 12px; + width: 100%; + min-height: 38px; + margin-bottom: 10px; + padding: 9px 14px; + border-radius: 6px; + color: var(--text-secondary); + font-size: 13px; + text-align: left; + -webkit-app-region: no-drag; + transition: + background 0.16s, + color 0.16s; +} +.trigger:hover { + background: rgba(var(--contrast-rgb), 0.027); + color: var(--text-primary); +} +.list { + display: grid; + gap: 8px; + margin: 18px 0 0; + padding: 0; + list-style: none; +} +.item { + display: flex; + align-items: center; + gap: 16px; + width: 100%; + padding: 13px 14px; + border: 1px solid var(--line); + border-radius: 8px; + text-align: left; + transition: + background var(--hover-duration), + border-color var(--hover-duration); +} +.item:hover { + border-color: rgba(var(--contrast-rgb), 0.2); + background: rgba(var(--contrast-rgb), 0.03); +} +.item > span { + flex: 1; + min-width: 0; +} +.item strong { + display: block; + font-size: 13px; + font-weight: 500; +} +.item small { + display: block; + margin-top: 4px; + color: var(--muted); + font-size: 11px; +} +.item > svg { + flex-shrink: 0; + color: var(--muted); +} +.list ~ .version { + margin: 16px 0 0; + color: var(--muted); + font-size: 11px; +} +@media (max-width: 760px) { + .trigger { + justify-content: center; + gap: 0; + padding: 12px; + } + .trigger > span { + display: none; + } +} diff --git a/desktop-app/src/renderer/components/onboarding/RuntimeSetup.tsx b/desktop-app/src/renderer/components/onboarding/RuntimeSetup.tsx index 6bfa8a0ec9..8cae6966cc 100644 --- a/desktop-app/src/renderer/components/onboarding/RuntimeSetup.tsx +++ b/desktop-app/src/renderer/components/onboarding/RuntimeSetup.tsx @@ -2,6 +2,7 @@ import { Download } from 'lucide-react'; import { useState } from 'react'; import type { BackendState } from '../../useBackend'; import { api } from '../../useBackend'; +import { GetHelp } from '../Help'; import { Button, Notice } from '../UI'; export function RuntimeSetup({ backend }: { backend: BackendState }) { @@ -28,6 +29,11 @@ export function RuntimeSetup({ backend }: { backend: BackendState }) { + {error && ( +

+ +

+ )} ); } diff --git a/desktop-app/src/renderer/components/operations/OperationToast.tsx b/desktop-app/src/renderer/components/operations/OperationToast.tsx index 3ec97558b2..3a2dfaee14 100644 --- a/desktop-app/src/renderer/components/operations/OperationToast.tsx +++ b/desktop-app/src/renderer/components/operations/OperationToast.tsx @@ -1,6 +1,7 @@ import { Check, LoaderCircle, X } from 'lucide-react'; import { createPortal } from 'react-dom'; import type { Operation } from '../../../shared/contracts'; +import { GetHelp } from '../Help'; export function OperationToast({ state, @@ -15,11 +16,12 @@ export function OperationToast({ onCancel?: () => void; onClose?: () => void; }) { + const failed = state === 'failed' || state === 'interrupted'; return createPortal(