Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
style(client): fold a GPX file's name into a byline, not a second title
Elian Doranbcec650200d3
diff --git a/apps/client/src/widgets/type_widgets/file/GpxPreview.css b/apps/client/src/widgets/type_widgets/file/GpxPreview.cssindex fd5659a7c1..f8e99f2a3c 100644--- a/apps/client/src/widgets/type_widgets/file/GpxPreview.css+++ b/apps/client/src/widgets/type_widgets/file/GpxPreview.css@@ -4,15 +4,23 @@File.css), so the scrollbar hugs the split edge and this padding scrolls with the content. */padding: 10px;+ .gpx-preview-byline {+ margin-bottom: 12px;+ }+.gpx-preview-name {- margin: 0 0 4px;+ font-weight: 600;}.gpx-preview-description {- margin: 0 0 12px;color: var(--muted-text-color);}+ /* Only between the two — a lone name or a lone description stands unpunctuated. */+ .gpx-preview-name + .gpx-preview-description::before {+ content: " · ";+ }+.gpx-preview-stats {display: grid;grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));diff --git a/apps/client/src/widgets/type_widgets/file/GpxPreview.tsx b/apps/client/src/widgets/type_widgets/file/GpxPreview.tsxindex 3421a95338..300a0aa927 100644--- a/apps/client/src/widgets/type_widgets/file/GpxPreview.tsx+++ b/apps/client/src/widgets/type_widgets/file/GpxPreview.tsx@@ -61,10 +61,18 @@ export default function GpxPreview({ note, blob }: GpxPreviewProps) {const tiles = buildTiles(stats, system);const trackColor = note.getLabelValue("color");+ // The file's internal name is metadata, not a second title — the note's own title already+ // heads the window — so it and the description share one quiet byline above the tiles.+ const bylineName = stats.name !== note.title ? stats.name : undefined;+return (<div className="gpx-preview selectable-text">- {stats.name && stats.name !== note.title && <h4 className="gpx-preview-name">{stats.name}</h4>}- {stats.description && <p className="gpx-preview-description">{stats.description}</p>}+ {(bylineName || stats.description) && (+ <div className="gpx-preview-byline">+ {bylineName && <span className="gpx-preview-name">{bylineName}</span>}+ {stats.description && <span className="gpx-preview-description">{stats.description}</span>}+ </div>+ )}<div className="gpx-preview-stats">{tiles.map(({ label, value }) => (