Skip to content

armgit / plexo

Public Imported from GitHub
0

Speed up downloads by combining multiple network connections in parallel

network card and download screen

Anmol Kapila8728a2a8105
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx
index 163f235..981c2e8 100644
--- a/src/renderer/src/App.tsx
+++ b/src/renderer/src/App.tsx
@@ -27,6 +27,15 @@ function App(): React.JSX.Element {
clearCurrentDownload()
}
+ const handleDownloadAgain = (): void => {
+ if (currentDownload) {
+ const url = currentDownload.url
+ void window.plexo.removeDownload(currentDownload.id)
+ clearCurrentDownload()
+ useAppStore.getState().setDraftUrl(url)
+ }
+ }
+
const noConnections = interfacesStatus === 'ready' && interfaces.length === 0
let screen: React.JSX.Element
@@ -42,7 +51,13 @@ function App(): React.JSX.Element {
} else if (currentDownload.status === 'completed') {
screen = <CompleteScreen download={currentDownload} onNewDownload={handleNewDownload} />
} else {
- screen = <ErrorScreen download={currentDownload} onNewDownload={handleNewDownload} />
+ screen = (
+ <ErrorScreen
+ download={currentDownload}
+ onNewDownload={handleNewDownload}
+ onDownloadAgain={handleDownloadAgain}
+ />
+ )
}
} else if (noConnections) {
screen = <NoConnectionsScreen />
diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css
index d47e0c5..862aed9 100644
--- a/src/renderer/src/assets/main.css
+++ b/src/renderer/src/assets/main.css
@@ -211,3 +211,14 @@ button {
opacity: 1;
}
}
+
+@keyframes plexo-popover-in {
+ from {
+ opacity: 0;
+ transform: translateY(-4px) scale(0.97);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0) scale(1);
+ }
+}
diff --git a/src/renderer/src/components/NetworkCard.tsx b/src/renderer/src/components/NetworkCard.tsx
index 037531f..2ae4d46 100644
--- a/src/renderer/src/components/NetworkCard.tsx
+++ b/src/renderer/src/components/NetworkCard.tsx
@@ -1,5 +1,5 @@
import type { NetworkInterfaceInfo } from '@shared/types'
-import { useState } from 'react'
+import { useRef, useState } from 'react'
import { useAppStore } from '../store/useAppStore'
import { FONT_MONO, FONT_UI, resolveNetworkVisual, type NetworkColorId } from '../theme'
import { NetworkEditorFields } from './NetworkEditorFields'
@@ -63,33 +63,12 @@ export function NetworkCard({
onToggle
}: NetworkCardProps): React.JSX.Element {
const [editing, setEditing] = useState(false)
+ const buttonRef = useRef<HTMLButtonElement>(null)
const preference = useAppStore((store) => store.networkPreferences[iface.id])
const setNetworkPreference = useAppStore((store) => store.setNetworkPreference)
const visual = resolveNetworkVisual(iface.kind, iface.displayName, preference)
const online = latencyMs != null
- if (editing) {
- return (
- <div
- style={{
- borderRadius: 11,
- padding: 15,
- background: 'var(--bg-secondary)',
- border: '0.5px solid var(--border)'
- }}
- >
- <NetworkEditorFields
- name={preference?.customName ?? ''}
- onNameChange={(customName) => setNetworkPreference(iface.id, { customName })}
- namePlaceholder={iface.displayName}
- colorId={preference?.colorId as NetworkColorId | undefined}
- onColorSelect={(colorId) => setNetworkPreference(iface.id, { colorId })}
- onDone={() => setEditing(false)}
- />
- </div>
- )
- }
-
return (
<div
style={{
@@ -136,6 +115,7 @@ export function NetworkCard({
</div>
</button>
<button
+ ref={buttonRef}
type="button"
onClick={() => setEditing(true)}
title="Rename or recolor this network"
@@ -151,6 +131,18 @@ export function NetworkCard({
>
⋯
</button>
+ {editing && (
+ <NetworkEditorFields
+ anchorRef={buttonRef}
+ name={preference?.customName ?? ''}
+ onNameChange={(customName) => setNetworkPreference(iface.id, { customName })}
+ namePlaceholder={iface.displayName}
+ colorId={preference?.colorId as NetworkColorId | undefined}
+ onColorSelect={(colorId) => setNetworkPreference(iface.id, { colorId })}
+ interfaceKind={iface.kind}
+ onDone={() => setEditing(false)}
+ />
+ )}
<div
style={{
font: `500 10px/1 ${FONT_MONO}`,
diff --git a/src/renderer/src/components/NetworkEditorFields.tsx b/src/renderer/src/components/NetworkEditorFields.tsx
index a4ea60b..db5f39c 100644
--- a/src/renderer/src/components/NetworkEditorFields.tsx
+++ b/src/renderer/src/components/NetworkEditorFields.tsx
@@ -1,104 +1,295 @@
-import { FONT_MONO, FONT_UI, NETWORK_COLOR_SWATCHES, type NetworkColorId } from '../theme'
+import type { NetworkInterfaceKind } from '@shared/types'
+import { useEffect, useLayoutEffect, useRef, useState } from 'react'
+import { createPortal } from 'react-dom'
+import {
+ FONT_MONO,
+ FONT_UI,
+ NETWORK_COLOR_SWATCHES,
+ resolveNetworkVisual,
+ type NetworkColorId
+} from '../theme'
-interface NetworkEditorFieldsProps {
+export interface NetworkEditorFieldsProps {
+ anchorRef: React.RefObject<HTMLElement | null>
name: string
onNameChange: (name: string) => void
namePlaceholder: string
colorId: NetworkColorId | undefined
onColorSelect: (colorId: NetworkColorId | undefined) => void
+ interfaceKind: NetworkInterfaceKind
onDone: () => void
}
-/** Inline rename + recolor controls for one physical network — shared between the Idle screen's
- * network cards and the live network row on the Downloading screen, so a confusing OS device
- * name (e.g. "feth0") can be fixed from wherever it shows up. */
+/** Floating rename + recolor popover for a physical network — anchored to the `⋯` button
+ * without shifting layout or causing jank, with real-time preview and keyboard support. */
export function NetworkEditorFields({
+ anchorRef,
name,
onNameChange,
namePlaceholder,
colorId,
onColorSelect,
+ interfaceKind,
onDone
-}: NetworkEditorFieldsProps): React.JSX.Element {
- return (
- <div
- style={{
- display: 'flex',
- flexDirection: 'column',
- gap: 9,
- padding: '10px 12px',
- borderRadius: 8,
- background: 'var(--input-bg)',
- border: '0.5px solid var(--border-strong)'
- }}
- >
- <input
- type="text"
- value={name}
- onChange={(event) => onNameChange(event.target.value)}
- placeholder={namePlaceholder}
+}: NetworkEditorFieldsProps): React.JSX.Element | null {
+ const [coords, setCoords] = useState<{ top: number; left: number } | null>(null)
+ const inputRef = useRef<HTMLInputElement>(null)
+
+ useLayoutEffect(() => {
+ if (!anchorRef.current) return
+ const rect = anchorRef.current.getBoundingClientRect()
+ const popoverWidth = 276
+ const popoverHeight = 220
+
+ let left = rect.left - 10
+ if (left + popoverWidth > window.innerWidth - 14) {
+ left = window.innerWidth - popoverWidth - 14
+ }
+ if (left < 14) left = 14
+
+ let top = rect.bottom + 6
+ if (top + popoverHeight > window.innerHeight - 14) {
+ top = Math.max(14, rect.top - popoverHeight - 6)
+ }
+
+ setCoords({ top, left })
+ }, [anchorRef])
+
+ useEffect(() => {
+ const handleKeyDown = (event: KeyboardEvent): void => {
+ if (event.key === 'Escape') {
+ onDone()
+ }
+ }
+ window.addEventListener('keydown', handleKeyDown)
+ return () => window.removeEventListener('keydown', handleKeyDown)
+ }, [onDone])
+
+ if (!coords) return null
+
+ const previewVisual = resolveNetworkVisual(interfaceKind, namePlaceholder, {
+ customName: name,
+ colorId
+ })
+
+ return createPortal(
+ <>
+ <div
+ onClick={onDone}
style={{
- border: '0.5px solid var(--border)',
- borderRadius: 6,
- background: 'var(--bg)',
- outline: 'none',
- padding: '6px 8px',
- font: `12.5px/1.3 ${FONT_UI}`,
- color: 'var(--text)'
+ position: 'fixed',
+ inset: 0,
+ zIndex: 9998,
+ background: 'rgba(0, 0, 0, 0.25)',
+ backdropFilter: 'blur(1.5px)'
}}
/>
- <div style={{ display: 'flex', alignItems: 'center', gap: 7, flexWrap: 'wrap' }}>
- <button
- type="button"
- onClick={() => onColorSelect(undefined)}
- title="Use the default color for this network kind"
- style={{
- width: 18,
- height: 18,
- borderRadius: '50%',
- border: `1.5px solid ${!colorId ? 'var(--text)' : 'var(--border-strong)'}`,
- background: 'var(--bg)',
- color: 'var(--text-tertiary)',
- font: `600 10px/1 ${FONT_UI}`,
- cursor: 'pointer',
- flexShrink: 0
- }}
- >
- ×
- </button>
- {NETWORK_COLOR_SWATCHES.map((swatch) => (
+ <div
+ style={{
+ position: 'fixed',
+ top: coords.top,
+ left: coords.left,
+ zIndex: 9999,
+ width: 276,
+ background: 'var(--bg-secondary)',
+ border: '0.5px solid var(--border-strong)',
+ borderRadius: 10,
+ boxShadow: '0 16px 36px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.25)',
+ animation: 'plexo-popover-in 0.15s cubic-bezier(0.16, 1, 0.3, 1)',
+ padding: '13px 15px',
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 11
+ }}
+ >
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
+ <div
+ style={{
+ font: `600 9.5px/1 ${FONT_MONO}`,
+ letterSpacing: '0.14em',
+ color: 'var(--text-tertiary)',
+ textTransform: 'uppercase'
+ }}
+ >
+ Edit Network
+ </div>
<button
- key={swatch.id}
type="button"
- onClick={() => onColorSelect(swatch.id)}
- title={swatch.label}
+ onClick={onDone}
+ title="Close (Esc)"
style={{
- width: 18,
- height: 18,
- borderRadius: '50%',
- border: colorId === swatch.id ? '1.5px solid var(--text)' : '1.5px solid transparent',
- background: swatch.solid,
+ border: 'none',
+ background: 'none',
+ color: 'var(--text-tertiary)',
+ font: `600 12px/1 ${FONT_UI}`,
cursor: 'pointer',
- flexShrink: 0
+ padding: '2px 4px',
+ borderRadius: 4
+ }}
+ >
+ ✕
+ </button>
+ </div>
+
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 5 }}>
+ <label
+ style={{
+ font: `500 9px/1 ${FONT_MONO}`,
+ letterSpacing: '0.12em',
+ color: 'var(--text-tertiary)',
+ textTransform: 'uppercase'
+ }}
+ >
+ Display Name
+ </label>
+ <input
+ ref={inputRef}
+ type="text"
+ value={name}
+ onChange={(event) => onNameChange(event.target.value)}
+ onKeyDown={(event) => {
+ if (event.key === 'Enter') onDone()
+ }}
+ placeholder={namePlaceholder}
+ autoFocus
+ style={{
+ border: '0.5px solid var(--border-strong)',
+ borderRadius: 6,
+ background: 'var(--bg)',
+ outline: 'none',
+ padding: '6px 9px',
+ font: `500 12px/1.3 ${FONT_UI}`,
+ color: 'var(--text)'
}}
/>
- ))}
- <div style={{ flex: 1 }} />
- <button
- type="button"
- onClick={onDone}
+ </div>
+
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
+ <span
+ style={{
+ font: `500 9px/1 ${FONT_MONO}`,
+ letterSpacing: '0.12em',
+ color: 'var(--text-tertiary)',
+ textTransform: 'uppercase'
+ }}
+ >
+ Color
+ </span>
+ {colorId && (
+ <button
+ type="button"
+ onClick={() => onColorSelect(undefined)}
+ style={{
+ border: 'none',
+ background: 'none',
+ color: 'var(--color-accent)',
+ font: `500 9.5px/1 ${FONT_MONO}`,
+ cursor: 'pointer',
+ padding: 0
+ }}
+ >
+ Reset to default
+ </button>
+ )}
+ </div>
+ <div style={{ display: 'flex', alignItems: 'center', gap: 7, padding: '2px 0' }}>
+ <button
+ type="button"
+ onClick={() => onColorSelect(undefined)}
+ title="Default color for this network kind"
+ style={{
+ width: 19,
+ height: 19,
+ borderRadius: '50%',
+ border: !colorId ? '2px solid var(--text)' : '1px solid var(--border-strong)',
+ background: 'var(--bg)',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ cursor: 'pointer',
+ padding: 0,
+ flexShrink: 0
+ }}
+ >
+ <span style={{ fontSize: 9, color: 'var(--text-tertiary)', lineHeight: 1 }}>✕</span>
+ </button>
+ {NETWORK_COLOR_SWATCHES.map((swatch) => {
+ const isSelected = colorId === swatch.id
+ return (
+ <button
+ key={swatch.id}
+ type="button"
+ onClick={() => onColorSelect(swatch.id)}
+ title={swatch.label}
+ style={{
+ width: 19,
+ height: 19,
+ borderRadius: '50%',
+ border: isSelected ? '2px solid var(--text)' : '1px solid transparent',
+ background: swatch.solid,
+ cursor: 'pointer',
+ padding: 0,
+ flexShrink: 0,
+ transform: isSelected ? 'scale(1.1)' : 'scale(1)'
+ }}
+ />
+ )
+ })}
+ </div>
+ </div>
+
+ <div
style={{
- border: 'none',
- background: 'none',
- color: 'var(--color-accent)',
- font: `600 11px/1 ${FONT_MONO}`,
- cursor: 'pointer',
- padding: '2px 0'
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'space-between',
+ paddingTop: 8,
+ borderTop: '0.5px solid var(--border)',
+ marginTop: 2
}}
>
- Done
- </button>
+ <div style={{ display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 }}>
+ <div
+ style={{
+ width: 7,
+ height: 7,
+ borderRadius: '50%',
+ background: previewVisual.solid,
+ flexShrink: 0
+ }}
+ />
+ <span
+ style={{
+ font: `600 11px/1 ${FONT_UI}`,
+ color: previewVisual.text,
+ whiteSpace: 'nowrap',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ maxWidth: 155
+ }}
+ >
+ {previewVisual.name}
+ </span>
+ </div>
+ <button
+ type="button"
+ onClick={onDone}
+ style={{
+ border: 'none',
+ borderRadius: 6,
+ background: 'var(--color-accent)',
+ color: 'var(--color-accent-onsolid)',
+ font: `600 11px/1 ${FONT_UI}`,
+ padding: '5px 13px',
+ cursor: 'pointer'
+ }}
+ >
+ Done
+ </button>
+ </div>
</div>
- </div>
+ </>,
+ document.body
)
}
diff --git a/src/renderer/src/components/NetworkRow.tsx b/src/renderer/src/components/NetworkRow.tsx
index d8a332e..d4321e1 100644
--- a/src/renderer/src/components/NetworkRow.tsx
+++ b/src/renderer/src/components/NetworkRow.tsx
@@ -1,4 +1,4 @@
-import { useState } from 'react'
+import { useRef, useState } from 'react'
import { useAppStore } from '../store/useAppStore'
import {
DANGER,
@@ -23,6 +23,7 @@ export function NetworkRow({
}): React.JSX.Element {
const [editing, setEditing] = useState(false)
const [expanded, setExpanded] = useState(false)
+ const buttonRef = useRef<HTMLButtonElement>(null)
const preference = useAppStore((store) => store.networkPreferences[group.interfaceId])
const setNetworkPreference = useAppStore((store) => store.setNetworkPreference)
const visual = resolveNetworkVisual(group.interfaceKind, group.interfaceLabel, preference)
@@ -88,6 +89,7 @@ export function NetworkRow({
<span style={{ fontSize: 7.5, opacity: 0.75 }}>{expanded ? '▲' : '▼'}</span>
</button>
<button
+ ref={buttonRef}
type="button"
onClick={() => setEditing((value) => !value)}
title="Rename or recolor this network"
@@ -310,16 +312,16 @@ export function NetworkRow({
</div>
)}
{editing && (
- <div style={{ padding: '0 20px 11px' }}>
- <NetworkEditorFields
- name={preference?.customName ?? ''}
- onNameChange={(customName) => setNetworkPreference(group.interfaceId, { customName })}
- namePlaceholder={group.interfaceLabel}
- colorId={preference?.colorId as NetworkColorId | undefined}
- onColorSelect={(colorId) => setNetworkPreference(group.interfaceId, { colorId })}
- onDone={() => setEditing(false)}
- />
- </div>
+ <NetworkEditorFields
+ anchorRef={buttonRef}
+ name={preference?.customName ?? ''}
+ onNameChange={(customName) => setNetworkPreference(group.interfaceId, { customName })}
+ namePlaceholder={group.interfaceLabel}
+ colorId={preference?.colorId as NetworkColorId | undefined}
+ onColorSelect={(colorId) => setNetworkPreference(group.interfaceId, { colorId })}
+ interfaceKind={group.interfaceKind}
+ onDone={() => setEditing(false)}
+ />
)}
</div>
)
diff --git a/src/renderer/src/screens/ErrorScreen.tsx b/src/renderer/src/screens/ErrorScreen.tsx
index 3f8f3dc..db737cf 100644
--- a/src/renderer/src/screens/ErrorScreen.tsx
+++ b/src/renderer/src/screens/ErrorScreen.tsx
@@ -1,21 +1,41 @@
import type { DownloadState } from '@shared/types'
+import { useState } from 'react'
import {
DANGER,
FONT_MONO,
FONT_UI,
footerStyle,
footerTextStyle,
- primaryButtonStyle
+ primaryButtonStyle,
+ secondaryButtonStyle
} from '../theme'
+import { fileExtensionBadge, formatBytes } from '../utils/format'
export function ErrorScreen({
download,
- onNewDownload
+ onNewDownload,
+ onDownloadAgain
}: {
download: DownloadState
onNewDownload: () => void
+ onDownloadAgain: () => void
}): React.JSX.Element {
+ const [copied, setCopied] = useState(false)
const cancelled = download.status === 'cancelled'
+ const knownSize = download.totalBytes > 0
+ const percent = knownSize
+ ? Math.min(100, Math.round((download.bytesDownloaded / download.totalBytes) * 100))
+ : 0
+
+ const handleCopyUrl = async (): Promise<void> => {
+ try {
+ await navigator.clipboard.writeText(download.url)
+ setCopied(true)
+ setTimeout(() => setCopied(false), 2000)
+ } catch {
+ // Ignore clipboard write failures
+ }
+ }
return (
<div
@@ -28,46 +48,187 @@ export function ErrorScreen({
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
- gap: 12,
- padding: 24
+ padding: '24px 20px'
}}
>
<div
style={{
- width: 30,
- height: 30,
- borderRadius: '50%',
- background: cancelled ? 'var(--icon-muted)' : DANGER,
+ maxWidth: 440,
+ width: '100%',
+ borderRadius: 14,
+ padding: '28px 24px',
+ background: 'var(--bg-secondary)',
+ border: '0.5px solid var(--border-strong)',
+ boxShadow: '0 16px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2)',
display: 'flex',
+ flexDirection: 'column',
alignItems: 'center',
- justifyContent: 'center',
- color: '#fff',
- font: `700 15px/1 ${FONT_UI}`
+ gap: 18,
+ textAlign: 'center'
}}
>
- {cancelled ? '–' : '!'}
- </div>
- <div style={{ font: `600 15px/1.2 ${FONT_UI}` }}>
- {cancelled ? 'Download cancelled' : 'Download failed'}
+ {/* Status Icon */}
+ <div
+ style={{
+ width: 48,
+ height: 48,
+ borderRadius: '50%',
+ background: cancelled ? 'var(--color-usb-bg)' : 'var(--color-danger-bg)',
+ border: `1px solid ${cancelled ? 'var(--color-usb-border)' : 'var(--color-danger-border)'}`,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ flexShrink: 0
+ }}
+ >
+ {cancelled ? (
+ <svg viewBox="0 0 24 24" style={{ width: 22, height: 22 }}>
+ <circle cx="12" cy="12" r="9" fill="none" stroke="var(--color-usb-text)" strokeWidth="2" />
+ <line x1="8" y1="12" x2="16" y2="12" stroke="var(--color-usb-text)" strokeWidth="2.4" strokeLinecap="round" />
+ </svg>
+ ) : (
+ <svg viewBox="0 0 24 24" style={{ width: 22, height: 22 }}>
+ <circle cx="12" cy="12" r="9" fill="none" stroke={DANGER} strokeWidth="2" />
+ <line x1="12" y1="8" x2="12" y2="12.5" stroke={DANGER} strokeWidth="2.4" strokeLinecap="round" />
+ <circle cx="12" cy="15.5" r="1.2" fill={DANGER} />
+ </svg>
+ )}
+ </div>
+
+ {/* Heading */}
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 5 }}>
+ <div style={{ font: `700 17px/1.2 ${FONT_UI}`, color: 'var(--text)' }}>
+ {cancelled ? 'Download Cancelled' : 'Download Failed'}
+ </div>
+ <div style={{ font: `12px/1.4 ${FONT_UI}`, color: 'var(--text-secondary)' }}>
+ {cancelled
+ ? 'The download was stopped before finishing.'
+ : download.error || 'An error occurred during transfer.'}
+ </div>
+ </div>
+
+ {/* File capsule */}
+ <div
+ style={{
+ width: '100%',
+ borderRadius: 9,
+ padding: '10px 12px',
+ background: 'var(--bg)',
+ border: '0.5px solid var(--border)',
+ display: 'flex',
+ alignItems: 'center',
+ gap: 11,
+ textAlign: 'left'
+ }}
+ >
+ <div
+ style={{
+ width: 34,
+ height: 34,
+ borderRadius: 7,
+ background: 'var(--bg-secondary)',
+ border: '0.5px solid var(--border-strong)',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ font: `600 8.5px/1 ${FONT_MONO}`,
+ color: 'var(--text-secondary)',
+ flexShrink: 0
+ }}
+ >
+ {fileExtensionBadge(download.fileName)}
+ </div>
+ <div style={{ flex: 1, minWidth: 0 }}>
+ <div
+ style={{
+ font: `600 12.5px/1.3 ${FONT_UI}`,
+ color: 'var(--text)',
+ whiteSpace: 'nowrap',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis'
+ }}
+ title={download.fileName}
+ >
+ {download.fileName}
+ </div>
+ <div
+ style={{
+ marginTop: 2,
+ font: `11px/1 ${FONT_MONO}`,
+ color: 'var(--text-tertiary)',
+ fontVariantNumeric: 'tabular-nums'
+ }}
+ >
+ {download.bytesDownloaded > 0 ? (
+ <>
+ {formatBytes(download.bytesDownloaded)}
+ {knownSize ? ` of ${formatBytes(download.totalBytes)} (${percent}%)` : ' transferred'}
+ </>
+ ) : (
+ 'No data transferred'
+ )}
+ </div>
+ </div>
+ </div>
+
+ {/* Action Buttons in Center */}
+ <div style={{ display: 'flex', gap: 10, width: '100%', justifyContent: 'center', marginTop: 4 }}>
+ <button
+ type="button"
+ onClick={onDownloadAgain}
+ style={{
+ ...primaryButtonStyle,
+ padding: '9px 22px',
+ display: 'inline-flex',
+ alignItems: 'center',
+ gap: 6
+ }}
+ >
+ <span>Download Again</span>
+ </button>
+ <button
+ type="button"
+ onClick={onNewDownload}
+ style={{
+ ...secondaryButtonStyle,
+ padding: '9px 18px'
+ }}
+ >
+ New Download
+ </button>
+ </div>
</div>
+ </div>
+
+ {/* Footer with properly constrained, non-overflowing URL */}
+ <div style={{ ...footerStyle, minWidth: 0 }}>
<div
style={{
- maxWidth: 420,
- textAlign: 'center',
- font: `12px/1.5 ${FONT_MONO}`,
- color: 'var(--text-secondary)'
+ ...footerTextStyle,
+ flex: 1,
+ minWidth: 0,
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap'
}}
+ title={download.url}
>
- {download.fileName}
- {download.error ? ` — ${download.error}` : ''}
+ {download.url}
</div>
- </div>
-
- <div style={footerStyle}>
- <div style={footerTextStyle}>{download.url}</div>
- <div style={{ flex: 1 }} />
- <button type="button" onClick={onNewDownload} style={primaryButtonStyle}>
- New Download
+ <button
+ type="button"
+ onClick={handleCopyUrl}
+ style={{
+ border: 'none',
+ background: 'none',
+ font: `500 11px/1 ${FONT_MONO}`,
+ color: copied ? 'var(--color-success)' : 'var(--color-accent)',
+ cursor: 'pointer',
+ padding: '2px 4px',
+ flexShrink: 0
+ }}
+ >
+ {copied ? 'Copied' : 'Copy URL'}
</button>
</div>
</div>