diff --git a/docker/frontend/src/Library.tsx b/docker/frontend/src/Library.tsx index 41f5ca9..2b61d37 100644 --- a/docker/frontend/src/Library.tsx +++ b/docker/frontend/src/Library.tsx @@ -195,7 +195,7 @@ export function Library() { // right click landed on the empty part of the column, which is the way in for // one more folder; `root` means it landed on a row at the top level — the head // of a tree — which also carries folding the whole tree. - const [menu, setMenu] = useState<{ folder: LibraryFolder | null; root?: boolean; rel?: string; x: number; y: number } | null>(null); + const [menu, setMenu] = useState<{ folder: LibraryFolder | null; root?: boolean; rel?: string; node?: string; x: number; y: number } | null>(null); // Where the drag of the column divider started, and how wide the column was // then — the pointer only ever reports a position, not a distance moved. const grip = useRef<{ x: number; w: number } | null>(null); @@ -1060,14 +1060,17 @@ export function Library() { onContextMenu={(e) => { if (e.target !== e.currentTarget) return; e.preventDefault(); - setMenu({ folder: null, x: Math.min(e.clientX, window.innerWidth - 190), y: Math.min(e.clientY, window.innerHeight - 96) }); + setMenu({ folder: null, x: Math.min(e.clientX, window.innerWidth - 150), y: Math.min(e.clientY, window.innerHeight - 150) }); }} > {rows.map((n) => { const folder = folders.find((f) => f.name === n.key.split('/')[0]) ?? null; - // A roll being read says so on its own row: while a scan runs - // the toolbar's progress line is nowhere near the eye. - const scanning = !!folder && live?.folder === folder.name; + // The row being read says so, and no other: a roll is read + // from one folder down, and every row of that roll spinning + // is a tree that says all of itself is being read when one + // branch of it is. The row is the folder the reading was + // kept to, which for a whole roll is the roll's own row. + const scanning = !!folder && live?.folder === folder.name && relOf(n.key) === live.progress.from; const under = parents.has(n.key); return ( - + {/* A roll being read has one thing to be asked of it — that it + stop — where a roll at rest has the reading that brings it up + to date; the two never both apply, so the menu carries the one + the row is actually in. */} + {live?.folder === menu.folder.name ? ( + + ) : ( + + )} + {/* A row with folders under it is a row that folds, and the branch + it holds goes with it: a reader who is done with a tree means + the whole of it shut, not the one row they happened to point + at with its children left open underneath. */} + {menu.node && parents.has(menu.node) ? ( + + ) : null}