Skip to content

armgit / plexo

Public Imported from GitHub
0

Speed up downloads by combining multiple network connections in parallel

Add dark mode, clean up IPC errors, distinguish per-link connections

Anmol Kapil38a954d10ed0
diff --git a/src/main/index.ts b/src/main/index.ts
index 8330c24..e90abe8 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -1,5 +1,5 @@
import { electronApp, is, optimizer } from '@electron-toolkit/utils'
-import { app, BrowserWindow, shell } from 'electron'
+import { app, BrowserWindow, nativeTheme, shell } from 'electron'
import { join } from 'path'
import icon from '../../resources/icon.png?asset'
import { registerIpcHandlers } from './ipc/handlers'
@@ -17,6 +17,9 @@ function createWindow(): void {
show: false,
autoHideMenuBar: true,
title: 'Plexo',
+ // Matches the renderer's dark-mode background so a live window resize
+ // (which briefly exposes the raw window background) doesn't flash white.
+ backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c1e' : '#ffffff',
...(process.platform === 'linux' ? { icon } : {}),
webPreferences: {
preload: join(__dirname, '../preload/index.js'),
@@ -53,6 +56,10 @@ app.whenReady().then(() => {
downloadManager = registerIpcHandlers(() => mainWindow)
+ nativeTheme.on('updated', () => {
+ mainWindow?.setBackgroundColor(nativeTheme.shouldUseDarkColors ? '#1c1c1e' : '#ffffff')
+ })
+
createWindow()
app.on('activate', function () {
diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css
index 827514c..babee3f 100644
--- a/src/renderer/src/assets/main.css
+++ b/src/renderer/src/assets/main.css
@@ -1,5 +1,85 @@
:root {
- color-scheme: light;
+ color-scheme: light dark;
+
+ --bg: #ffffff;
+ --bg-secondary: #fafafa;
+ --bg-tertiary: #f0f0f0;
+ --input-bg: #ffffff;
+ --track-bg: #e4e4e6;
+
+ --text: #1d1d1f;
+ --text-secondary: #6e6e73;
+ --text-tertiary: #8a8a8e;
+
+ --border: #e0e0e2;
+ --border-subtle: #ececee;
+ --border-strong: #b9b9bb;
+ --footer-border: #d8d8da;
+
+ --button-secondary-from: #fefefe;
+ --button-secondary-to: #f3f3f3;
+ --button-shadow: rgba(0, 0, 0, 0.05);
+ --button-disabled-bg: #f4f4f5;
+ --button-disabled-border: #d2d2d4;
+ --button-disabled-text: #a8a8ac;
+
+ --icon-muted: #c2c2c6;
+ --icon-muted-strong: #b0b0b2;
+ --scrollbar-thumb: #d0d0d2;
+
+ --checkbox-shadow: rgba(0, 0, 0, 0.15);
+ --checkbox-inset-shadow: rgba(0, 0, 0, 0.04);
+
+ --kind-wifi-bg: oklch(0.6 0.16 250 / 0.13);
+ --kind-wifi-text: oklch(0.46 0.14 250);
+ --kind-usb-bg: oklch(0.65 0.14 195 / 0.15);
+ --kind-usb-text: oklch(0.44 0.11 195);
+ --kind-ethernet-bg: oklch(0.58 0.17 300 / 0.13);
+ --kind-ethernet-text: oklch(0.44 0.14 300);
+ --kind-neutral-bg: oklch(0.55 0.02 260 / 0.13);
+ --kind-neutral-text: oklch(0.4 0.02 260);
+}
+
+@media (prefers-color-scheme: dark) {
+ :root {
+ --bg: #1c1c1e;
+ --bg-secondary: #202023;
+ --bg-tertiary: #232326;
+ --input-bg: #2c2c2e;
+ --track-bg: #3a3a3c;
+
+ --text: #f2f2f3;
+ --text-secondary: #a1a1a6;
+ --text-tertiary: #8e8e93;
+
+ --border: rgba(255, 255, 255, 0.1);
+ --border-subtle: rgba(255, 255, 255, 0.08);
+ --border-strong: rgba(255, 255, 255, 0.18);
+ --footer-border: rgba(255, 255, 255, 0.12);
+
+ --button-secondary-from: #3a3a3d;
+ --button-secondary-to: #313134;
+ --button-shadow: rgba(0, 0, 0, 0.3);
+ --button-disabled-bg: #2c2c2e;
+ --button-disabled-border: rgba(255, 255, 255, 0.12);
+ --button-disabled-text: #6e6e73;
+
+ --icon-muted: #55555a;
+ --icon-muted-strong: #636368;
+ --scrollbar-thumb: #48484a;
+
+ --checkbox-shadow: rgba(0, 0, 0, 0.4);
+ --checkbox-inset-shadow: rgba(0, 0, 0, 0.3);
+
+ --kind-wifi-bg: oklch(0.6 0.16 250 / 0.22);
+ --kind-wifi-text: oklch(0.78 0.1 250);
+ --kind-usb-bg: oklch(0.65 0.14 195 / 0.22);
+ --kind-usb-text: oklch(0.78 0.09 195);
+ --kind-ethernet-bg: oklch(0.58 0.17 300 / 0.22);
+ --kind-ethernet-text: oklch(0.78 0.1 300);
+ --kind-neutral-bg: oklch(0.55 0.02 260 / 0.25);
+ --kind-neutral-text: oklch(0.75 0.02 260);
+ }
}
* {
@@ -17,7 +97,8 @@ body {
overflow: hidden;
font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', Helvetica, sans-serif;
-webkit-font-smoothing: antialiased;
- color: #1d1d1f;
+ background: var(--bg);
+ color: var(--text);
user-select: none;
}
@@ -39,6 +120,6 @@ button {
}
::-webkit-scrollbar-thumb {
- background-color: #d0d0d2;
+ background-color: var(--scrollbar-thumb);
border-radius: 9999px;
}
diff --git a/src/renderer/src/components/ConnectionRow.tsx b/src/renderer/src/components/ConnectionRow.tsx
index bfee701..1c45c7f 100644
--- a/src/renderer/src/components/ConnectionRow.tsx
+++ b/src/renderer/src/components/ConnectionRow.tsx
@@ -23,7 +23,7 @@ function Checkbox({ checked }: { checked: boolean }): React.JSX.Element {
justifyContent: 'center',
color: '#fff',
font: `700 9px/1 ${FONT_UI}`,
- boxShadow: 'inset 0 0 0 0.5px rgba(0,0,0,0.15)',
+ boxShadow: 'inset 0 0 0 0.5px var(--checkbox-shadow)',
flexShrink: 0
}}
>
@@ -37,9 +37,9 @@ function Checkbox({ checked }: { checked: boolean }): React.JSX.Element {
width: 14,
height: 14,
borderRadius: 4,
- background: '#fff',
- border: '0.5px solid #b0b0b2',
- boxShadow: 'inset 0 1px 1px rgba(0,0,0,0.04)',
+ background: 'var(--input-bg)',
+ border: '0.5px solid var(--icon-muted-strong)',
+ boxShadow: 'inset 0 1px 1px var(--checkbox-inset-shadow)',
flexShrink: 0
}}
/>
@@ -65,20 +65,25 @@ export function ConnectionRow({
padding: '9px 20px',
borderWidth: '0.5px 0 0 0',
borderStyle: 'solid',
- borderColor: '#ececee',
+ borderColor: 'var(--border-subtle)',
background: 'transparent',
width: '100%',
textAlign: 'left',
cursor: 'pointer',
- font: 'inherit'
+ font: 'inherit',
+ color: 'inherit'
}}
>
<Checkbox checked={selected} />
<KindBadge kind={iface.kind} />
- <div style={{ font: `13px/1 ${FONT_UI}`, color: '#1d1d1f' }}>{iface.displayName}</div>
- <div style={{ font: `11.5px/1 ${FONT_MONO}`, color: '#8a8a8e' }}>{iface.device}</div>
+ <div style={{ font: `13px/1 ${FONT_UI}`, color: 'var(--text)' }}>{iface.displayName}</div>
+ <div style={{ font: `11.5px/1 ${FONT_MONO}`, color: 'var(--text-tertiary)' }}>
+ {iface.device}
+ </div>
<div style={{ flex: 1 }} />
- <div style={{ font: `11.5px/1 ${FONT_MONO}`, color: '#6e6e73' }}>{iface.address}</div>
+ <div style={{ font: `11.5px/1 ${FONT_MONO}`, color: 'var(--text-secondary)' }}>
+ {iface.address}
+ </div>
<div
style={{
display: 'flex',
@@ -93,11 +98,11 @@ export function ConnectionRow({
width: 7,
height: 7,
borderRadius: '50%',
- background: online ? SUCCESS : '#c2c2c6',
+ background: online ? SUCCESS : 'var(--icon-muted)',
flexShrink: 0
}}
/>
- <div style={{ font: `11.5px/1 ${FONT_MONO}`, color: '#6e6e73' }}>
+ <div style={{ font: `11.5px/1 ${FONT_MONO}`, color: 'var(--text-secondary)' }}>
{online ? `${latencyMs} ms` : '—'}
</div>
</div>
diff --git a/src/renderer/src/components/FieldsSection.tsx b/src/renderer/src/components/FieldsSection.tsx
index f87920e..eec7c1e 100644
--- a/src/renderer/src/components/FieldsSection.tsx
+++ b/src/renderer/src/components/FieldsSection.tsx
@@ -4,20 +4,20 @@ const labelStyle: React.CSSProperties = {
width: 60,
textAlign: 'right',
font: `13px/1 ${FONT_UI}`,
- color: '#3c3c3e',
+ color: 'var(--text-secondary)',
flexShrink: 0
}
const fieldBoxStyle: React.CSSProperties = {
flex: 1,
minWidth: 0,
- border: '0.5px solid #b9b9bb',
+ border: '0.5px solid var(--border-strong)',
borderRadius: 6,
- background: '#fff',
- boxShadow: 'inset 0 1px 1px rgba(0,0,0,0.05)',
+ background: 'var(--input-bg)',
+ boxShadow: 'inset 0 1px 1px var(--button-shadow)',
padding: '6px 9px',
font: `13px/1.3 ${FONT_MONO}`,
- color: '#1d1d1f',
+ color: 'var(--text)',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis'
@@ -57,7 +57,7 @@ export function FieldsSection({
onChange={(event) => onUrlChange(event.target.value)}
placeholder="https://"
disabled={disabled}
- style={{ ...fieldBoxStyle, border: '0.5px solid #b9b9bb', outline: 'none' }}
+ style={{ ...fieldBoxStyle, outline: 'none' }}
/>
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
diff --git a/src/renderer/src/components/StreamRow.tsx b/src/renderer/src/components/StreamRow.tsx
index eb7f09e..276fde1 100644
--- a/src/renderer/src/components/StreamRow.tsx
+++ b/src/renderer/src/components/StreamRow.tsx
@@ -5,10 +5,12 @@ import { KindBadge } from './KindBadge'
export function StreamRow({
chunk,
- totalBytes
+ totalBytes,
+ connectionSuffix
}: {
chunk: ChunkState
totalBytes: number
+ connectionSuffix?: string
}): React.JSX.Element {
const chunkSize =
chunk.rangeEnd !== null ? chunk.rangeEnd - chunk.rangeStart + 1 : totalBytes - chunk.rangeStart
@@ -23,7 +25,7 @@ export function StreamRow({
alignItems: 'center',
gap: 12,
padding: '10px 20px',
- borderTop: '0.5px solid #ececee'
+ borderTop: '0.5px solid var(--border-subtle)'
}}
>
<KindBadge kind={chunk.interfaceKind} />
@@ -37,6 +39,7 @@ export function StreamRow({
}}
>
{chunk.interfaceLabel}
+ {connectionSuffix}
</div>
<div
style={{
@@ -44,7 +47,7 @@ export function StreamRow({
minWidth: 0,
height: 5,
borderRadius: 3,
- background: '#e4e4e6',
+ background: 'var(--track-bg)',
overflow: 'hidden'
}}
>
@@ -67,7 +70,7 @@ export function StreamRow({
width: 92,
textAlign: 'right',
font: `11.5px/1 ${FONT_MONO}`,
- color: '#1d1d1f',
+ color: 'var(--text)',
fontVariantNumeric: 'tabular-nums'
}}
>
@@ -78,7 +81,7 @@ export function StreamRow({
width: 74,
textAlign: 'right',
font: `11.5px/1 ${FONT_MONO}`,
- color: '#8a8a8e',
+ color: 'var(--text-tertiary)',
fontVariantNumeric: 'tabular-nums'
}}
>
diff --git a/src/renderer/src/screens/CompleteScreen.tsx b/src/renderer/src/screens/CompleteScreen.tsx
index 33ee490..957b12f 100644
--- a/src/renderer/src/screens/CompleteScreen.tsx
+++ b/src/renderer/src/screens/CompleteScreen.tsx
@@ -11,13 +11,20 @@ import {
secondaryButtonStyle,
sectionHeaderLabelStyle
} from '../theme'
-import { dirnameOf, formatBytes, formatDuration, formatSpeed, toDisplayPath } from '../utils/format'
+import {
+ connectionSuffixes,
+ dirnameOf,
+ formatBytes,
+ formatDuration,
+ formatSpeed,
+ toDisplayPath
+} from '../utils/format'
const statLabelStyle: React.CSSProperties = {
font: `600 9.5px/1 ${FONT_UI}`,
letterSpacing: '0.08em',
textTransform: 'uppercase',
- color: '#8a8a8e'
+ color: 'var(--text-tertiary)'
}
const statValueStyle: React.CSSProperties = {
@@ -41,11 +48,14 @@ export function CompleteScreen({
const avgSpeed = elapsedSeconds > 0 ? finalSize / elapsedSeconds : 0
const totalWeight = download.chunks.reduce((sum, chunk) => sum + chunk.bytesDownloaded, 0) || 1
+ const suffixes = connectionSuffixes(download.chunks)
const handleReveal = (): void => void window.plexo.revealInFolder(download.destinationPath)
return (
- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: '#fff' }}>
+ <div
+ style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--bg)' }}
+ >
<div style={{ padding: '22px 20px 18px', display: 'flex', alignItems: 'center', gap: 14 }}>
<div
style={{
@@ -68,7 +78,7 @@ export function CompleteScreen({
<div
style={{
font: `12px/1.3 ${FONT_MONO}`,
- color: '#6e6e73',
+ color: 'var(--text-secondary)',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis'
@@ -84,10 +94,10 @@ export function CompleteScreen({
margin: '0 20px 18px',
display: 'grid',
gridTemplateColumns: 'repeat(4, minmax(0, 1fr))',
- border: '0.5px solid #e0e0e2',
+ border: '0.5px solid var(--border)',
borderRadius: 8,
overflow: 'hidden',
- background: '#fafafa'
+ background: 'var(--bg-secondary)'
}}
>
{[
@@ -103,7 +113,7 @@ export function CompleteScreen({
display: 'flex',
flexDirection: 'column',
gap: 5,
- borderLeft: index > 0 ? '0.5px solid #e0e0e2' : undefined
+ borderLeft: index > 0 ? '0.5px solid var(--border)' : undefined
}}
>
<div style={statLabelStyle}>{stat.label}</div>
@@ -122,7 +132,7 @@ export function CompleteScreen({
height: 8,
borderRadius: 4,
overflow: 'hidden',
- background: '#e4e4e6'
+ background: 'var(--track-bg)'
}}
>
{download.chunks.map((chunk) => (
@@ -140,7 +150,7 @@ export function CompleteScreen({
display: 'flex',
gap: 18,
font: `11px/1 ${FONT_MONO}`,
- color: '#6e6e73',
+ color: 'var(--text-secondary)',
flexWrap: 'wrap'
}}
>
@@ -154,7 +164,8 @@ export function CompleteScreen({
background: KIND_PALETTE[chunk.interfaceKind].solid
}}
/>
- {KIND_PALETTE[chunk.interfaceKind].label} {formatBytes(chunk.bytesDownloaded)} ·{' '}
+ {KIND_PALETTE[chunk.interfaceKind].label}
+ {suffixes.get(chunk.id)} {formatBytes(chunk.bytesDownloaded)} ·{' '}
{Math.round((chunk.bytesDownloaded / totalWeight) * 100)}%
</div>
))}
diff --git a/src/renderer/src/screens/DownloadingScreen.tsx b/src/renderer/src/screens/DownloadingScreen.tsx
index 64bc900..845993e 100644
--- a/src/renderer/src/screens/DownloadingScreen.tsx
+++ b/src/renderer/src/screens/DownloadingScreen.tsx
@@ -14,6 +14,7 @@ import {
sectionHeaderMetaStyle
} from '../theme'
import {
+ connectionSuffixes,
dirnameOf,
formatBytes,
formatDuration,
@@ -60,9 +61,12 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
)
const totalWeight = weights.reduce((sum, weight) => sum + weight, 0) || 1
const maxSpeedSample = Math.max(1, ...speedHistory)
+ const suffixes = connectionSuffixes(download.chunks)
return (
- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: '#fff' }}>
+ <div
+ style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--bg)' }}
+ >
<div
style={{
padding: '18px 20px 16px',
@@ -137,8 +141,8 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
background: KIND_PALETTE[chunk.interfaceKind].solid
}}
/>
- {KIND_PALETTE[chunk.interfaceKind].label}{' '}
- {Math.round((weights[index] / totalWeight) * 100)}%
+ {KIND_PALETTE[chunk.interfaceKind].label}
+ {suffixes.get(chunk.id)} {Math.round((weights[index] / totalWeight) * 100)}%
</div>
))}
</div>
@@ -167,7 +171,7 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
<div
style={{
font: `11.5px/1 ${FONT_MONO}`,
- color: '#6e6e73',
+ color: 'var(--text-secondary)',
fontVariantNumeric: 'tabular-nums'
}}
>
@@ -179,7 +183,9 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
{isPaused ? ' · paused' : ''}
</div>
</div>
- <div style={{ height: 6, borderRadius: 3, background: '#e4e4e6', overflow: 'hidden' }}>
+ <div
+ style={{ height: 6, borderRadius: 3, background: 'var(--track-bg)', overflow: 'hidden' }}
+ >
<div
style={{
width: knownSize ? `${percent}%` : '100%',
@@ -193,8 +199,8 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
<div
style={{
- borderTop: '0.5px solid #e0e0e2',
- background: '#fafafa',
+ borderTop: '0.5px solid var(--border)',
+ background: 'var(--bg-secondary)',
flex: 1,
overflowY: 'auto'
}}
@@ -213,7 +219,12 @@ export function DownloadingScreen({ download }: { download: DownloadState }): Re
</div>
</div>
{download.chunks.map((chunk) => (
- <StreamRow key={chunk.id} chunk={chunk} totalBytes={download.totalBytes} />
+ <StreamRow
+ key={chunk.id}
+ chunk={chunk}
+ totalBytes={download.totalBytes}
+ connectionSuffix={suffixes.get(chunk.id)}
+ />
))}
</div>
diff --git a/src/renderer/src/screens/ErrorScreen.tsx b/src/renderer/src/screens/ErrorScreen.tsx
index a3d0804..3f8f3dc 100644
--- a/src/renderer/src/screens/ErrorScreen.tsx
+++ b/src/renderer/src/screens/ErrorScreen.tsx
@@ -18,7 +18,9 @@ export function ErrorScreen({
const cancelled = download.status === 'cancelled'
return (
- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: '#fff' }}>
+ <div
+ style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--bg)' }}
+ >
<div
style={{
flex: 1,
@@ -35,7 +37,7 @@ export function ErrorScreen({
width: 30,
height: 30,
borderRadius: '50%',
- background: cancelled ? '#c2c2c6' : DANGER,
+ background: cancelled ? 'var(--icon-muted)' : DANGER,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -53,7 +55,7 @@ export function ErrorScreen({
maxWidth: 420,
textAlign: 'center',
font: `12px/1.5 ${FONT_MONO}`,
- color: '#6e6e73'
+ color: 'var(--text-secondary)'
}}
>
{download.fileName}
diff --git a/src/renderer/src/screens/IdleScreen.tsx b/src/renderer/src/screens/IdleScreen.tsx
index 1f0d015..e394eb6 100644
--- a/src/renderer/src/screens/IdleScreen.tsx
+++ b/src/renderer/src/screens/IdleScreen.tsx
@@ -5,6 +5,7 @@ import { FieldsSection } from '../components/FieldsSection'
import { useNetworkPolling } from '../hooks/useNetworkPolling'
import { useAppStore } from '../store/useAppStore'
import {
+ DANGER,
disabledPrimaryButtonStyle,
footerStyle,
footerTextStyle,
@@ -13,7 +14,7 @@ import {
sectionHeaderLabelStyle,
sectionHeaderMetaStyle
} from '../theme'
-import { formatBytes, toDisplayPath } from '../utils/format'
+import { describeError, formatBytes, toDisplayPath } from '../utils/format'
type ProbeState =
| { status: 'idle' }
@@ -29,9 +30,9 @@ const stepperButtonStyle: React.CSSProperties = {
width: 20,
height: 20,
borderRadius: 5,
- border: '0.5px solid #b9b9bb',
- background: 'linear-gradient(#fefefe, #f3f3f3)',
- color: '#1d1d1f',
+ border: '0.5px solid var(--border-strong)',
+ background: 'linear-gradient(var(--button-secondary-from), var(--button-secondary-to))',
+ color: 'var(--text)',
font: '13px/1 -apple-system, sans-serif',
cursor: 'pointer'
}
@@ -88,10 +89,7 @@ export function IdleScreen(): React.JSX.Element {
setConnectionsPerInterface(1)
} catch (error) {
if (probeRequestId.current !== requestId) return
- setProbe({
- status: 'error',
- message: error instanceof Error ? error.message : String(error)
- })
+ setProbe({ status: 'error', message: describeError(error) })
}
}, PROBE_DEBOUNCE_MS)
@@ -138,7 +136,7 @@ export function IdleScreen(): React.JSX.Element {
lastModified: probe.result.lastModified
})
} catch (error) {
- setStartError(error instanceof Error ? error.message : String(error))
+ setStartError(describeError(error))
} finally {
setStarting(false)
}
@@ -151,7 +149,9 @@ export function IdleScreen(): React.JSX.Element {
!starting
return (
- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: '#fff' }}>
+ <div
+ style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--bg)' }}
+ >
<FieldsSection
url={url}
onUrlChange={setUrl}
@@ -164,7 +164,7 @@ export function IdleScreen(): React.JSX.Element {
style={{
margin: '0 20px 10px',
font: '12px/1.4 -apple-system, sans-serif',
- color: 'oklch(0.55 0.2 25)'
+ color: DANGER
}}
>
{probe.message}
@@ -173,8 +173,8 @@ export function IdleScreen(): React.JSX.Element {
<div
style={{
- borderTop: '0.5px solid #e0e0e2',
- background: '#fafafa',
+ borderTop: '0.5px solid var(--border)',
+ background: 'var(--bg-secondary)',
flex: 1,
overflowY: 'auto'
}}
@@ -212,10 +212,10 @@ export function IdleScreen(): React.JSX.Element {
alignItems: 'center',
gap: 10,
padding: '10px 20px',
- borderTop: '0.5px solid #ececee'
+ borderTop: '0.5px solid var(--border-subtle)'
}}
>
- <div style={{ font: '12.5px/1 -apple-system, sans-serif', color: '#1d1d1f' }}>
+ <div style={{ font: '12.5px/1 -apple-system, sans-serif', color: 'var(--text)' }}>
Connections per link
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
@@ -234,7 +234,7 @@ export function IdleScreen(): React.JSX.Element {
<div
style={{
font: `12.5px/1 ${'"SF Mono", ui-monospace, Menlo, monospace'}`,
- color: '#1d1d1f',
+ color: 'var(--text)',
width: 14,
textAlign: 'center'
}}
@@ -255,7 +255,12 @@ export function IdleScreen(): React.JSX.Element {
</button>
</div>
<div style={{ flex: 1 }} />
- <div style={{ font: '11.5px/1.4 -apple-system, sans-serif', color: '#8a8a8e' }}>
+ <div
+ style={{
+ font: '11.5px/1.4 -apple-system, sans-serif',
+ color: 'var(--text-tertiary)'
+ }}
+ >
{selectedInterfaceIds.length * connectionsPerInterface} connections total
</div>
</div>
@@ -266,7 +271,7 @@ export function IdleScreen(): React.JSX.Element {
style={{
margin: '0 20px 10px',
font: '11.5px/1.4 -apple-system, sans-serif',
- color: '#8a8a8e'
+ color: 'var(--text-tertiary)'
}}
>
This server doesn&apos;t support multi-connection downloads for this file — pick a
@@ -283,9 +288,7 @@ export function IdleScreen(): React.JSX.Element {
: ''}
</div>
{startError && (
- <div
- style={{ font: '11.5px/1.4 -apple-system, sans-serif', color: 'oklch(0.55 0.2 25)' }}
- >
+ <div style={{ font: '11.5px/1.4 -apple-system, sans-serif', color: DANGER }}>
{startError}
</div>
)}
diff --git a/src/renderer/src/screens/NoConnectionsScreen.tsx b/src/renderer/src/screens/NoConnectionsScreen.tsx
index 9c608ac..2f6ae46 100644
--- a/src/renderer/src/screens/NoConnectionsScreen.tsx
+++ b/src/renderer/src/screens/NoConnectionsScreen.tsx
@@ -20,7 +20,9 @@ export function NoConnectionsScreen(): React.JSX.Element {
const loadInterfaces = useAppStore((store) => store.loadInterfaces)
return (
- <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: '#fff' }}>
+ <div
+ style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--bg)' }}
+ >
<FieldsSection
url={url}
onUrlChange={setUrl}
@@ -31,8 +33,8 @@ export function NoConnectionsScreen(): React.JSX.Element {
<div
style={{
- borderTop: '0.5px solid #e0e0e2',
- background: '#fafafa',
+ borderTop: '0.5px solid var(--border)',
+ background: 'var(--bg-secondary)',
flex: 1,
padding: '40px 20px 44px',
display: 'flex',
@@ -46,15 +48,17 @@ export function NoConnectionsScreen(): React.JSX.Element {
width: 40,
height: 40,
borderRadius: '50%',
- border: '1.5px dashed #c2c2c6',
+ border: '1.5px dashed var(--icon-muted)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
>
- <div style={{ width: 8, height: 8, borderRadius: '50%', background: '#c2c2c6' }} />
+ <div
+ style={{ width: 8, height: 8, borderRadius: '50%', background: 'var(--icon-muted)' }}
+ />
</div>
- <div style={{ font: '600 14px/1.2 -apple-system, sans-serif', color: '#3c3c3e' }}>
+ <div style={{ font: '600 14px/1.2 -apple-system, sans-serif', color: 'var(--text)' }}>
No active network interfaces
</div>
<div
@@ -62,7 +66,7 @@ export function NoConnectionsScreen(): React.JSX.Element {
maxWidth: 400,
textAlign: 'center',
font: '12.5px/1.5 -apple-system, sans-serif',
- color: '#6e6e73'
+ color: 'var(--text-secondary)'
}}
>
Plexo needs at least one connection. Join a Wi-Fi network, plug in Ethernet, or connect an
@@ -96,8 +100,12 @@ export function NoConnectionsScreen(): React.JSX.Element {
<div style={footerStyle}>
<div style={{ display: 'flex', alignItems: 'center', gap: 7 }}>
- <div style={{ width: 7, height: 7, borderRadius: '50%', background: '#c2c2c6' }} />
- <div style={{ ...footerTextStyle, color: '#8a8a8e' }}>0 interfaces · monitoring</div>
+ <div
+ style={{ width: 7, height: 7, borderRadius: '50%', background: 'var(--icon-muted)' }}
+ />
+ <div style={{ ...footerTextStyle, color: 'var(--text-tertiary)' }}>
+ 0 interfaces · monitoring
+ </div>
</div>
<div style={{ flex: 1 }} />
<button type="button" disabled style={disabledPrimaryButtonStyle}>
diff --git a/src/renderer/src/theme.ts b/src/renderer/src/theme.ts
index a513e97..547356e 100644
--- a/src/renderer/src/theme.ts
+++ b/src/renderer/src/theme.ts
@@ -13,32 +13,32 @@ interface KindPalette {
export const KIND_PALETTE: Record<NetworkInterfaceKind, KindPalette> = {
wifi: {
solid: 'oklch(0.6 0.16 250)',
- bg: 'oklch(0.6 0.16 250 / 0.13)',
- text: 'oklch(0.46 0.14 250)',
+ bg: 'var(--kind-wifi-bg)',
+ text: 'var(--kind-wifi-text)',
label: 'WIFI'
},
usb: {
solid: 'oklch(0.65 0.14 195)',
- bg: 'oklch(0.65 0.14 195 / 0.15)',
- text: 'oklch(0.44 0.11 195)',
+ bg: 'var(--kind-usb-bg)',
+ text: 'var(--kind-usb-text)',
label: 'USB'
},
ethernet: {
solid: 'oklch(0.58 0.17 300)',
- bg: 'oklch(0.58 0.17 300 / 0.13)',
- text: 'oklch(0.44 0.14 300)',
+ bg: 'var(--kind-ethernet-bg)',
+ text: 'var(--kind-ethernet-text)',
label: 'ETH'
},
bridge: {
solid: 'oklch(0.55 0.02 260)',
- bg: 'oklch(0.55 0.02 260 / 0.13)',
- text: 'oklch(0.4 0.02 260)',
+ bg: 'var(--kind-neutral-bg)',
+ text: 'var(--kind-neutral-text)',
label: 'NET'
},
other: {
solid: 'oklch(0.55 0.02 260)',
- bg: 'oklch(0.55 0.02 260 / 0.13)',
- text: 'oklch(0.4 0.02 260)',
+ bg: 'var(--kind-neutral-bg)',
+ text: 'var(--kind-neutral-text)',
label: 'NET'
}
}
@@ -49,15 +49,15 @@ export const SUCCESS = 'oklch(0.62 0.15 150)'
export const DANGER = 'oklch(0.55 0.2 25)'
export const secondaryButtonStyle: React.CSSProperties = {
- border: '0.5px solid #b9b9bb',
+ border: '0.5px solid var(--border-strong)',
borderRadius: 6,
- background: 'linear-gradient(#fefefe, #f3f3f3)',
+ background: 'linear-gradient(var(--button-secondary-from), var(--button-secondary-to))',
whiteSpace: 'nowrap',
flexShrink: 0,
- boxShadow: '0 1px 1px rgba(0,0,0,0.05)',
+ boxShadow: '0 1px 1px var(--button-shadow)',
padding: '6px 14px',
font: `13px/1.3 ${FONT_UI}`,
- color: '#1d1d1f',
+ color: 'var(--text)',
cursor: 'pointer'
}
@@ -75,14 +75,14 @@ export const primaryButtonStyle: React.CSSProperties = {
}
export const disabledPrimaryButtonStyle: React.CSSProperties = {
- border: '0.5px solid #d2d2d4',
+ border: '0.5px solid var(--button-disabled-border)',
borderRadius: 6,
whiteSpace: 'nowrap',
flexShrink: 0,
- background: '#f4f4f5',
+ background: 'var(--button-disabled-bg)',
padding: '6px 20px',
font: `500 13px/1.3 ${FONT_UI}`,
- color: '#a8a8ac',
+ color: 'var(--button-disabled-text)',
cursor: 'not-allowed'
}
@@ -91,27 +91,27 @@ export const footerStyle: React.CSSProperties = {
alignItems: 'center',
gap: 12,
padding: '12px 20px',
- borderTop: '0.5px solid #d8d8da',
- background: '#f0f0f0'
+ borderTop: '0.5px solid var(--footer-border)',
+ background: 'var(--bg-tertiary)'
}
export const footerTextStyle: React.CSSProperties = {
whiteSpace: 'nowrap',
flexShrink: 0,
font: `11.5px/1.4 ${FONT_MONO}`,
- color: '#6e6e73'
+ color: 'var(--text-secondary)'
}
export const sectionHeaderLabelStyle: React.CSSProperties = {
font: `600 11px/1 ${FONT_UI}`,
letterSpacing: '0.06em',
textTransform: 'uppercase',
- color: '#8a8a8e'
+ color: 'var(--text-tertiary)'
}
export const sectionHeaderMetaStyle: React.CSSProperties = {
whiteSpace: 'nowrap',
flexShrink: 0,
font: `11px/1 ${FONT_MONO}`,
- color: '#8a8a8e'
+ color: 'var(--text-tertiary)'
}
diff --git a/src/renderer/src/utils/format.ts b/src/renderer/src/utils/format.ts
index c8791e6..3b5b166 100644
--- a/src/renderer/src/utils/format.ts
+++ b/src/renderer/src/utils/format.ts
@@ -52,6 +52,31 @@ export function dirnameOf(path: string): string {
return index <= 0 ? '/' : path.slice(0, index)
}
+/** For chunks that share the same interface (multiple connections per link, or ones split
+ * off by dynamic rebalancing), returns a per-chunk " #N" suffix so they can be told apart
+ * in the UI — empty string when an interface only has a single chunk. */
+export function connectionSuffixes(
+ chunks: Array<{ id: number; interfaceId: string }>
+): Map<number, string> {
+ const totalByInterface = new Map<string, number>()
+ for (const chunk of chunks) {
+ totalByInterface.set(chunk.interfaceId, (totalByInterface.get(chunk.interfaceId) ?? 0) + 1)
+ }
+
+ const seenByInterface = new Map<string, number>()
+ const suffixes = new Map<number, string>()
+ for (const chunk of chunks) {
+ if ((totalByInterface.get(chunk.interfaceId) ?? 0) <= 1) {
+ suffixes.set(chunk.id, '')
+ continue
+ }
+ const seen = (seenByInterface.get(chunk.interfaceId) ?? 0) + 1
+ seenByInterface.set(chunk.interfaceId, seen)
+ suffixes.set(chunk.id, ` #${seen}`)
+ }
+ return suffixes
+}
+
/** Shortens an absolute path under the user's home directory to a "~/..." form for display. */
export function toDisplayPath(path: string, homeDir: string): string {
if (homeDir && (path === homeDir || path.startsWith(`${homeDir}/`))) {
@@ -59,3 +84,30 @@ export function toDisplayPath(path: string, homeDir: string): string {
}
return path
}
+
+const IPC_INVOKE_PREFIX = /^Error invoking remote method '[^']*':\s*/
+const NESTED_ERROR_PREFIX = /^Error:\s*/
+
+const NETWORK_ERROR_HINTS: Array<{ pattern: RegExp; message: string }> = [
+ {
+ pattern: /ENOTFOUND/,
+ message: 'Could not resolve that host — check the URL and your connection.'
+ },
+ { pattern: /ECONNREFUSED/, message: 'The server refused the connection.' },
+ { pattern: /ECONNRESET/, message: 'The connection was reset by the server.' },
+ { pattern: /ETIMEDOUT/, message: 'The connection timed out.' },
+ { pattern: /CERT|SSL|TLS/i, message: "The server's security certificate could not be verified." }
+]
+
+/** Electron wraps a rejected IPC call as "Error invoking remote method 'x': Error: <message>" —
+ * strip that framework noise and translate common network error codes into plain English. */
+export function describeError(error: unknown): string {
+ const raw = error instanceof Error ? error.message : String(error)
+ const stripped = raw.replace(IPC_INVOKE_PREFIX, '').replace(NESTED_ERROR_PREFIX, '')
+
+ for (const { pattern, message } of NETWORK_ERROR_HINTS) {
+ if (pattern.test(stripped)) return message
+ }
+
+ return stripped
+}