Skip to content

Commit e295525

Browse files
committed
fix(menu): disambiguate the Whitebox catalog's "GeoLibre" subcategory
The Processing menu had two unrelated things named "GeoLibre" in one tree: the Whitebox catalog's provenance subcategory (Processing -> Conversion -> GeoLibre) and the app's own tools submenu (Processing -> GeoLibre). Nothing in either label told them apart, and the nine catalog categories render as bare siblings of the GeoLibre submenu, so the two paths read as mirror images. Two changes, neither adding depth: - Rename the generator's GEOLIBRE_SUBCATEGORY to "GeoLibre (WASM)". The label is a generator constant, not catalog data, and nothing keys off the literal (the subcategory sort ranks against the constant), so this is one line plus a regenerate. "(WASM)" is already the app's user-facing shorthand for the in-browser runtime ("Run locally (WASM)"), so it reads as a runtime note rather than a second product. - Add a "Whitebox" section label above the catalog categories, and a separator between that block and the GeoLibre submenu, so the two sections read as separate owners. The dialog-opening item now uses the existing, already translated "Whitebox toolbox" string so it says what clicking it does. A label rather than a parent submenu: the grouping is worth one muted line, not an extra hover on the way to every tool. Refs #1904
1 parent 579a725 commit e295525

3 files changed

Lines changed: 37 additions & 13 deletions

File tree

apps/geolibre-desktop/src/components/layout/toolbar/ProcessingMenu.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,22 @@ export function ProcessingMenu({
140140
<DropdownMenuSeparator />
141141
</>
142142
)}
143+
{/* Section header for the toolbox block below. Without it nothing in
144+
the menu says the nine category submenus belong to the Whitebox
145+
toolbox — they render as bare siblings of the GeoLibre submenu, so
146+
"Conversion" (toolbox) and "GeoLibre → Conversion" (app dialog) look
147+
like peers (GeoLibre#1904). A label, not a parent submenu: the
148+
grouping is worth one muted line, not an extra hover on the way to
149+
every tool. */}
143150
{showWhitebox && (
144-
<DropdownMenuItem onSelect={() => setProcessingOpen(true)}>
145-
{t("toolbar.item.whitebox")}
146-
</DropdownMenuItem>
151+
<>
152+
<DropdownMenuLabel className="text-xs text-muted-foreground">
153+
{t("toolbar.item.whitebox")}
154+
</DropdownMenuLabel>
155+
<DropdownMenuItem onSelect={() => setProcessingOpen(true)}>
156+
{t("processing.whitebox.toolbox")}
157+
</DropdownMenuItem>
158+
</>
147159
)}
148160
{/* Whitebox tools grouped by category/subcategory. Each leaf opens the
149161
Whitebox toolbox dialog preselected to that tool. Catalog data lives
@@ -178,6 +190,9 @@ export function ProcessingMenu({
178190
</DropdownMenuSubContent>
179191
</DropdownMenuSub>
180192
))}
193+
{/* Divide the toolbox block from GeoLibre's own tools, so the two
194+
sections read as separate owners rather than one flat list. */}
195+
{showWhitebox && showGeolibre && <DropdownMenuSeparator />}
181196
{/* GeoLibre's own tools (Turf vector, rasterio raster, format
182197
conversion, routing, spatial statistics) plus geocoding, batch &
183198
models, and AI segmentation. Grouped under a single "GeoLibre"

apps/geolibre-desktop/src/lib/whitebox-menu-catalog.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Whitebox tools come from the Whitebox Next Gen catalog snapshot
33
// (opengeos/Whitebox-Next-Gen-ArcGIS WNG/data/catalog_snapshot.json);
44
// GeoLibre-authored WASM tools come from the geolibre-wasm manifests and
5-
// are grouped under a "GeoLibre" subheading. Tool ids match the
5+
// are grouped under a "GeoLibre (WASM)" subheading. Tool ids match the
66
// runtime/sidecar/WASM catalog used by ProcessingDialog.
77
// Regenerate with scripts/gen-whitebox-menu-catalog.mjs; do not hand-edit.
88
// Tool/subcategory names are catalog data and are intentionally not
@@ -38,7 +38,7 @@ export const WHITEBOX_MENU_CATALOG: WhiteboxMenuCategory[] = [
3838
labelKey: "toolbar.item.conversion",
3939
subcategories: [
4040
{
41-
label: "GeoLibre",
41+
label: "GeoLibre (WASM)",
4242
tools: [
4343
{ id: "calculate_transit_service_frequency", name: "Calculate Transit Service Frequency" },
4444
{ id: "excel_to_table", name: "Excel To Table" },
@@ -113,7 +113,7 @@ export const WHITEBOX_MENU_CATALOG: WhiteboxMenuCategory[] = [
113113
labelKey: "toolbar.item.hydrology",
114114
subcategories: [
115115
{
116-
label: "GeoLibre",
116+
label: "GeoLibre (WASM)",
117117
tools: [
118118
{ id: "delineate_depressions", name: "Delineate Depressions" },
119119
{ id: "delineate_mounts", name: "Delineate Mounts" },
@@ -259,7 +259,7 @@ export const WHITEBOX_MENU_CATALOG: WhiteboxMenuCategory[] = [
259259
labelKey: "toolbar.item.lidar",
260260
subcategories: [
261261
{
262-
label: "GeoLibre",
262+
label: "GeoLibre (WASM)",
263263
tools: [
264264
{ id: "assign_projection_lidar", name: "Assign Projection Lidar" },
265265
],
@@ -407,7 +407,7 @@ export const WHITEBOX_MENU_CATALOG: WhiteboxMenuCategory[] = [
407407
labelKey: "toolbar.item.raster",
408408
subcategories: [
409409
{
410-
label: "GeoLibre",
410+
label: "GeoLibre (WASM)",
411411
tools: [
412412
{ id: "aggregate_multidimensional_raster", name: "Aggregate Multidimensional Raster" },
413413
{ id: "analyze_changes_ccdc", name: "Analyze Changes Using CCDC" },
@@ -1054,7 +1054,7 @@ export const WHITEBOX_MENU_CATALOG: WhiteboxMenuCategory[] = [
10541054
labelKey: "toolbar.item.vector",
10551055
subcategories: [
10561056
{
1057-
label: "GeoLibre",
1057+
label: "GeoLibre (WASM)",
10581058
tools: [
10591059
{ id: "add_surface_information", name: "Add Surface Information" },
10601060
{ id: "add_z_information", name: "Add Z Information" },

scripts/gen-whitebox-menu-catalog.mjs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ const SNAPSHOT_URL =
2121
// categories (e.g. "Raster") and are not in the Whitebox snapshot, so we group
2222
// them under their own heading within each top-level category instead of mixing
2323
// them into the long "General" list.
24-
const GEOLIBRE_SUBCATEGORY = "GeoLibre";
24+
//
25+
// The "(WASM)" qualifier is load-bearing (GeoLibre#1904): a bare "GeoLibre"
26+
// here collides with the Processing menu's own top-level "GeoLibre" submenu —
27+
// two unrelated things sharing one name in the same menu tree, with nothing in
28+
// the label to tell them apart. "(WASM)" is the app's established user-facing
29+
// shorthand for the in-browser runtime ("Run locally (WASM)"), so it reads as a
30+
// runtime note rather than a second product. Nothing keys off the literal: the
31+
// subcategory sort ranks against this constant, so renaming it is safe.
32+
const GEOLIBRE_SUBCATEGORY = "GeoLibre (WASM)";
2533

2634
const OUT = resolve(
2735
dirname(fileURLToPath(import.meta.url)),
@@ -129,8 +137,9 @@ async function main() {
129137
const geolibre = wasmTools.filter((t) => t.source === "geolibre");
130138
const geolibreIds = new Set(geolibre.map((t) => t.id));
131139
// Whitebox-sourced WASM tools the snapshot has never heard of. They belong in
132-
// the menu under their own category's regular subheading (not the "GeoLibre"
133-
// one — they are not GeoLibre-authored), and they are the reason the menu
140+
// the menu under their own category's regular subheading (not the
141+
// GEOLIBRE_SUBCATEGORY one — they are not GeoLibre-authored), and they are
142+
// the reason the menu
134143
// could list fewer tools than the WASM actually ships.
135144
const snapshotIds = new Set(tools.map((t) => t.id));
136145
const wasmOnly = wasmTools.filter((t) => t.source !== "geolibre" && !snapshotIds.has(t.id));
@@ -189,7 +198,7 @@ async function main() {
189198
L.push("// Whitebox tools come from the Whitebox Next Gen catalog snapshot");
190199
L.push("// (opengeos/Whitebox-Next-Gen-ArcGIS WNG/data/catalog_snapshot.json);");
191200
L.push("// GeoLibre-authored WASM tools come from the geolibre-wasm manifests and");
192-
L.push('// are grouped under a "GeoLibre" subheading. Tool ids match the');
201+
L.push(`// are grouped under a "${GEOLIBRE_SUBCATEGORY}" subheading. Tool ids match the`);
193202
L.push("// runtime/sidecar/WASM catalog used by ProcessingDialog.");
194203
L.push("// Regenerate with scripts/gen-whitebox-menu-catalog.mjs; do not hand-edit.");
195204
L.push("// Tool/subcategory names are catalog data and are intentionally not");

0 commit comments

Comments
 (0)