web: the mark of a reading follows the folder the walk stands in, and the head of the tree never wears it
The mark was pinned to the folder a reading was kept to, which is a fine thing to say and no use at all to look at: a reading kept to the roll is kept to the roll for the whole of an afternoon, so the one row that said anything said the same word from the first frame to the last while the walk went through every folder under it. The reader asking which folder is being read was told, in answer, which folder they had asked about. A reading is where it is, not where it was pointed, and where it is is a thing only the reading knows — so the walk now tells it. The frame in hand names the folder it sits in, and the progress carried to the screen says so with the rest, which is where the column reads it. The mark is a way down and not a single row: the folder being read says so, and so does every folder above it. That is what keeps a reading visible under a branch folded shut — the row doing the work is the row the fold takes away, and the rows above it are all a reader would have left. Two rows say the same thing and no more, which is the point: the eye follows the marks down to the work. The head of the tree is never one of them, and this is the rule that survives from the last reading of the question. A roll is the head of everything under it, and a head marked while one folder below it is read says the whole of the tree is being read — an answer that is both loud and false, and worse than the silence it replaced. So the mark stops one row short of the top. The one case left bare is a reading whose frames sit in the roll's own folder and nowhere else: there is no row between the work and the head, and a flat roll is a roll in which the toolbar's line, which names the count, is the whole of what there is to say.
This commit is contained in:
@@ -1065,20 +1065,20 @@ export function Library() {
|
||||
>
|
||||
{rows.map((n) => {
|
||||
const folder = folders.find((f) => f.name === n.key.split('/')[0]) ?? null;
|
||||
// The rows that say a reading is under way are the folder it
|
||||
// was kept to and every folder above it on the way down, and
|
||||
// never a folder under it, which the reading has not reached.
|
||||
// Depth is why: a branch folded shut hides the row being read,
|
||||
// and the rows above it are what keeps the work in sight while
|
||||
// the folder doing it is out of sight. The roll's own row is
|
||||
// the exception, and says so only when the roll itself is what
|
||||
// is being read — a roll asked to speak for one branch of
|
||||
// itself tells the reader the whole of it is being read, which
|
||||
// is the one answer a deep tree cannot afford.
|
||||
// The row that says a reading is under way is the folder the
|
||||
// reading stands in — not the folder it was pointed at, which
|
||||
// would be the same row for the whole of an afternoon while
|
||||
// the work went on somewhere the reader cannot see — together
|
||||
// with every folder above it, so a branch folded shut still
|
||||
// shows the work going on under it. The roll's own row is
|
||||
// never one of them: it is the head of everything below it,
|
||||
// and a head that says all of a tree is being read says
|
||||
// nothing about the folder the reading is actually in. The
|
||||
// frames that sit in the roll's own folder are the one case
|
||||
// left bare, and the toolbar's line is what carries them.
|
||||
const dir = relOf(n.key);
|
||||
const from: string | null = live && live.folder === folder?.name ? live.progress.from : null;
|
||||
const scanning =
|
||||
dir !== null && from !== null && (dir === '' ? from === '' : dir === from || from.startsWith(dir));
|
||||
const at = live && live.folder === folder?.name && live.progress.at ? `${live.progress.at}/` : null;
|
||||
const scanning = dir !== null && dir !== '' && at !== null && (dir === at || at.startsWith(dir));
|
||||
const under = parents.has(n.key);
|
||||
return (
|
||||
<button
|
||||
|
||||
@@ -360,6 +360,15 @@ export interface ScanProgress {
|
||||
// column draws them while the frames under them are still being read. Not
|
||||
// filed away — a folder name is worth nothing once the scan it came from ends.
|
||||
dirs: LibraryDir[];
|
||||
// The folder the reading is standing in at this moment, spelled the way the
|
||||
// walk spells a path, `''` for the frames that sit in the picked folder
|
||||
// itself. A reading is where it is and not where it was pointed: a roll is
|
||||
// walked layer by layer through every folder under it, and a column that
|
||||
// marked the folder the reading was asked for would mark one row for the
|
||||
// whole of an afternoon while the work went on somewhere the reader cannot
|
||||
// see. Where the reading is is a thing only the reading knows, so it is told
|
||||
// and not worked out.
|
||||
at: string;
|
||||
}
|
||||
|
||||
// Walk the folder, keep what is new or changed, and leave the rest alone: a
|
||||
@@ -554,6 +563,7 @@ export async function scanFolder(
|
||||
written: 0,
|
||||
dirs: [],
|
||||
counts: {},
|
||||
at: '',
|
||||
};
|
||||
progress.folder = folder.name;
|
||||
// Which folder the reading was pointed at, for the same reason the name is:
|
||||
@@ -561,8 +571,10 @@ export async function scanFolder(
|
||||
// reading kept to one folder has to say so to a column that would otherwise
|
||||
// draw its counts over the whole roll.
|
||||
progress.from = from;
|
||||
// A position written down by an older visit has no count to carry on from.
|
||||
// A position written down by an older visit has no count to carry on from, and
|
||||
// no folder to say it is in until the first frame is in hand again.
|
||||
progress.written ??= 0;
|
||||
progress.at ??= '';
|
||||
const found = new Set(progress.dirs.map((d) => d.id));
|
||||
const counts: Record<string, number> = progress.counts;
|
||||
// Count the frame the moment the scan gets to it, before it knows whether the
|
||||
@@ -759,6 +771,11 @@ export async function scanFolder(
|
||||
}
|
||||
const { handle, rel } = entries.shift()!;
|
||||
inHand.push(rel);
|
||||
// The frame in hand names the folder the reading is standing in, and the
|
||||
// queue is filled layer by layer, so this is the column's answer to which
|
||||
// folder is being read while it is being read.
|
||||
const at = rel.lastIndexOf('/');
|
||||
progress.at = at < 0 ? '' : rel.slice(0, at);
|
||||
// A frame a reload handed back that was counted already is read without
|
||||
// being counted twice; the ones behind it are frames that reading found and
|
||||
// never reached, and they are counted here as they are reached.
|
||||
@@ -1035,7 +1052,7 @@ export function startScan(folder: LibraryFolder, from = ''): Promise<ScanProgres
|
||||
if (live) return Promise.reject(new Error('a scan is already running'));
|
||||
const session: ScanSession = {
|
||||
folder: folder.name,
|
||||
progress: { folder: folder.name, from, total: 0, done: 0, added: 0, written: 0, dirs: [], counts: {} },
|
||||
progress: { folder: folder.name, from, total: 0, done: 0, added: 0, written: 0, dirs: [], counts: {}, at: '' },
|
||||
stop: false,
|
||||
jump: null,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user