Side panels: finger-sized rows and controls on desktop too (one layout, as OsmAnd); track and folder actions (edit, download, delete) behind one ⋯ menu
This commit is contained in:
1 parent
cc833d5793
commit
3f4b30d737
2 files changed
+44
-59
No files matched your search
+26
-31
@@ -1069,12 +1069,10 @@ body.side-pinned:has(.basemap-panel:not([hidden]), .gpx-panel:not([hidden])) .pr
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
@media (pointer: coarse) {
|
||||
.gpx-tree summary::before {
|
||||
width: 36px;
|
||||
height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.gpx-tree summary::before {
|
||||
width: 36px;
|
||||
height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.gpx-tree__folder-row {
|
||||
@@ -1829,16 +1827,14 @@ body.side-pinned:has(.basemap-panel:not([hidden]), .gpx-panel:not([hidden])) .pr
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@media (pointer: coarse) {
|
||||
.notes-panel__color {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.notes-panel__color {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.notes-panel__format button {
|
||||
min-width: 44px;
|
||||
height: 36px;
|
||||
}
|
||||
.notes-panel__format button {
|
||||
min-width: 44px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
/* The pending-note marker shown on the map while the save form is open —
|
||||
@@ -3178,22 +3174,21 @@ html.night .maplibregl-marker {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Touch screens (tablet in the car, phone): every row and control in the
|
||||
side panels (Overlays, Tracks & Points, base map, route, …) and the
|
||||
sidebar menus gets a finger-sized target, ~44 px as Apple/Material
|
||||
recommend. Desktop (fine pointer) keeps the compact lists. */
|
||||
@media (pointer: coarse) {
|
||||
:is(.basemap-panel, .gpx-panel, .sidebar-flyout) :is(label, summary, button, select, .overlays-panel__row, .gpx-tree__point, .gpx-tree__file) {
|
||||
min-height: 44px;
|
||||
}
|
||||
/* Finger-sized (~44 px, Apple/Material) rows and controls in the side
|
||||
panels (Overlays, Tracks & Points, base map, route, …) and the sidebar
|
||||
menus — on desktop too, as OsmAnd does: one layout for the tablet in the
|
||||
car and the mouse, actions behind a ⋯ menu rather than a row of small
|
||||
buttons. */
|
||||
:is(.basemap-panel, .gpx-panel, .sidebar-flyout) :is(label, summary, button, select, .overlays-panel__row, .gpx-tree__point, .gpx-tree__file) {
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
:is(.basemap-panel, .gpx-panel, .sidebar-flyout) :is(button, select) {
|
||||
min-width: 44px;
|
||||
}
|
||||
:is(.basemap-panel, .gpx-panel, .sidebar-flyout) :is(button, select) {
|
||||
min-width: 44px;
|
||||
}
|
||||
|
||||
:is(.basemap-panel, .gpx-panel) input:is([type="checkbox"], [type="radio"]) {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
:is(.basemap-panel, .gpx-panel) input:is([type="checkbox"], [type="radio"]) {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
+18
-28
@@ -346,12 +346,12 @@ export class GpxPanelControl {
|
||||
row.appendChild(name);
|
||||
if (isLoggedIn()) {
|
||||
row.appendChild(
|
||||
this._menuButton("⋯", "Edit", [
|
||||
this._menuButton("⋯", "Actions", [
|
||||
{ label: "Rename…", run: () => this._renameFolder(folder) },
|
||||
...this._exportEntries(folder.path, folder.name),
|
||||
{ label: "Delete…", run: () => this._deleteFolder(folder.path) },
|
||||
]),
|
||||
);
|
||||
row.appendChild(this._deleteButton(() => this._deleteFolder(folder.path)));
|
||||
// Dragged onto another folder (or the tree's blank space) moves it.
|
||||
summary.draggable = true;
|
||||
summary.addEventListener("dragstart", (event) => {
|
||||
@@ -400,14 +400,9 @@ export class GpxPanelControl {
|
||||
if (checkbox.checked) this._zoomTo(file.path);
|
||||
});
|
||||
row.appendChild(label);
|
||||
// Delete/download require login (app.rb); shown only once logged in
|
||||
// rather than shown-but-failing-on-click.
|
||||
if (loggedIn) {
|
||||
row.appendChild(this._downloadButton(file));
|
||||
// A folder's "Points (N)" node has no name or color of its own.
|
||||
if (file.path.startsWith("item:")) row.appendChild(this._editButton(file));
|
||||
row.appendChild(this._deleteButton(() => this._deleteFile(file)));
|
||||
}
|
||||
// Every action behind one ⋯ menu (as OsmAnd does), shown only once
|
||||
// logged in: they all require login (app.rb).
|
||||
if (loggedIn) row.appendChild(this._fileMenu(file));
|
||||
|
||||
return row;
|
||||
}
|
||||
@@ -428,30 +423,25 @@ export class GpxPanelControl {
|
||||
return icon;
|
||||
}
|
||||
|
||||
// One button, one obvious place for both download kinds — clicking it
|
||||
// opens a small menu (Original / GeoJSON) instead of splitting them
|
||||
// across two differently-shaped click targets.
|
||||
_downloadButton(file) {
|
||||
_fileMenu(file) {
|
||||
const geojsonUrl = `${gpxFileUrl(file.path)}?${new URLSearchParams({ download: "geojson", name: file.name })}`;
|
||||
return this._menuButton(DOWNLOAD_ICON, "Download", [
|
||||
// A folder's "Points (N)" node has no name or color of its own.
|
||||
const item = file.path.startsWith("item:");
|
||||
return this._menuButton("⋯", "Actions", [
|
||||
item && { label: "Rename…", run: () => this._renameFile(file) },
|
||||
item && { label: "Color…", run: () => this._pickColor(file) },
|
||||
item && file.color && { label: "Default color", run: () => this._patchNode(file.path, { color: "" }) },
|
||||
item && file.layer && { label: "Split into items", run: () => this._splitLayer(file) },
|
||||
item && (file.kinds || []).includes("route") && { label: "Edit route", run: () => this._editRoute(file) },
|
||||
// A folder's loose points have no single file they came from.
|
||||
file.original && { label: "Original file", run: () => this._download(`${gpxFileUrl(file.path)}?download=original`, file.name) },
|
||||
{ label: "GeoJSON", run: () => this._download(geojsonUrl, `${file.name}.geojson`) },
|
||||
file.original && { label: "Download original file", run: () => this._download(`${gpxFileUrl(file.path)}?download=original`, file.name) },
|
||||
{ label: "Download GeoJSON", run: () => this._download(geojsonUrl, `${file.name}.geojson`) },
|
||||
// A course for a Garmin/Wahoo device to follow.
|
||||
file.kinds?.some((kind) => kind === "track" || kind === "route") && {
|
||||
label: "FIT course (Garmin, Wahoo)",
|
||||
label: "Download FIT course (Garmin, Wahoo)",
|
||||
run: () => this._download(`${gpxFileUrl(file.path)}?${new URLSearchParams({ download: "fit", name: file.name })}`, `${file.name}.fit`),
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
_editButton(file) {
|
||||
return this._menuButton("⋯", "Edit", [
|
||||
{ label: "Rename…", run: () => this._renameFile(file) },
|
||||
{ label: "Color…", run: () => this._pickColor(file) },
|
||||
file.color && { label: "Default color", run: () => this._patchNode(file.path, { color: "" }) },
|
||||
file.layer && { label: "Split into items", run: () => this._splitLayer(file) },
|
||||
(file.kinds || []).includes("route") && { label: "Edit route", run: () => this._editRoute(file) },
|
||||
{ label: "Delete…", run: () => this._deleteFile(file) },
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user