Add file-kind icons to the GPX tree, fix drop into an empty panel

Each tree entry now shows a small waypoint/track icon based on a
cheap substring check for <wpt>/<trk> (Maptool::Gpx.kinds) rather than
a full REXML parse, since re-parsing a several-thousand-waypoint file
on every tree fetch would make the panel noticeably slower to open.

Also fix a real drop-target bug: .gpx-tree had no flex:1, so a
short/empty tree left blank panel space below it that wasn't part of
the drag & drop target — dropping a file there silently did nothing.
This commit is contained in:
randy committed 2026-08-25 22:38:41 +02:00
1 parent 87df90f75c
commit 06ea8ea141
5 files changed
+58 -3

No files matched your search

+17 -1
View File
@@ -292,6 +292,11 @@ html, body {
}
.gpx-tree {
/* flex:1 (not just overflow-y) so the tree fills the rest of the panel
even when short/empty — otherwise the blank space below it wouldn't
be part of the drop target and dropping a file there would silently
do nothing. */
flex: 1;
overflow-y: auto;
padding: 8px 12px;
}
@@ -342,12 +347,23 @@ html, body {
cursor: pointer;
}
.gpx-tree__file label span {
.gpx-tree__file-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.gpx-tree__kind-icon {
flex-shrink: 0;
display: flex;
color: #999;
}
.gpx-tree__kind-icon svg {
width: 14px;
height: 14px;
}
.gpx-tree__delete {
flex-shrink: 0;
border: none;