Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

feat(updater): stream live download progress and add interactive floating update badge

Deepender2585f5d2c5fede
diff --git a/electron/main/state.ts b/electron/main/state.ts
index 33704a3..406fd36 100644
--- a/electron/main/state.ts
+++ b/electron/main/state.ts
@@ -167,6 +167,9 @@ export const pushState = {
console.log('[Main] Sending app:update-available event to renderer:', info)
send('app:update-available', info)
},
+ updateProgress(progress: { percent: number; bytesPerSecond?: number; transferred?: number; total?: number }): void {
+ send('app:update-progress', progress)
+ },
updateDownloaded(info: { version: string }): void {
console.log('[Main] Sending app:update-downloaded event to renderer:', info)
send('app:update-downloaded', info)
diff --git a/electron/main/updater.ts b/electron/main/updater.ts
index 22a62fe..3ff619d 100644
--- a/electron/main/updater.ts
+++ b/electron/main/updater.ts
@@ -207,6 +207,17 @@ export function initAutoUpdater(): void {
console.log('[AutoUpdater] App is up to date. Latest release:', info.version, 'Current:', app.getVersion())
})
+ autoUpdater.on('download-progress', (progressObj: { percent: number; bytesPerSecond?: number; transferred?: number; total?: number }) => {
+ const percent = Math.min(100, Math.max(0, Math.round(progressObj.percent || 0)))
+ console.log(`[AutoUpdater] Download progress: ${percent}%`)
+ pushState.updateProgress({
+ percent,
+ bytesPerSecond: progressObj.bytesPerSecond,
+ transferred: progressObj.transferred,
+ total: progressObj.total
+ })
+ })
+
autoUpdater.on('update-downloaded', (info: { version: string }) => {
console.log('[AutoUpdater] Update downloaded and ready to install:', info.version)
pushState.updateDownloaded({ version: info.version })
diff --git a/electron/preload/index.ts b/electron/preload/index.ts
index e3ec660..f5f5eb0 100644
--- a/electron/preload/index.ts
+++ b/electron/preload/index.ts
@@ -232,6 +232,7 @@ const api = {
onCopyFlare: (cb: () => void) => on('ui:copy-flare', cb),
onTutorialStep: (cb: (step: number) => void) => on('tutorial:step', cb),
onUpdateAvailable: (cb: (info: { version: string }) => void) => on('app:update-available', cb),
+ onUpdateProgress: (cb: (progress: { percent: number; bytesPerSecond?: number; transferred?: number; total?: number }) => void) => on('app:update-progress', cb),
onUpdateDownloaded: (cb: (info: { version: string }) => void) => on('app:update-downloaded', cb),
/* Drag helpers */
diff --git a/package.json b/package.json
index 2c2e82a..c199912 100644
--- a/package.json
+++ b/package.json
@@ -140,4 +140,4 @@
"react": "^18.2.0",
"zustand": "^4.5.2"
}
-}
+}
\ No newline at end of file
diff --git a/scripts/generate_translations_ts.cjs b/scripts/generate_translations_ts.cjs
index 299f60d..4aa829f 100644
--- a/scripts/generate_translations_ts.cjs
+++ b/scripts/generate_translations_ts.cjs
@@ -44,9 +44,9 @@ const masterEn = {
updateAvailableDesc: 'A newer version is ready on GitHub. Would you like to download and update now?',
downloadAndUpdate: 'Download & Update',
skip: 'Skip',
- downloadingUpdate: 'Downloading update package in background...',
+ downloadingUpdate: 'Downloading in background...',
updateReadyTitle: 'Update v{version} Ready',
- updateReadyDesc: 'Click to restart Edge-Drop and apply the update.',
+ updateReadyDesc: 'Restart to apply update',
restartToUpdate: 'Restart to Update',
restartToUpdateBelow: 'Restart to update below',
newUpdateAvailableBelow: 'New update available below',
diff --git a/shared/bridge.ts b/shared/bridge.ts
index 3548809..7edb358 100644
--- a/shared/bridge.ts
+++ b/shared/bridge.ts
@@ -72,5 +72,6 @@ export interface EdgeApi {
onCopyFlare: (cb: () => void) => () => void
onTutorialStep: (cb: (step: number) => void) => () => void
onUpdateAvailable: (cb: (info: { version: string }) => void) => () => void
+ onUpdateProgress: (cb: (progress: { percent: number; bytesPerSecond?: number; transferred?: number; total?: number }) => void) => () => void
onUpdateDownloaded: (cb: (info: { version: string }) => void) => () => void
}
diff --git a/shared/ipc.ts b/shared/ipc.ts
index 031addf..bb2f893 100644
--- a/shared/ipc.ts
+++ b/shared/ipc.ts
@@ -136,6 +136,8 @@ export interface EventMap {
'ui:copy-flare': []
/** Fired by electron-updater when a new update is available for GitHub builds. */
'app:update-available': [info: { version: string }]
+ /** Fired by electron-updater with download progress for GitHub builds. */
+ 'app:update-progress': [progress: { percent: number; bytesPerSecond?: number; transferred?: number; total?: number }]
/** Fired by electron-updater when the update has been fully downloaded and is ready to install. */
'app:update-downloaded': [info: { version: string }]
/**
diff --git a/src/App.tsx b/src/App.tsx
index 7556fb5..77cb9bc 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -77,6 +77,9 @@ export default function App() {
const offUpdateAvailable = edge.onUpdateAvailable((info) => {
useStore.getState().setUpdateAvailable(info)
})
+ const offUpdateProgress = edge.onUpdateProgress((progress) => {
+ useStore.getState().setUpdateProgress(progress)
+ })
const offUpdateDownloaded = edge.onUpdateDownloaded((info) => {
useStore.getState().setUpdateDownloaded(info)
})
@@ -92,6 +95,7 @@ export default function App() {
offOpenSettings()
offTutorialStep()
offUpdateAvailable()
+ offUpdateProgress()
offUpdateDownloaded()
offCopyFlare()
}
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx
index 1af5cdd..8e2c182 100644
--- a/src/components/Settings.tsx
+++ b/src/components/Settings.tsx
@@ -85,6 +85,9 @@ export function Settings({ inlineIndicatorStyle }: { inlineIndicatorStyle?: bool
const handleManualCheck = () => useStore.getState().startManualCheck()
const handleStartDownload = () => useStore.getState().startManualDownload()
+ const isDownloading = checkState.status === 'downloading' || (!updateDownloaded && (settings.autoUpdates ?? true) && !!updateInfo?.hasUpdate)
+ const downloadPercent = updateInfo?.downloadProgress?.percent ?? 0
+
// ── Tab state & Independent Scroll Memory per section ──────────────────────
const [activeTab, setActiveTab] = useState<SettingsTab>('behaviour')
const scrollListRef = useRef<HTMLDivElement>(null)
@@ -124,45 +127,75 @@ export function Settings({ inlineIndicatorStyle }: { inlineIndicatorStyle?: bool
}
}, [activeTab])
- // ── Off-screen Update Banner Visibility Tracking ─────────────────────────────
+ // ── Update banner ref & status tracking ────────────────────────────────────
const updateBannerRef = useRef<HTMLDivElement | null>(null)
- const [isUpdateBannerVisible, setIsUpdateBannerVisible] = useState(true)
+ const hasUpdatePrompt = !isStoreBuild && (!autoUpdates || !!(updateDownloaded || isDownloading || checkState.status === 'available'))
- const hasUpdatePrompt = !isStoreBuild && !!(updateDownloaded || ((settings.autoUpdates ?? true) && updateInfo?.hasUpdate) || checkState.status === 'available')
- const showScrollUpdateBadge = hasUpdatePrompt && activeTab === 'behaviour' && !isUpdateBannerVisible
+ // ── Floating Scroll Indicator Badge for Off-Screen Update Banner ────────────
+ const [isUpdateCardVisible, setIsUpdateCardVisible] = useState(false)
+ const hasActiveUpdate = !isStoreBuild && !!(updateDownloaded || isDownloading || checkState.status === 'available')
+ const showScrollUpdateBadge = hasActiveUpdate && !isUpdateCardVisible
useEffect(() => {
- if (isStoreBuild || activeTab !== 'behaviour' || !hasUpdatePrompt) {
- setIsUpdateBannerVisible(true)
+ if (!hasActiveUpdate) {
+ setIsUpdateCardVisible(false)
+ return
+ }
+
+ if (activeTab !== 'behaviour') {
+ setIsUpdateCardVisible(false)
return
}
- const container = scrollListRef.current
- if (!container) return
+ const scrollEl = scrollListRef.current
+ const bannerEl = updateBannerRef.current
+ if (!scrollEl || !bannerEl) {
+ setIsUpdateCardVisible(false)
+ return
+ }
const checkVisibility = () => {
- const el = updateBannerRef.current
- if (!el) {
- setIsUpdateBannerVisible(true)
- return
- }
- const elRect = el.getBoundingClientRect()
- const containerRect = container.getBoundingClientRect()
- // Element is visible if its top and bottom are inside container's view
- const visible = elRect.top >= containerRect.top - 10 && elRect.bottom <= containerRect.bottom + 20
- setIsUpdateBannerVisible(visible)
+ const scrollRect = scrollEl.getBoundingClientRect()
+ const bannerRect = bannerEl.getBoundingClientRect()
+ const isVisible = bannerRect.top < scrollRect.bottom && bannerRect.bottom > scrollRect.top
+ setIsUpdateCardVisible(isVisible)
}
checkVisibility()
- // Small delay to allow DOM render on tab switch
- const timer = setTimeout(checkVisibility, 60)
- container.addEventListener('scroll', checkVisibility, { passive: true })
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const [entry] = entries
+ setIsUpdateCardVisible(entry?.isIntersecting ?? false)
+ },
+ {
+ root: scrollEl,
+ threshold: 0.05
+ }
+ )
+
+ observer.observe(bannerEl)
+ scrollEl.addEventListener('scroll', checkVisibility, { passive: true })
+
return () => {
- clearTimeout(timer)
- container.removeEventListener('scroll', checkVisibility)
+ observer.disconnect()
+ scrollEl.removeEventListener('scroll', checkVisibility)
}
- }, [isStoreBuild, activeTab, hasUpdatePrompt, updateDownloaded, updateInfo, checkState.status])
+ }, [activeTab, hasActiveUpdate, hasUpdatePrompt, isDownloading, updateDownloaded, checkState.status])
+
+ const scrollToUpdateCard = () => {
+ playButtonClickSound()
+ if (activeTab !== 'behaviour') {
+ handleTabSwitch('behaviour')
+ requestAnimationFrame(() => {
+ setTimeout(() => {
+ updateBannerRef.current?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
+ }, 60)
+ })
+ } else {
+ updateBannerRef.current?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
+ }
+ }
// ── Persistent footer shared across all tabs ───────────────────────────
const PersistentFooter = (
@@ -478,225 +511,6 @@ export function Settings({ inlineIndicatorStyle }: { inlineIndicatorStyle?: bool
onChange={(v) => patch({ autoUpdates: v })}
/>
</div>
-
- {/* ── UPDATE CONTROL / MANUAL CHECK BANNER ── */}
- <div ref={updateBannerRef}>
- {updateDownloaded ? (
- <div style={{
- marginTop: 12,
- background: 'rgba(76, 175, 80, 0.08)',
- border: '1px solid rgba(76, 175, 80, 0.3)',
- borderRadius: 12,
- padding: '14px 16px',
- display: 'flex',
- flexDirection: 'column',
- gap: 10,
- boxShadow: '0 4px 16px rgba(0, 0, 0, 0.2)'
- }}>
- <div>
- <div style={{ fontSize: 13.5, fontWeight: 600, color: '#ffffff', letterSpacing: '-0.01em' }}>
- {t('behaviour.updateReadyTitle', { version: updateDownloaded.version })}
- </div>
- <div style={{ fontSize: 12, color: 'rgba(255, 255, 255, 0.7)', marginTop: 3, lineHeight: 1.45 }}>
- {t('behaviour.updateReadyDesc')}
- </div>
- </div>
- <button
- onClick={() => window.edge.installUpdate()}
- style={{
- width: '100%',
- background: '#ffffff',
- color: '#000000',
- border: 'none',
- borderRadius: 9,
- padding: '8px 16px',
- fontSize: 12.5,
- fontWeight: 600,
- cursor: 'pointer',
- textAlign: 'center',
- boxShadow: '0 2px 8px rgba(255, 255, 255, 0.15)',
- transition: 'opacity 0.15s ease'
- }}
- onMouseEnter={(e) => { e.currentTarget.style.opacity = '0.92' }}
- onMouseLeave={(e) => { e.currentTarget.style.opacity = '1' }}
- >
- {t('behaviour.restartToUpdate')}
- </button>
- </div>
- ) : !autoUpdates ? (
- <div style={{
- marginTop: 12,
- background: 'rgba(255, 255, 255, 0.035)',
- border: '1px solid rgba(255, 255, 255, 0.08)',
- borderRadius: 12,
- padding: '14px 16px',
- display: 'flex',
- flexDirection: 'column',
- gap: 12,
- boxShadow: '0 4px 16px rgba(0, 0, 0, 0.18)'
- }}>
- {checkState.status === 'idle' && (
- <button
- onClick={handleManualCheck}
- style={{
- width: '100%',
- background: 'rgba(255, 255, 255, 0.07)',
- color: '#ffffff',
- border: '1px solid rgba(255, 255, 255, 0.14)',
- borderRadius: 10,
- padding: '9px 16px',
- fontSize: 12.5,
- fontWeight: 500,
- cursor: 'pointer',
- textAlign: 'center',
- transition: 'all 0.2s ease'
- }}
- onMouseEnter={(e) => {
- e.currentTarget.style.background = 'rgba(255, 255, 255, 0.12)'
- e.currentTarget.style.borderColor = 'rgba(255, 255, 255, 0.25)'
- }}
- onMouseLeave={(e) => {
- e.currentTarget.style.background = 'rgba(255, 255, 255, 0.07)'
- e.currentTarget.style.borderColor = 'rgba(255, 255, 255, 0.14)'
- }}
- >
- {t('behaviour.checkForUpdates')}
- </button>
- )}
-
- {checkState.status === 'checking' && (
- <div style={{ fontSize: 12.5, color: 'rgba(255, 255, 255, 0.85)', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10, padding: '6px 0' }}>
- <motion.span
- animate={{ rotate: 360 }}
- transition={{ repeat: Infinity, duration: 0.8, ease: 'linear' }}
- style={{
- display: 'inline-block',
- width: 13,
- height: 13,
- border: '2px solid rgba(255, 255, 255, 0.25)',
- borderTopColor: '#ffffff',
- borderRadius: '50%'
- }}
- />
- {t('behaviour.checkingForUpdates')}
- </div>
- )}
-
- {checkState.status === 'up-to-date' && (
- <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12 }}>
- <div style={{ fontSize: 12.5, color: '#4caf50', fontWeight: 500 }}>
- {t('behaviour.isUpToDate')} (v{currentVersion || '0.2.1'})
- </div>
- <button
- onClick={handleManualCheck}
- style={{
- background: 'transparent',
- color: 'rgba(255, 255, 255, 0.65)',
- border: 'none',
- fontSize: 11.5,
- cursor: 'pointer',
- textDecoration: 'underline'
- }}
- >
- {t('behaviour.checkAgain')}
- </button>
- </div>
- )}
-
- {checkState.status === 'available' && (
- <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
- <div>
- <div style={{ fontSize: 13.5, fontWeight: 600, color: '#ffffff', letterSpacing: '-0.01em' }}>
- {t('behaviour.updateAvailableTitle', { version: checkState.version || '' })}
- </div>
- <div style={{ fontSize: 12, color: 'rgba(255, 255, 255, 0.65)', marginTop: 3, lineHeight: 1.45 }}>
- {t('behaviour.updateAvailableDesc')}
- </div>
- </div>
- <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginTop: 4 }}>
- <button
- onClick={handleStartDownload}
- style={{
- background: '#ffffff',
- color: '#000000',
- border: 'none',
- borderRadius: 9,
- padding: '7px 16px',
- fontSize: 12,
- fontWeight: 600,
- cursor: 'pointer',
- boxShadow: '0 2px 8px rgba(255, 255, 255, 0.15)',
- transition: 'transform 0.15s ease, opacity 0.15s ease'
- }}
- onMouseEnter={(e) => { e.currentTarget.style.opacity = '0.92' }}
- onMouseLeave={(e) => { e.currentTarget.style.opacity = '1' }}
- >
- {t('behaviour.downloadAndUpdate')}
- </button>
- <button
- onClick={() => useStore.getState().dismissUpdate()}
- style={{
- background: 'rgba(255, 255, 255, 0.08)',
- color: 'rgba(255, 255, 255, 0.8)',
- border: '1px solid rgba(255, 255, 255, 0.14)',
- borderRadius: 9,
- padding: '7px 14px',
- fontSize: 12,
- fontWeight: 500,
- cursor: 'pointer',
- transition: 'background 0.2s ease'
- }}
- onMouseEnter={(e) => { e.currentTarget.style.background = 'rgba(255, 255, 255, 0.14)' }}
- onMouseLeave={(e) => { e.currentTarget.style.background = 'rgba(255, 255, 255, 0.08)' }}
- >
- {t('behaviour.skip')}
- </button>
- </div>
- </div>
- )}
-
- {checkState.status === 'downloading' && (
- <div style={{ fontSize: 12.5, color: 'rgba(255, 255, 255, 0.9)', display: 'flex', alignItems: 'center', gap: 10, padding: '6px 0' }}>
- <motion.span
- animate={{ rotate: 360 }}
- transition={{ repeat: Infinity, duration: 0.8, ease: 'linear' }}
- style={{
- display: 'inline-block',
- width: 13,
- height: 13,
- border: '2px solid rgba(255, 255, 255, 0.25)',
- borderTopColor: '#ffffff',
- borderRadius: '50%'
- }}
- />
- {t('behaviour.downloadingUpdate')}
- </div>
- )}
-
- {checkState.status === 'error' && (
- <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12 }}>
- <div style={{ fontSize: 12, color: '#f44336' }}>
- ⚠️ {checkState.error || t('behaviour.updateCheckFailed')}
- </div>
- <button
- onClick={handleManualCheck}
- style={{
- background: 'rgba(255, 255, 255, 0.12)',
- color: '#ffffff',
- border: '1px solid rgba(255, 255, 255, 0.2)',
- borderRadius: 7,
- padding: '4px 10px',
- fontSize: 11.5,
- cursor: 'pointer'
- }}
- >
- {t('behaviour.tryAgain')}
- </button>
- </div>
- )}
- </div>
- ) : null}
- </div>
</>
)}
@@ -751,6 +565,176 @@ export function Settings({ inlineIndicatorStyle }: { inlineIndicatorStyle?: bool
</div>
</div>
+ {/* ── Update Control (Shown at bottom above Community) ── */}
+ {hasUpdatePrompt && (
+ <>
+ <div className="setting-divider" style={{ marginTop: 20 }} />
+ <div className="manual-update-section" ref={updateBannerRef}>
+ <div className="manual-update-card">
+ {updateDownloaded ? (
+ <>
+ <div className="manual-update-info">
+ <div className="manual-update-title">
+ <span className="manual-update-dot ready" />
+ <span>{t('behaviour.updateReadyTitle', { version: updateDownloaded.version })}</span>
+ </div>
+ <div className="manual-update-desc">
+ {t('behaviour.updateReadyDesc')}
+ </div>
+ </div>
+ <button
+ type="button"
+ className="manual-update-pill primary"
+ onClick={() => {
+ playButtonClickSound()
+ void window.edge.installUpdate()
+ }}
+ >
+ {t('behaviour.restartToUpdate')}
+ </button>
+ </>
+ ) : isDownloading ? (
+ <>
+ <div className="manual-update-info">
+ <div className="manual-update-title">
+ <span className="manual-update-dot ready" />
+ <span>
+ {updateInfo?.latestVersion
+ ? `Update v${updateInfo.latestVersion} Available`
+ : t('behaviour.updateAvailableTitle', { version: '' })}
+ </span>
+ </div>
+ <div className="manual-update-desc">
+ {t('behaviour.downloadingUpdate')}
+ </div>
+ </div>
+ <button
+ type="button"
+ className="manual-update-pill primary"
+ disabled
+ >
+ {downloadPercent > 0
+ ? `Downloading... (${downloadPercent}%)`
+ : 'Downloading update...'}
+ </button>
+ </>
+ ) : checkState.status === 'available' ? (
+ <>
+ <div className="manual-update-info">
+ <div className="manual-update-title">
+ <span className="manual-update-dot ready" />
+ <span>{t('behaviour.updateAvailableTitle', { version: checkState.version || '' })}</span>
+ </div>
+ <div className="manual-update-desc">
+ {t('behaviour.updateAvailableDesc')}
+ </div>
+ </div>
+ <div className="manual-update-actions">
+ <button
+ type="button"
+ className="manual-update-pill primary"
+ onClick={() => {
+ playButtonClickSound()
+ handleStartDownload()
+ }}
+ >
+ {t('behaviour.downloadAndUpdate')}
+ </button>
+ <button
+ type="button"
+ className="manual-update-pill outline"
+ onClick={() => {
+ playButtonClickSound()
+ useStore.getState().dismissUpdate()
+ }}
+ >
+ {t('behaviour.skip')}
+ </button>
+ </div>
+ </>
+ ) : checkState.status === 'checking' ? (
+ <>
+ <div className="manual-update-info">
+ <div className="manual-update-title">{t('behaviour.checkForUpdates')}</div>
+ <div className="manual-update-desc">{t('behaviour.checkingForUpdates')}</div>
+ </div>
+ <button
+ type="button"
+ className="manual-update-pill outline"
+ disabled
+ >
+ <span className="manual-update-dot checking" />
+ <span>{t('behaviour.checkingForUpdates')}</span>
+ </button>
+ </>
+ ) : checkState.status === 'up-to-date' ? (
+ <>
+ <div className="manual-update-info">
+ <div className="manual-update-title">
+ <span className="manual-update-dot ready" />
+ <span>{t('behaviour.isUpToDate')}</span>
+ </div>
+ <div className="manual-update-desc">
+ {t('footer.version')} {currentVersion || '0.3.1'}
+ </div>
+ </div>
+ <button
+ type="button"
+ className="manual-update-pill outline"
+ onClick={() => {
+ playButtonClickSound()
+ handleManualCheck()
+ }}
+ >
+ {t('behaviour.checkAgain')}
+ </button>
+ </>
+ ) : checkState.status === 'error' ? (
+ <>
+ <div className="manual-update-info">
+ <div className="manual-update-title error">
+ {t('behaviour.updateCheckFailed')}
+ </div>
+ <div className="manual-update-desc error">
+ {checkState.error || t('behaviour.updateCheckFailed')}
+ </div>
+ </div>
+ <button
+ type="button"
+ className="manual-update-pill outline"
+ onClick={() => {
+ playButtonClickSound()
+ handleManualCheck()
+ }}
+ >
+ {t('behaviour.tryAgain')}
+ </button>
+ </>
+ ) : (
+ <>
+ <div className="manual-update-info">
+ <div className="manual-update-title">{t('behaviour.checkForUpdates')}</div>
+ <div className="manual-update-desc">
+ {t('footer.version')} {currentVersion || '0.3.1'}
+ </div>
+ </div>
+ <button
+ type="button"
+ className="manual-update-pill outline"
+ onClick={() => {
+ playButtonClickSound()
+ handleManualCheck()
+ }}
+ >
+ {t('behaviour.checkForUpdates')}
+ </button>
+ </>
+ )}
+ </div>
+ </div>
+ </>
+ )}
+
{PersistentFooter}
</motion.div>
)}
@@ -1333,41 +1317,22 @@ export function Settings({ inlineIndicatorStyle }: { inlineIndicatorStyle?: bool
{showScrollUpdateBadge && (
<motion.div
key="scroll-update-badge"
- initial={{ opacity: 0, y: 12, scale: 0.9 }}
+ initial={{ opacity: 0, y: 14, scale: 0.92 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
- exit={{ opacity: 0, y: 12, scale: 0.9 }}
- transition={{ type: 'spring', stiffness: 450, damping: 30 }}
- onClick={() => {
- playButtonClickSound()
- updateBannerRef.current?.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
- }}
- style={{
- position: 'absolute',
- bottom: 14,
- left: 12,
- right: 12,
- margin: '0 auto',
- width: 'fit-content',
- maxWidth: 'calc(100% - 24px)',
- background: '#388e3c',
- border: '1px solid rgba(255, 255, 255, 0.25)',
- borderRadius: 20,
- padding: '6px 14px',
- fontSize: 11.5,
- fontWeight: 600,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- gap: 6,
- cursor: 'pointer',
- boxShadow: '0 6px 20px rgba(0, 0, 0, 0.45)',
- zIndex: 30,
- whiteSpace: 'nowrap'
- }}
+ exit={{ opacity: 0, y: 14, scale: 0.92 }}
+ transition={{ type: 'spring', stiffness: 450, damping: 32 }}
+ onClick={scrollToUpdateCard}
+ className="floating-update-pill"
>
- <span style={{ display: 'inline-block', width: 6, height: 6, borderRadius: '50%', background: '#ffffff' }} />
- <span>{updateDownloaded ? t('behaviour.restartToUpdateBelow') : t('behaviour.newUpdateAvailableBelow')}</span>
- <span style={{ fontSize: 11, marginLeft: 2 }}>↓</span>
+ <span className="floating-update-dot" />
+ <span className="floating-update-text">
+ {updateDownloaded
+ ? t('behaviour.restartToUpdateBelow')
+ : isDownloading
+ ? (downloadPercent > 0 ? `Downloading... (${downloadPercent}%)` : t('behaviour.downloadingUpdate'))
+ : t('behaviour.newUpdateAvailableBelow')}
+ </span>
+ <span className="floating-update-arrow">↓</span>
</motion.div>
)}
</AnimatePresence>
diff --git a/src/i18n/translations.ts b/src/i18n/translations.ts
index 6270010..3b842df 100644
--- a/src/i18n/translations.ts
+++ b/src/i18n/translations.ts
@@ -514,9 +514,9 @@ export const en: TranslationKeys = {
"updateAvailableDesc": "A newer version is ready on GitHub. Would you like to download and update now?",
"downloadAndUpdate": "Download & Update",
"skip": "Skip",
- "downloadingUpdate": "Downloading update package in background...",
+ "downloadingUpdate": "Downloading in background...",
"updateReadyTitle": "Update v{version} Ready",
- "updateReadyDesc": "Click to restart Edge-Drop and apply the update.",
+ "updateReadyDesc": "Restart to apply update",
"restartToUpdate": "Restart to Update",
"restartToUpdateBelow": "Restart to update below",
"newUpdateAvailableBelow": "New update available below",
diff --git a/src/store/appStore.ts b/src/store/appStore.ts
index 1c4c03c..fcb2065 100644
--- a/src/store/appStore.ts
+++ b/src/store/appStore.ts
@@ -20,6 +20,13 @@ export interface ToastMsg {
tone: 'info' | 'error'
}
+export interface UpdateProgress {
+ percent: number
+ bytesPerSecond?: number
+ transferred?: number
+ total?: number
+}
+
interface AppState {
items: ClipboardItemDto[]
settings: Settings
@@ -54,7 +61,12 @@ interface AppState {
tutorialStep: number
currentVersion: string
isStoreBuild: boolean
- updateInfo: { hasUpdate: boolean; latestVersion: string; downloaded: boolean } | null
+ updateInfo: {
+ hasUpdate: boolean
+ latestVersion: string
+ downloaded: boolean
+ downloadProgress?: UpdateProgress
+ } | null
/** Item ID currently being previewed in the flyout. */
previewItemId: string | null
previewItemRect: { y: number; height: number } | null
@@ -78,6 +90,7 @@ interface AppState {
startManualDownload: () => Promise<void>
resetManualCheck: () => void
setUpdateAvailable: (info: { version: string }) => void
+ setUpdateProgress: (progress: UpdateProgress) => void
setUpdateDownloaded: (info: { version: string }) => void
dismissUpdate: () => void
installUpdate: () => Promise<void>
@@ -248,12 +261,34 @@ export const useStore = create<AppState>((set, get) => ({
})
},
+ setUpdateProgress: (progress) => {
+ const current = get().updateInfo
+ if (!current) {
+ set({
+ updateInfo: {
+ hasUpdate: true,
+ latestVersion: '',
+ downloaded: false,
+ downloadProgress: progress
+ }
+ })
+ return
+ }
+ set({
+ updateInfo: {
+ ...current,
+ downloadProgress: progress
+ }
+ })
+ },
+
setUpdateDownloaded: (info) => {
set({
updateInfo: {
hasUpdate: true,
latestVersion: info.version,
- downloaded: true
+ downloaded: true,
+ downloadProgress: undefined
},
manualCheckState: { status: 'idle' }
})
diff --git a/src/styles/settings.css b/src/styles/settings.css
index ff478ba..cb33433 100644
--- a/src/styles/settings.css
+++ b/src/styles/settings.css
@@ -938,4 +938,337 @@
font-weight: 600;
color: rgba(255, 255, 255, 0.5);
line-height: 1;
+}
+
+/* ── Top Update Banner (Live Downloading Progress & Ready to Install) ── */
+.settings-top-update-card {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ padding: 14px 16px;
+ background: #141414;
+ border-radius: 14px;
+ margin: 4px 4px 14px 4px;
+ box-shadow: none;
+ box-sizing: border-box;
+ animation: updateCardFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
+}
+
+@keyframes updateCardFadeIn {
+ from {
+ opacity: 0;
+ transform: translateY(-3px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.settings-update-header {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ min-height: 18px;
+}
+
+.settings-update-badge-pill {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 12px;
+ font-weight: 550;
+ color: #ffffff;
+ letter-spacing: -0.01em;
+}
+
+.settings-update-desc {
+ font-size: 11px;
+ color: rgba(255, 255, 255, 0.65);
+ line-height: 1.35;
+}
+
+.update-status-dot {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ flex-shrink: 0;
+ background: #ffffff;
+}
+
+.settings-update-restart-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: 36px;
+ min-height: 36px;
+ max-height: 36px;
+ background: #ffffff;
+ color: #000000;
+ border: none;
+ border-radius: 999px;
+ font-size: 12.5px;
+ font-weight: 600;
+ cursor: pointer;
+ box-shadow: none;
+ transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
+ margin-top: 4px;
+ box-sizing: border-box;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ font-variant-numeric: tabular-nums;
+}
+
+.settings-update-restart-btn:hover {
+ background: rgba(255, 255, 255, 0.92);
+ transform: translateY(-1px);
+}
+
+.settings-update-restart-btn:active {
+ transform: scale(0.98);
+}
+
+.settings-update-restart-btn.downloading {
+ cursor: default;
+ opacity: 0.92;
+}
+
+.settings-update-restart-btn.downloading:hover {
+ background: #ffffff;
+ transform: none;
+}
+
+.settings-update-restart-btn.downloading:active {
+ transform: none;
+}
+
+/* ── Manual Update Section (Bottom of Behaviour, above Community) ── */
+.manual-update-section {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ margin-top: 14px;
+}
+
+.manual-update-card {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ padding: 12px 14px;
+ background: #141414;
+ border-radius: 12px;
+ box-sizing: border-box;
+ animation: updateCardFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
+}
+
+.manual-update-info {
+ display: flex;
+ flex-direction: column;
+ gap: 3px;
+}
+
+.manual-update-title {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 12px;
+ font-weight: 550;
+ color: #ffffff;
+ letter-spacing: -0.01em;
+}
+
+.manual-update-title.error {
+ color: #f87171;
+}
+
+.manual-update-desc {
+ font-size: 11px;
+ color: rgba(255, 255, 255, 0.65);
+ line-height: 1.35;
+}
+
+.manual-update-desc.error {
+ color: rgba(248, 113, 113, 0.75);
+}
+
+.manual-update-dot {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ flex-shrink: 0;
+ background: #ffffff;
+}
+
+.manual-update-dot.ready {
+ background: #ffffff;
+}
+
+.manual-update-dot.checking {
+ animation: dotPulse 1.2s ease-in-out infinite;
+}
+
+@keyframes dotPulse {
+ 0%, 100% {
+ opacity: 0.3;
+ transform: scale(0.85);
+ }
+ 50% {
+ opacity: 1;
+ transform: scale(1.15);
+ }
+}
+
+.manual-update-actions {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ width: 100%;
+ margin-top: 2px;
+}
+
+.manual-update-pill {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 6px;
+ width: 100%;
+ height: 28px;
+ min-height: 28px;
+ max-height: 28px;
+ padding: 0 14px;
+ border-radius: 999px;
+ font-size: 11.5px;
+ font-weight: 600;
+ box-sizing: border-box;
+ cursor: pointer;
+ border: none;
+ transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ font-variant-numeric: tabular-nums;
+ margin-top: 2px;
+}
+
+.manual-update-pill.primary {
+ background: #ffffff;
+ color: #000000;
+}
+
+.manual-update-pill.primary:hover:not(:disabled) {
+ background: rgba(255, 255, 255, 0.92);
+ transform: translateY(-1px);
+}
+
+.manual-update-pill.primary:active:not(:disabled) {
+ transform: scale(0.98);
+}
+
+.manual-update-pill.primary:disabled {
+ cursor: default;
+ opacity: 0.92;
+}
+
+.manual-update-pill.outline {
+ background: #1f1f1f;
+ color: #ffffff;
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ font-weight: 550;
+}
+
+.manual-update-pill.outline:hover:not(:disabled) {
+ background: #282828;
+ border-color: rgba(255, 255, 255, 0.16);
+ transform: translateY(-1px);
+}
+
+.manual-update-pill.outline:active:not(:disabled) {
+ transform: scale(0.98);
+}
+
+.manual-update-pill.outline:disabled {
+ cursor: default;
+ opacity: 0.8;
+}
+
+.manual-update-actions .manual-update-pill {
+ margin-top: 0;
+}
+
+.manual-update-actions .manual-update-pill.primary {
+ flex: 1;
+}
+
+.manual-update-actions .manual-update-pill.outline {
+ width: auto;
+ padding: 0 16px;
+}
+
+/* ── Floating Scroll Indicator Badge for Off-Screen Update Banner ── */
+.floating-update-pill {
+ position: absolute;
+ bottom: 14px;
+ left: 0;
+ right: 0;
+ margin: 0 auto;
+ width: fit-content;
+ max-width: calc(100% - 32px);
+ height: 30px;
+ padding: 0 14px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ background: rgba(18, 18, 18, 0.94);
+ backdrop-filter: blur(16px);
+ -webkit-backdrop-filter: blur(16px);
+ border: 1px solid rgba(255, 255, 255, 0.16);
+ border-radius: 999px;
+ font-size: 11.5px;
+ font-weight: 600;
+ color: #ffffff;
+ cursor: pointer;
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
+ z-index: 40;
+ white-space: nowrap;
+ user-select: none;
+ font-variant-numeric: tabular-nums;
+ transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
+}
+
+.floating-update-pill:hover {
+ background: #242424;
+ border-color: rgba(255, 255, 255, 0.28);
+ transform: translateY(-2px);
+}
+
+.floating-update-pill:active {
+ transform: scale(0.97);
+}
+
+.floating-update-dot {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ flex-shrink: 0;
+ background: #ffffff;
+ animation: dotPulse 1.2s ease-in-out infinite;
+}
+
+.floating-update-text {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.floating-update-arrow {
+ font-size: 11px;
+ opacity: 0.85;
+ transition: transform 0.15s ease;
+}
+
+.floating-update-pill:hover .floating-update-arrow {
+ transform: translateY(1px);
}
\ No newline at end of file
diff --git a/tests/storeUpdater.test.ts b/tests/storeUpdater.test.ts
index 6cf4fcf..adbe302 100644
--- a/tests/storeUpdater.test.ts
+++ b/tests/storeUpdater.test.ts
@@ -22,7 +22,8 @@ vi.mock('electron', () => ({
vi.mock('../electron/main/state', () => ({
pushState: {
updateAvailable: (...args: unknown[]) => mocks.updateAvailable(...args),
- updateDownloaded: vi.fn()
+ updateDownloaded: vi.fn(),
+ updateProgress: vi.fn()
}
}))