Skip to content

Build your personal knowledge base with Trilium Notes

fix(client): let a tall GPX preview scroll, as the office preview does

Elian Doranabdb6bf6eb30
diff --git a/apps/client/src/widgets/type_widgets/File.css b/apps/client/src/widgets/type_widgets/File.css
index 529cac6272..c3303032cb 100644
--- a/apps/client/src/widgets/type_widgets/File.css
+++ b/apps/client/src/widgets/type_widgets/File.css
@@ -43,8 +43,10 @@ pre.file-preview-content:not(.hljs) {
/* base .office-preview-body / .office-preview-loading styles live in content_renderer.css.
The unpadded wrapper is the scroll host (like .scrolling-container for text notes):
- the scrollbar hugs the split edge and the body's padding scrolls with the document. */
-.note-detail-file:has(> .office-preview-body) {
+ the scrollbar hugs the split edge and the body's padding scrolls with the document.
+ The GPX preview needs the same: a file note is full-height, so nothing above scrolls for it. */
+.note-detail-file:has(> .office-preview-body),
+.note-detail-file:has(> .gpx-preview) {
overflow: auto;
padding: 0;
}
diff --git a/apps/client/src/widgets/type_widgets/file/GpxPreview.css b/apps/client/src/widgets/type_widgets/file/GpxPreview.css
index 1955d3ce26..fdd913e68d 100644
--- a/apps/client/src/widgets/type_widgets/file/GpxPreview.css
+++ b/apps/client/src/widgets/type_widgets/file/GpxPreview.css
@@ -1,5 +1,8 @@
.gpx-preview {
max-width: 1000px;
+ /* Its own padding rather than the wrapper's: the wrapper is the unpadded scroll host (see
+ File.css), so the scrollbar hugs the split edge and this padding scrolls with the content. */
+ padding: 10px;
.gpx-preview-name {
margin: 0 0 4px;