feat(files): download from anywhere — a link box, a pasted link, the palette; the running downloads in a tray
- Files toolbar link box (paste button, Enter); a lone http(s) link pasted onto any page opens the one app-wide download dialog, which now names the link; the palette's "Download from a link…" focuses the box on its history entry. - The download tray, bottom right on every page: what waits, runs, is paused or failed (reason + Retry, the queue's right-click / "…" menu), and what finished in this tab as "Done · Open" until closed; folds to a pill (per-account pref); closed, it stays shut — across a reload — until the work changes or something finishes. Back to top steps up over it, the page end keeps clear. - A finish is announced once: "Downloaded: …", whether a phone plays it, Copy link + Open (toasts and notices may carry a second action). - The inbox's ready notice opens the file in its folder: download_done carries job_id + folder_id. - GET /api/downloads is the queue only (in flight, failed, finished in the last 10 minutes), with each row's source key.
This commit is contained in:
@@ -34,6 +34,7 @@ import { MoreButton } from "./ui/MoreButton";
|
||||
import NavGrid from "./ui/NavGrid";
|
||||
import Overlay from "./ui/Overlay";
|
||||
import { PageToolbar } from "./ui/PageShell";
|
||||
import { LinkBox } from "./LinkBox";
|
||||
import Pager from "./ui/Pager";
|
||||
import { Pressable } from "./ui/Pressable";
|
||||
import { LoadingState, StateMessage } from "./ui/QueryState";
|
||||
@@ -572,9 +573,8 @@ export default function Files() {
|
||||
{t("files.count", { count: rows.length })}
|
||||
</span>
|
||||
)}
|
||||
{/* Wraps on a phone: sort, view and Upload together are wider than the column. */}
|
||||
<span className="ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2">
|
||||
{isGrid && (
|
||||
{isGrid && (
|
||||
<span className="ml-auto">
|
||||
<ColumnSortControl
|
||||
columns={columns}
|
||||
sort={sort}
|
||||
@@ -584,23 +584,31 @@ export default function Files() {
|
||||
ascLabel={t("files.sort.asc")}
|
||||
descLabel={t("files.sort.desc")}
|
||||
/>
|
||||
)}
|
||||
<ViewSwitcher
|
||||
value={layout}
|
||||
options={layoutOptions}
|
||||
onChange={(next) => setLayouts({ ...layouts, [viewKey]: next })}
|
||||
label={t("files.layout.label")}
|
||||
/>
|
||||
{canUpload && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
icon={<UploadCloud className="w-4 h-4" />}
|
||||
onClick={() => setUpload({ file: null })}
|
||||
>
|
||||
{t("files.actions.upload")}
|
||||
</Button>
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
{/* The intake row (DESIGN.md "Files page"): paste a link, or upload; then the paint. On a
|
||||
phone the link box takes the line and the rest wraps under it. A link is downloaded
|
||||
into its site's folder whatever is open, so the box stays even in Shared with me. */}
|
||||
<span className="flex w-full flex-wrap items-center gap-2">
|
||||
<LinkBox className="flex-[1_1_18rem]" />
|
||||
<span className="ml-auto flex items-center gap-2">
|
||||
{canUpload && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
icon={<UploadCloud className="w-4 h-4" />}
|
||||
onClick={() => setUpload({ file: null })}
|
||||
>
|
||||
{t("files.actions.upload")}
|
||||
</Button>
|
||||
)}
|
||||
<ViewSwitcher
|
||||
value={layout}
|
||||
options={layoutOptions}
|
||||
onChange={(next) => setLayouts({ ...layouts, [viewKey]: next })}
|
||||
label={t("files.layout.label")}
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</PageToolbar>
|
||||
|
||||
Reference in New Issue
Block a user