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:
@@ -9,7 +9,7 @@ import {
|
||||
import { useScrollFade } from "../../lib/useScrollFade";
|
||||
import { FOCUS_REST_ATTRS, useFocusKeeper } from "../../lib/useFocusKeeper";
|
||||
import { StickyTopProvider } from "./stickyTop";
|
||||
import { useBackToTopShown } from "./backToTopState";
|
||||
import { useBackToTopShown, useCornerLift } from "./backToTopState";
|
||||
import { CONTENT_ID } from "./landmarks";
|
||||
import { ensureNavId, peekNavId, subscribeNav } from "../../lib/history";
|
||||
|
||||
@@ -139,6 +139,7 @@ export default function PageScroller({
|
||||
}, []);
|
||||
const { ref: fadeRef, style: fadeStyle } = useScrollFade(20, stickyTops === 0);
|
||||
const fabUp = useBackToTopShown();
|
||||
const cornerLift = useCornerLift();
|
||||
const elRef = useRef<HTMLElement | null>(null);
|
||||
// Stable identity: an inline ref callback changes every render, which makes React detach and
|
||||
// re-attach the ref each commit — and since fadeRef is a state setter, that re-attach loops it
|
||||
@@ -217,7 +218,15 @@ export default function PageScroller({
|
||||
{/* While Back to top floats over the corner, the page ends a button's height (3rem + its 1.25rem
|
||||
inset) later, so its last row or pager can scroll out from under it. Only then: a spacer
|
||||
always there would give a full-height layout a scrollbar it does not need. */}
|
||||
{fabUp && <div aria-hidden="true" className="h-18" />}
|
||||
{cornerLift > 0 ? (
|
||||
// The download tray sits in the same corner (and the button, when up, over it).
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style={{ height: `calc(${cornerLift}px + ${fabUp ? "5.25rem" : "1.5rem"})` }}
|
||||
/>
|
||||
) : (
|
||||
fabUp && <div aria-hidden="true" className="h-18" />
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user