Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat(ui): v1 omnibox + popover, paste pill, duration badge, and global download dock

IGECT3d28fb30b6c5
diff --git a/src/components/download/GlobalDownloadBar.svelte b/src/components/download/GlobalDownloadBar.svelte
new file mode 100644
index 00000000..123c28b3
--- /dev/null
+++ b/src/components/download/GlobalDownloadBar.svelte
@@ -0,0 +1,278 @@
+<script lang="ts">
+ import { page } from "$app/state";
+ import { goto } from "$app/navigation";
+ import { t } from "$lib/i18n";
+ import {
+ getDownloads,
+ getSpeedHistory,
+ type DownloadItem,
+ } from "$lib/stores/download-store.svelte";
+ import { formatBytes, formatSpeed } from "$lib/download-format";
+
+ const downloadsMap = $derived(getDownloads());
+
+ const activeItems = $derived.by(() => {
+ const list: DownloadItem[] = [];
+ for (const item of downloadsMap.values()) {
+ if (item.status === "downloading" || item.status === "seeding") {
+ list.push(item);
+ }
+ }
+ return list;
+ });
+
+ const visible = $derived(
+ activeItems.length > 0 && page.url.pathname !== "/downloads",
+ );
+
+ const avgPercent = $derived.by(() => {
+ if (activeItems.length === 0) return 0;
+ let sum = 0;
+ for (const item of activeItems) {
+ sum += Math.max(0, Math.min(100, item.percent || 0));
+ }
+ return sum / activeItems.length;
+ });
+
+ const totalSpeed = $derived.by(() => {
+ let bps = 0;
+ for (const item of activeItems) {
+ bps += item.speed || 0;
+ }
+ return bps;
+ });
+
+ const bytesSummary = $derived.by(() => {
+ let downloaded = 0;
+ let total = 0;
+ let allKnown = activeItems.length > 0;
+ for (const item of activeItems) {
+ if (item.kind === "generic") {
+ downloaded += item.downloadedBytes || 0;
+ if (item.totalBytes && item.totalBytes > 0) {
+ total += item.totalBytes;
+ } else {
+ allKnown = false;
+ }
+ } else {
+ downloaded += item.bytesDownloaded || 0;
+ allKnown = false;
+ }
+ }
+ if (allKnown && total > 0) {
+ return `${formatBytes(downloaded)} / ${formatBytes(total)}`;
+ }
+ return `${formatBytes(downloaded)}`;
+ });
+
+ const sparklinePaths = $derived.by(() => {
+ const primary = activeItems[0];
+ if (!primary) return { line: "", area: "" };
+ const pts = getSpeedHistory(primary.id);
+ const w = 64;
+ const h = 18;
+ if (pts.length < 2) {
+ const y = h - 2;
+ return {
+ line: `M0,${y} L${w},${y}`,
+ area: `M0,${h} L0,${y} L${w},${y} L${w},${h} Z`,
+ };
+ }
+ let maxBps = 1024;
+ for (const p of pts) {
+ if (p.bps > maxBps) maxBps = p.bps;
+ }
+ const coords = pts.map((p, idx) => {
+ const x = (idx / (pts.length - 1)) * w;
+ const ratio = Math.min(1, Math.max(0, p.bps / maxBps));
+ const y = h - 2 - ratio * (h - 4);
+ return `${x.toFixed(1)},${y.toFixed(1)}`;
+ });
+ const line = `M${coords.join(" L")}`;
+ const area = `M0,${h} L${coords.join(" L")} L${w},${h} Z`;
+ return { line, area };
+ });
+</script>
+
+{#if visible}
+ <div class="global-download-dock" role="status" aria-live="polite">
+ <div class="dock-progress-track" aria-hidden="true">
+ <div class="dock-progress-fill" style="width: {avgPercent.toFixed(1)}%"></div>
+ </div>
+
+ <div class="dock-left">
+ <span class="dock-badge" aria-hidden="true">
+ <svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M8 2.5v7.5M4.75 7.25 8 10.5l3.25-3.25M3 13h10" />
+ </svg>
+ </span>
+ <span class="dock-status-label">
+ {activeItems.length} {$t('downloads.phase_downloading').toLowerCase()}
+ </span>
+ </div>
+
+ <div class="dock-right">
+ <span class="dock-metrics">
+ <strong>{Math.round(avgPercent)}%</strong>
+ <span class="dock-sep">&middot;</span>
+ <span>{bytesSummary}</span>
+ <span class="dock-speed">{formatSpeed(totalSpeed)}</span>
+ </span>
+
+ <svg
+ class="dock-sparkline"
+ viewBox="0 0 64 18"
+ width="64"
+ height="18"
+ aria-hidden="true"
+ >
+ <path class="dock-sparkline-area" d={sparklinePaths.area} />
+ <path class="dock-sparkline-line" d={sparklinePaths.line} />
+ </svg>
+
+ <button
+ type="button"
+ class="dock-view-btn"
+ onclick={() => goto("/downloads")}
+ >
+ {$t('downloads.view_queue')}
+ </button>
+ </div>
+ </div>
+{/if}
+
+<style>
+ .global-download-dock {
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--space-3);
+ height: 44px;
+ padding: 0 var(--space-4);
+ background: var(--surface);
+ border-top: var(--hairline) solid var(--separator);
+ flex-shrink: 0;
+ z-index: 25;
+ }
+
+ .dock-progress-track {
+ position: absolute;
+ top: -1px;
+ left: 0;
+ right: 0;
+ height: 2px;
+ background: transparent;
+ overflow: hidden;
+ pointer-events: none;
+ }
+
+ .dock-progress-fill {
+ height: 100%;
+ background: var(--accent);
+ transition: width var(--duration-base) var(--ease-out);
+ }
+
+ .dock-left {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ min-width: 0;
+ }
+
+ .dock-badge {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 24px;
+ height: 24px;
+ border-radius: var(--radius-sm);
+ background: var(--accent-soft);
+ color: var(--accent-hi);
+ flex-shrink: 0;
+ }
+
+ .dock-status-label {
+ font-size: var(--text-sm);
+ font-weight: 600;
+ color: var(--text);
+ white-space: nowrap;
+ }
+
+ .dock-right {
+ display: flex;
+ align-items: center;
+ gap: var(--space-3);
+ min-width: 0;
+ }
+
+ .dock-metrics {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ font-size: var(--text-sm);
+ color: var(--text-muted);
+ font-variant-numeric: tabular-nums;
+ white-space: nowrap;
+ }
+
+ .dock-metrics strong {
+ color: var(--text);
+ font-weight: 600;
+ }
+
+ .dock-sep {
+ color: var(--text-dim);
+ }
+
+ .dock-speed {
+ margin-left: var(--space-1);
+ color: var(--text-dim);
+ }
+
+ .dock-sparkline {
+ flex-shrink: 0;
+ overflow: visible;
+ }
+
+ .dock-sparkline-area {
+ fill: var(--accent-soft);
+ }
+
+ .dock-sparkline-line {
+ fill: none;
+ stroke: var(--accent);
+ stroke-width: 1.5;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ }
+
+ .dock-view-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ height: var(--control-h);
+ padding: 0 var(--space-3);
+ border: none;
+ border-radius: var(--radius-sm);
+ background: var(--fill-1);
+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);
+ color: var(--text);
+ font-size: var(--text-sm);
+ font-weight: 500;
+ cursor: pointer;
+ white-space: nowrap;
+ transition: background var(--duration-fast) var(--ease-out);
+ }
+
+ @media (hover: hover) {
+ .dock-view-btn:hover {
+ background: var(--fill-2);
+ }
+ }
+
+ .dock-view-btn:focus-visible {
+ outline: var(--focus-ring);
+ outline-offset: var(--focus-ring-offset);
+ }
+</style>
diff --git a/src/components/home/HomeUrlBar.svelte b/src/components/home/HomeUrlBar.svelte
index ef301abb..1fb52e8b 100644
--- a/src/components/home/HomeUrlBar.svelte
+++ b/src/components/home/HomeUrlBar.svelte
@@ -1,7 +1,6 @@
<script lang="ts">
import OmniboxInput from "$components/omnibox/OmniboxInput.svelte";
import type { HomeInputMode } from "$lib/home/omnibox-controller";
- import { t } from "$lib/i18n";
let {
url = $bindable(""),
@@ -21,14 +20,6 @@
onAdvanced?: () => void;
} = $props();
- // Secondary entry points, each with an SF-style symbol so the row reads as
- // three quiet tools rather than a sentence of links.
- const secondary: { mode: HomeInputMode; key: string; icon: string }[] = [
- { mode: "batch", key: "home.action_batch", icon: "M4 6h16M4 12h16M4 18h10" },
- { mode: "torrent", key: "home.action_torrent", icon: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8zM14 3v5h5" },
- { mode: "p2p", key: "home.action_p2p", icon: "M22 2 11 13M22 2l-7 20-4-9-9-4z" },
- ];
-
function pick(next: HomeInputMode) {
mode = next;
onModeChange?.(next);
@@ -37,22 +28,15 @@
<div class="home-url-bar" class:stage={variant === "stage"}>
{#if mode === "url"}
- <OmniboxInput bind:url onInput={onInput} prominent={variant === "stage"} />
+ <OmniboxInput
+ bind:url
+ onInput={onInput}
+ prominent={variant === "stage"}
+ {advanced}
+ onModeSelect={pick}
+ {onAdvanced}
+ />
{/if}
- <div class="home-secondary">
- {#each secondary as item (item.mode)}
- <button type="button" class="home-secondary-link" onclick={() => pick(item.mode)}>
- <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d={item.icon} /></svg>
- {$t(item.key)}
- </button>
- {/each}
- {#if onAdvanced}
- <button type="button" class="home-secondary-link" onclick={onAdvanced}>
- <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6" /></svg>
- {$t(advanced ? "home.action_simple" : "home.action_advanced")}
- </button>
- {/if}
- </div>
</div>
<style>
@@ -68,8 +52,4 @@
gap: var(--space-3);
max-width: 680px;
}
-
- .home-url-bar.stage :global(.home-secondary) {
- gap: 2px;
- }
</style>
diff --git a/src/components/omnibox/MediaPreview.svelte b/src/components/omnibox/MediaPreview.svelte
index 46ca4c0d..d50794e1 100644
--- a/src/components/omnibox/MediaPreview.svelte
+++ b/src/components/omnibox/MediaPreview.svelte
@@ -34,17 +34,17 @@
<img class="preview-art" src="/emoji/package.png" alt="" width="32" height="32" draggable="false" />
</div>
{/if}
+ {#if mediaPreview.duration_seconds}
+ <span class="preview-duration-badge">
+ {formatDuration(mediaPreview.duration_seconds)}
+ </span>
+ {/if}
</div>
<div class="preview-info">
<p class="preview-title">{mediaPreview.title}</p>
{#if mediaPreview.author}
<p class="preview-author">{mediaPreview.author}</p>
{/if}
- {#if mediaPreview.duration_seconds}
- <p class="preview-duration">
- {formatDuration(mediaPreview.duration_seconds)}
- </p>
- {/if}
</div>
</div>
{/if}
@@ -128,7 +128,7 @@
.preview-author {
margin: 0;
- font-size: 11.5px;
+ font-size: var(--text-xs);
font-weight: 500;
color: var(--gray);
overflow: hidden;
@@ -136,11 +136,19 @@
white-space: nowrap;
}
- .preview-duration {
- margin: 0;
- font-size: 11.5px;
+ .preview-duration-badge {
+ position: absolute;
+ bottom: 4px;
+ right: 4px;
+ padding: 1px 5px;
+ font-size: var(--text-xs);
font-weight: 500;
- color: var(--gray);
+ line-height: 1.3;
+ color: #fff;
+ background: rgba(0, 0, 0, 0.75);
+ border-radius: var(--radius-xs);
+ font-variant-numeric: tabular-nums;
+ pointer-events: none;
}
@media (max-width: 535px) {
diff --git a/src/components/omnibox/OmniboxInput.svelte b/src/components/omnibox/OmniboxInput.svelte
index a1d3d653..ac0b9e98 100644
--- a/src/components/omnibox/OmniboxInput.svelte
+++ b/src/components/omnibox/OmniboxInput.svelte
@@ -1,12 +1,59 @@
<script lang="ts">
import { t } from "$lib/i18n";
- import ContextHint from "$components/hints/ContextHint.svelte";
import { shortcut } from "$lib/platform";
+ import type { HomeInputMode } from "$lib/home/omnibox-controller";
+ import { readText } from "@tauri-apps/plugin-clipboard-manager";
- let { url = $bindable(""), onInput, prominent = false }: { url?: string; onInput?: () => void; prominent?: boolean } = $props();
+ let {
+ url = $bindable(""),
+ onInput,
+ prominent = false,
+ advanced = false,
+ onModeSelect,
+ onAdvanced,
+ }: {
+ url?: string;
+ onInput?: () => void;
+ prominent?: boolean;
+ advanced?: boolean;
+ onModeSelect?: (mode: HomeInputMode) => void;
+ onAdvanced?: () => void;
+ } = $props();
let dragOver = $state(false);
let inputEl = $state<HTMLInputElement | null>(null);
+ let menuOpen = $state(false);
+ let menuWrapEl = $state<HTMLDivElement | null>(null);
+
+ const secondary: {
+ mode: HomeInputMode;
+ key: "home.action_batch" | "home.action_torrent" | "home.action_p2p";
+ icon: string;
+ }[] = [
+ { mode: "batch", key: "home.action_batch", icon: "M4 6h16M4 12h16M4 18h10" },
+ { mode: "torrent", key: "home.action_torrent", icon: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8zM14 3v5h5" },
+ { mode: "p2p", key: "home.action_p2p", icon: "M22 2 11 13M22 2l-7 20-4-9-9-4z" },
+ ];
+
+ $effect(() => {
+ if (!menuOpen) return;
+ function handleDocPointerDown(e: PointerEvent) {
+ if (menuWrapEl && !menuWrapEl.contains(e.target as Node)) {
+ menuOpen = false;
+ }
+ }
+ function handleDocKeyDown(e: KeyboardEvent) {
+ if (e.key === "Escape") {
+ menuOpen = false;
+ }
+ }
+ document.addEventListener("pointerdown", handleDocPointerDown);
+ document.addEventListener("keydown", handleDocKeyDown);
+ return () => {
+ document.removeEventListener("pointerdown", handleDocPointerDown);
+ document.removeEventListener("keydown", handleDocKeyDown);
+ };
+ });
function handleDragOver(e: DragEvent) {
e.preventDefault();
@@ -43,25 +90,99 @@
function focusInput() {
inputEl?.focus();
}
+
+ async function handlePasteClick() {
+ const text =
+ (await readText().catch(() => null)) ??
+ (await navigator.clipboard?.readText().catch(() => null));
+ if (text?.trim()) {
+ url = text.trim();
+ onInput?.();
+ focusInput();
+ } else {
+ focusInput();
+ }
+ }
</script>
-<!-- A <label> so a click anywhere on the field focuses the input, like a native search field. -->
-<label
+<!-- svelte-ignore a11y_click_events_have_key_events -->
+<!-- svelte-ignore a11y_no_static_element_interactions -->
+<div
class="omnibox-wrapper"
class:drag-over={dragOver}
class:prominent
ondragover={handleDragOver}
ondragleave={handleDragLeave}
ondrop={handleDrop}
+ onclick={(e) => {
+ if (e.target === e.currentTarget) focusInput();
+ }}
>
- <svg class="omnibox-glyph" viewBox="0 0 20 20" width={prominent ? 17 : 14} height={prominent ? 17 : 14} fill="currentColor" aria-hidden="true">
- <path d="M8.5 2.5a6 6 0 1 0 3.67 10.74l3.8 3.79a1 1 0 0 0 1.41-1.41l-3.79-3.8A6 6 0 0 0 8.5 2.5zM4.5 8.5a4 4 0 1 1 8 0 4 4 0 0 1-8 0z" />
- </svg>
+ <div class="omnibox-plus-wrap" bind:this={menuWrapEl}>
+ <button
+ type="button"
+ class="omnibox-plus-btn"
+ class:open={menuOpen}
+ aria-label={$t('omnibox.options')}
+ aria-expanded={menuOpen}
+ aria-haspopup="menu"
+ onclick={(e) => {
+ e.stopPropagation();
+ menuOpen = !menuOpen;
+ }}
+ >
+ <svg viewBox="0 0 16 16" width={prominent ? 14 : 12} height={prominent ? 14 : 12} fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true">
+ <path d="M8 3.2v9.6M3.2 8h9.6" />
+ </svg>
+ </button>
+
+ {#if menuOpen}
+ <div class="omnibox-plus-menu" role="menu">
+ {#each secondary as item (item.mode)}
+ <button
+ type="button"
+ class="omnibox-plus-item"
+ role="menuitem"
+ onclick={(e) => {
+ e.stopPropagation();
+ menuOpen = false;
+ onModeSelect?.(item.mode);
+ }}
+ >
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d={item.icon} />
+ </svg>
+ <span>{$t(item.key)}</span>
+ </button>
+ {/each}
+ {#if onAdvanced}
+ <div class="omnibox-plus-sep" role="separator"></div>
+ <button
+ type="button"
+ class="omnibox-plus-item"
+ role="menuitem"
+ onclick={(e) => {
+ e.stopPropagation();
+ menuOpen = false;
+ onAdvanced();
+ }}
+ >
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
+ <path d="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6" />
+ </svg>
+ <span>{$t(advanced ? "home.action_simple" : "home.action_advanced")}</span>
+ </button>
+ {/if}
+ </div>
+ {/if}
+ </div>
+
<input
bind:this={inputEl}
class="omnibox"
type="text"
placeholder={$t('omnibox.placeholder')}
+ aria-label={$t('omnibox.placeholder')}
bind:value={url}
oninput={onInput}
autocomplete="off"
@@ -76,15 +197,20 @@
<path d="M8 1.4a6.6 6.6 0 1 0 0 13.2A6.6 6.6 0 0 0 8 1.4zm2.35 3.5a.75.75 0 0 1 1.06 1.06L9.06 8l2.35 2.35a.75.75 0 1 1-1.06 1.06L8 9.06 5.65 11.4a.75.75 0 1 1-1.06-1.06L6.94 8 4.6 5.65A.75.75 0 0 1 5.65 4.6L8 6.94l2.35-2.04z" />
</svg>
</button>
- {:else if prominent}
- <span class="omnibox-kbd" aria-hidden="true"><span class="kbd">{shortcut("V")}</span></span>
+ {:else}
+ <button
+ type="button"
+ class="omnibox-paste-btn"
+ onclick={handlePasteClick}
+ aria-label="{$t('tools.ig.download.paste')} ({shortcut('V')})"
+ >
+ <span class="omnibox-paste-label">{$t('tools.ig.download.paste')}</span>
+ <span class="omnibox-paste-kbd">{shortcut("V")}</span>
+ </button>
{/if}
- <ContextHint text={$t('hints.omnibox')} dismissKey="omnibox" />
-</label>
+</div>
<style>
- /* A macOS search field: control fill + hairline, glowing accent ring on focus.
- The prominent (stage) variant is the page's hero and the only elevated thing. */
.omnibox-wrapper {
width: 100%;
position: relative;
@@ -92,7 +218,7 @@
align-items: center;
gap: var(--space-2);
height: var(--control-h-lg);
- padding: 0 var(--space-2) 0 var(--space-3);
+ padding: 0 var(--space-2);
background: var(--control-bg);
border-radius: var(--radius-md);
box-shadow: inset 0 0 0 var(--hairline) var(--content-border);
@@ -102,7 +228,7 @@
.omnibox-wrapper.prominent {
height: 52px;
- padding: 0 var(--space-3) 0 var(--space-4);
+ padding: 0 var(--space-3);
border-radius: var(--radius-xl);
background: var(--surface);
box-shadow:
@@ -137,14 +263,124 @@
0 10px 30px rgba(var(--shadow-ink), var(--elev-alpha-2));
}
- .omnibox-glyph {
+ .omnibox-plus-wrap {
+ position: relative;
+ display: flex;
+ align-items: center;
flex-shrink: 0;
- color: var(--text-dim);
+ }
+
+ .omnibox-plus-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 28px;
+ height: 28px;
+ padding: 0;
+ border: none;
+ border-radius: var(--radius-full);
+ background: var(--fill-1);
+ color: var(--text-muted);
+ cursor: pointer;
+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);
+ transition:
+ background var(--duration-fast) var(--ease-out),
+ color var(--duration-fast) var(--ease-out),
+ transform var(--duration-fast) var(--ease-out);
+ }
+
+ .omnibox-wrapper.prominent .omnibox-plus-btn {
+ width: 32px;
+ height: 32px;
+ }
+
+ .omnibox-plus-btn.open {
+ background: var(--fill-2);
+ color: var(--text);
+ }
+
+ .omnibox-plus-btn.open svg {
+ transform: rotate(45deg);
+ }
+
+ .omnibox-plus-btn svg {
pointer-events: none;
+ transition: transform var(--duration-fast) var(--ease-out);
}
- .omnibox-wrapper:focus-within .omnibox-glyph {
- color: var(--accent-hi);
+ @media (hover: hover) {
+ .omnibox-plus-btn:hover {
+ background: var(--fill-2);
+ color: var(--text);
+ }
+ }
+
+ .omnibox-plus-btn:focus-visible {
+ outline: var(--focus-ring);
+ outline-offset: var(--focus-ring-offset);
+ }
+
+ .omnibox-plus-menu {
+ position: absolute;
+ top: calc(100% + var(--space-2));
+ left: 0;
+ min-width: 220px;
+ padding: var(--space-1);
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ background: var(--surface);
+ border-radius: var(--radius-lg);
+ box-shadow:
+ inset 0 0 0 var(--hairline) var(--content-border),
+ 0 12px 32px rgba(var(--shadow-ink), var(--elev-alpha-3, 0.35)),
+ 0 2px 8px rgba(var(--shadow-ink), var(--elev-alpha-1));
+ z-index: 40;
+ }
+
+ .omnibox-plus-item {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ width: 100%;
+ min-height: 32px;
+ padding: 0 var(--space-3);
+ border: none;
+ border-radius: var(--radius-md);
+ background: transparent;
+ color: var(--text);
+ font-size: var(--text-base);
+ font-weight: 500;
+ text-align: left;
+ cursor: pointer;
+ transition: background var(--duration-fast) var(--ease-out);
+ }
+
+ .omnibox-plus-item svg {
+ color: var(--text-muted);
+ flex-shrink: 0;
+ pointer-events: none;
+ }
+
+ @media (hover: hover) {
+ .omnibox-plus-item:hover {
+ background: var(--fill-2);
+ }
+
+ .omnibox-plus-item:hover svg {
+ color: var(--text);
+ }
+ }
+
+ .omnibox-plus-item:focus-visible {
+ outline: var(--focus-ring);
+ outline-offset: -2px;
+ }
+
+ .omnibox-plus-sep {
+ height: var(--hairline);
+ margin: var(--space-1) var(--space-2);
+ background: var(--separator);
}
.omnibox {
@@ -166,22 +402,60 @@
outline: none;
}
- .omnibox-kbd {
+ .omnibox-paste-btn {
display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ height: 28px;
+ padding: 0 var(--space-2);
+ border: none;
+ border-radius: var(--radius-sm);
+ background: var(--fill-1);
+ box-shadow: inset 0 0 0 var(--hairline) var(--content-border);
+ color: var(--text-muted);
+ font-size: var(--text-sm);
+ font-weight: 500;
+ cursor: pointer;
flex-shrink: 0;
- opacity: 0.8;
+ transition:
+ background var(--duration-fast) var(--ease-out),
+ color var(--duration-fast) var(--ease-out);
+ }
+
+ .omnibox-wrapper.prominent .omnibox-paste-btn {
+ height: 30px;
+ padding: 0 var(--space-3);
+ border-radius: var(--radius-md);
}
- .omnibox-wrapper:focus-within .omnibox-kbd {
- opacity: 0;
+ .omnibox-paste-label {
+ color: var(--text);
+ }
+
+ .omnibox-paste-kbd {
+ font-family: var(--font-mono);
+ font-size: var(--text-xs);
+ color: var(--text-dim);
+ }
+
+ @media (hover: hover) {
+ .omnibox-paste-btn:hover {
+ background: var(--fill-2);
+ color: var(--text);
+ }
+ }
+
+ .omnibox-paste-btn:focus-visible {
+ outline: var(--focus-ring);
+ outline-offset: var(--focus-ring-offset);
}
.clear-btn {
display: flex;
align-items: center;
justify-content: center;
- width: 22px;
- height: 22px;
+ width: 28px;
+ height: 28px;
border: none;
background: transparent;
border-radius: var(--radius-full);
diff --git a/src/lib/style/macos-shell.css b/src/lib/style/macos-shell.css
index 290779d1..ccfa356a 100644
--- a/src/lib/style/macos-shell.css
+++ b/src/lib/style/macos-shell.css
@@ -208,6 +208,11 @@
justify-content: center;
}
+ .mac-search-glyph {
+ width: 12px;
+ height: 12px;
+ }
+
.mac-search-label,
.mac-search-field .kbd {
display: none;
@@ -862,10 +867,6 @@
gap: var(--space-3);
}
-.downloads-mac .downloads-header:not(:has(.downloads-stats)) {
- justify-content: flex-end;
-}
-
.downloads-mac .downloads-stats {
font-size: var(--text-sm);
color: var(--text-dim);
@@ -1082,6 +1083,12 @@
justify-content: flex-start;
background: transparent;
overflow: visible;
+ transition: filter var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
+}
+
+.home-mac-hero--blurred {
+ filter: blur(4px);
+ opacity: 0.65;
}
.home-mac-hero .mascot-bubble {
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 0e23506a..d835b2d7 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -15,6 +15,7 @@
import AppSidebar from "$components/shell/AppSidebar.svelte";
import AppToolbar from "$components/shell/AppToolbar.svelte";
import CommandPalette from "$components/shell/CommandPalette.svelte";
+ import GlobalDownloadBar from "$components/download/GlobalDownloadBar.svelte";
import { setCommandPaletteItems } from "$lib/stores/command-palette-store.svelte";
import {
refreshUpdateInfo,
@@ -425,6 +426,7 @@
</div>
{/if}
</div>
+ <GlobalDownloadBar />
</main>
</div>
</div>
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 5befcac5..97835ccf 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -3,7 +3,6 @@
import { open } from "@tauri-apps/plugin-dialog";
import { goto } from "$app/navigation";
import { onMount } from "svelte";
- import SupportedServices from "$components/services/SupportedServices.svelte";
import BilibiliPreviewExtras from "$components/omnibox/BilibiliPreviewExtras.svelte";
import DownloadModeSelector from "$components/omnibox/DownloadModeSelector.svelte";
import QualityPicker from "$components/omnibox/QualityPicker.svelte";
@@ -989,11 +988,10 @@
{$t('home.value_first')}
{/if}
</p>
- <SupportedServices />
</div>
{:else}
<div class="home-mac-workspace" class:home-mac-workspace--idle={omniState.kind === "idle"}>
- <div class="home-mac-hero">
+ <div class="home-mac-hero" class:home-mac-hero--blurred={omniState.kind === "detecting" || omniState.kind === "detected"}>
<HomeHero
emotion={mascotEmotion}
compact={mascotCompact}
@@ -1093,10 +1091,6 @@
{/if}
{/if}
- {#if omniState.kind === "idle"}
- <SupportedServices />
- {/if}
-
<HomeInspector open={showInspector} title={$t('home.inspector_title')}>
{#if omniState.kind === "detected"}
<MediaPreview bind:mediaPreview bind:imageLoading={previewImageLoading} />
diff --git a/src/routes/downloads/+page.svelte b/src/routes/downloads/+page.svelte
index c8184516..282f27e7 100644
--- a/src/routes/downloads/+page.svelte
+++ b/src/routes/downloads/+page.svelte
@@ -555,13 +555,31 @@
<div class="downloads-page downloads-mac">
{#if viewMode === "active"}
<div class="downloads-header">
- <div class="downloads-hero-left">
- <img src="/icons/downloads-64.png" alt="" class="downloads-head-icon" width="32" height="32" draggable="false" />
+ <div class="filter-pills segmented" role="tablist" aria-label={$t('downloads.filter_label')}>
+ {#each [
+ { value: 'all', labelKey: 'downloads.filter.all', count: filterCounts.all },
+ { value: 'active', labelKey: 'downloads.filter.active', count: filterCounts.active },
+ { value: 'queued', labelKey: 'downloads.filter.queued', count: filterCounts.queued },
+ { value: 'completed', labelKey: 'downloads.filter.completed', count: filterCounts.completed },
+ { value: 'failed', labelKey: 'downloads.filter.failed', count: filterCounts.failed },
+ ] as pill}
+ <button
+ type="button"
+ class="filter-pill segmented-btn"
+ class:active={statusFilter === pill.value}
+ role="tab"
+ aria-selected={statusFilter === pill.value}
+ onclick={() => { statusFilter = pill.value as StatusFilter; finishedVisibleCount = FINISHED_PAGE_SIZE; }}
+ >
+ <span>{$t(pill.labelKey)}</span>
+ <span class="filter-count">{pill.count}</span>
+ </button>
+ {/each}
+ </div>
+ <div class="bulk-actions">
{#if dlStats.totalDownloads > 0}
<span class="downloads-stats">{$t('downloads.stats_line', { count: String(dlStats.totalDownloads), size: formatBytes(dlStats.totalBytes) })}</span>
{/if}
- </div>
- <div class="bulk-actions">
<label class="speed-limit-field">
<span class="speed-limit-label">{$t('settings.download.speed_limit')}</span>
<select
@@ -573,6 +591,7 @@
}}
>
<option value="unlimited">{$t('downloads.speed_unlimited')}</option>
+ <option value="500K">500 KB/s</option>
<option value="1M">1 MB/s</option>
<option value="2M">2 MB/s</option>
<option value="5M">5 MB/s</option>
@@ -581,30 +600,6 @@
</label>
</div>
</div>
- {/if}
-
- {#if viewMode === "active"}
- <div class="filter-pills segmented" role="tablist" aria-label={$t('downloads.filter_label')}>
- {#each [
- { value: 'all', labelKey: 'downloads.filter.all', count: filterCounts.all },
- { value: 'active', labelKey: 'downloads.filter.active', count: filterCounts.active },
- { value: 'queued', labelKey: 'downloads.filter.queued', count: filterCounts.queued },
- { value: 'completed', labelKey: 'downloads.filter.completed', count: filterCounts.completed },
- { value: 'failed', labelKey: 'downloads.filter.failed', count: filterCounts.failed },
- ] as pill}
- <button
- type="button"
- class="filter-pill segmented-btn"
- class:active={statusFilter === pill.value}
- role="tab"
- aria-selected={statusFilter === pill.value}
- onclick={() => { statusFilter = pill.value as StatusFilter; finishedVisibleCount = FINISHED_PAGE_SIZE; }}
- >
- <span>{$t(pill.labelKey)}</span>
- <span class="filter-count">{pill.count}</span>
- </button>
- {/each}
- </div>
<div class="download-list">
{#if showSection.active}
@@ -1281,26 +1276,13 @@
.downloads-header {
display: flex;
+ flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
min-height: 28px;
}
- .downloads-hero-left {
- display: flex;
- align-items: center;
- gap: var(--space-2);
- }
-
- .downloads-head-icon {
- width: 32px;
- height: 32px;
- border-radius: 8px;
- object-fit: contain;
- flex-shrink: 0;
- }
-
.history-hero-head {
display: flex;
align-items: center;
@@ -1344,10 +1326,10 @@
}
.speed-limit-selector {
- height: 24px;
+ height: var(--control-h);
font-size: var(--text-sm);
padding-left: var(--space-2);
- border-radius: 5px;
+ border-radius: var(--radius-sm);
}
.section-label {