fix(library): resolve root folder rename, open in explorer, open at location centering, UPDATE rescan bug, and optimize scan RAM memory usage
This commit is contained in:
@@ -2094,18 +2094,20 @@ function Catalogue() {
|
||||
{menu.folder ? (
|
||||
ready.has(menu.folder.name) ? (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
className="lib-menu-item"
|
||||
data-key={`lib-rename-${menu.folder.name}`}
|
||||
onClick={() => {
|
||||
setMenu(null);
|
||||
void rename(menu.folder!);
|
||||
}}
|
||||
>
|
||||
<span className="lib-menu-icon" aria-hidden="true">✎</span>
|
||||
{t('lib.rename')}
|
||||
</button>
|
||||
{!menu.root ? (
|
||||
<button
|
||||
type="button"
|
||||
className="lib-menu-item"
|
||||
data-key={`lib-rename-${menu.folder.name}`}
|
||||
onClick={() => {
|
||||
setMenu(null);
|
||||
void rename(menu.folder!);
|
||||
}}
|
||||
>
|
||||
<span className="lib-menu-icon" aria-hidden="true">✎</span>
|
||||
{t('lib.rename')}
|
||||
</button>
|
||||
) : null}
|
||||
{/* Three things can be asked of a roll: bring it up to date, read it
|
||||
from the top again, or leave it — and the last only of the
|
||||
reading that is this roll's, or of the request for it that is
|
||||
@@ -2271,11 +2273,19 @@ function Catalogue() {
|
||||
const folderPath = photo.dir ? `${photo.folder}/${photo.dir}` : photo.folder;
|
||||
const fullPath = `${folderPath}/${photo.name}`;
|
||||
try {
|
||||
const res = await api.openExplorer(fullPath).catch(() => null);
|
||||
if (res?.ok) {
|
||||
setNote(t('lib.scanned', { folder: fullPath, added: 0, total: 1 }));
|
||||
} else if (navigator.clipboard) {
|
||||
await navigator.clipboard.writeText(fullPath);
|
||||
setNote(t('lib.copiedPath', { path: fullPath }));
|
||||
}
|
||||
} catch {
|
||||
if (navigator.clipboard) {
|
||||
await navigator.clipboard.writeText(fullPath);
|
||||
setNote(t('lib.copiedPath', { path: fullPath }));
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<span className="lib-menu-icon" aria-hidden="true">📁</span>
|
||||
@@ -2300,6 +2310,14 @@ function Catalogue() {
|
||||
}
|
||||
return next;
|
||||
});
|
||||
setTimeout(() => {
|
||||
const el = document.querySelector(`[data-key="lib-folder-${targetNode}"]`) || document.querySelector(`[data-key="lib-folder-${photo.folder}"]`);
|
||||
if (el) {
|
||||
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
el.classList.add('lib-folder-highlight');
|
||||
setTimeout(() => el.classList.remove('lib-folder-highlight'), 2000);
|
||||
}
|
||||
}, 120);
|
||||
}}
|
||||
>
|
||||
<span className="lib-menu-icon" aria-hidden="true">🎯</span>
|
||||
@@ -2385,7 +2403,7 @@ function TileImg({ src, rot, onPick, title }: { src: string; rot: number; onPick
|
||||
|
||||
// One object URL per tile, made when the row does and dropped with it: a folder
|
||||
const globalThumbUrls = new Map<string, { url: string; blob: Blob }>();
|
||||
const GLOBAL_URL_MAX = 2500;
|
||||
const GLOBAL_URL_MAX = 600;
|
||||
|
||||
function cacheObjectUrl(id: string, blob: Blob): string {
|
||||
const existing = globalThumbUrls.get(id);
|
||||
|
||||
Reference in New Issue
Block a user