This commit is contained in:
2025-10-29 10:42:44 +01:00
parent 4d30c4c58f
commit 2de3dc30bf
2 changed files with 43 additions and 1 deletions
+42
View File
@@ -4842,6 +4842,48 @@ const AppLayout = () => {
return ordered;
}, [selectionOrder, documentLookup, selectedDocumentIds]);
const lastScrolledDetailDocRef = useRef(null);
useEffect(() => {
if (!orderedSelectedDocuments.length) {
lastScrolledDetailDocRef.current = null;
return;
}
let lastSelectedId = null;
for (let index = selectionOrder.length - 1; index >= 0; index -= 1) {
const key = selectionOrder[index];
if (isDocumentRowKey(key)) {
lastSelectedId = getRowId(key);
if (lastSelectedId) {
break;
}
}
}
if (!lastSelectedId && orderedSelectedDocuments.length) {
const fallbackDoc = orderedSelectedDocuments[orderedSelectedDocuments.length - 1];
lastSelectedId = fallbackDoc?.id || null;
}
if (!lastSelectedId || lastScrolledDetailDocRef.current === lastSelectedId) {
return;
}
const targetElement =
document.getElementById(`document-row-${lastSelectedId}`) ||
document.getElementById(`document-card-${lastSelectedId}`);
if (!targetElement) {
return;
}
lastScrolledDetailDocRef.current = lastSelectedId;
requestAnimationFrame(() => {
targetElement.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
});
}, [orderedSelectedDocuments, selectionOrder, documentsViewMode]);
const { breadcrumbs, missingBreadcrumbAncestors } = useMemo(() => {
const chain = [];
const seen = new Set();
+1 -1
View File
@@ -1805,7 +1805,7 @@ button.danger:hover:not([disabled]) {
}
.document-card.selected .document-thumbnail-wrapper {
background-color: var(--accent-soft);
background-color: var(--selection-soft);
}
.document-card:hover .document-thumbnail-wrapper,