-
-
Notifications
You must be signed in to change notification settings - Fork 656
feat(processing): make the Whitebox toolbox a floating panel #1226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
30788f0
8be4d28
dc8d8c1
89ced12
ce3684f
75396aa
a491f8d
2921142
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,14 +55,18 @@ export function ProcessingMenu({ | |
| const setAssistantOpen = useAppStore((s) => s.setAssistantOpen); | ||
| const setDashboardOpen = useAppStore((s) => s.setDashboardOpen); | ||
|
|
||
| // Whitebox, format Conversion, Raster tools, and AI Segmentation all require | ||
| // the Python sidecar, which cannot run on Android/iOS — hide them on mobile so | ||
| // they don't present and then fail. Vector (Turf), SQL (PGlite/DuckDB), Python | ||
| // (Pyodide), geocode, statistics, and the assistant run client-side and stay. | ||
| // The user agent is stable for the session, so evaluate once. | ||
| // Format Conversion, Raster tools, and AI Segmentation require the Python | ||
| // sidecar, which cannot run on Android/iOS — hide them on mobile so they don't | ||
| // present and then fail. Vector (Turf), SQL (PGlite/DuckDB), Python (Pyodide), | ||
| // geocode, statistics, and the assistant run client-side and stay. The user | ||
| // agent is stable for the session, so evaluate once. | ||
| const mobile = useMemo(() => isMobile(), []); | ||
| const uiProfile = useDesktopSettingsStore((s) => s.desktopSettings.uiProfile); | ||
| const show = (id: string) => isMenuItemVisible(uiProfile, id); | ||
| // The Whitebox toolbox (and its WASI/GeoLibre tool catalog) runs entirely in | ||
| // the browser via WebAssembly, so unlike the sidecar-backed tools it stays | ||
| // available on mobile. | ||
| const showWhitebox = show("processing.whitebox"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug (medium confidence): Removing the Suggest defaulting |
||
|
|
||
| // Open the Whitebox toolbox dialog preselected to a specific tool, used by the | ||
| // per-category submenus below. Two store writes: queue the tool, then open. | ||
|
|
@@ -118,17 +122,16 @@ export function ProcessingMenu({ | |
| <DropdownMenuSeparator /> | ||
| </> | ||
| )} | ||
| {!mobile && show("processing.whitebox") && ( | ||
| {showWhitebox && ( | ||
| <DropdownMenuItem onSelect={() => setProcessingOpen(true)}> | ||
| {t("toolbar.item.whitebox")} | ||
| </DropdownMenuItem> | ||
| )} | ||
| {/* Whitebox tools grouped by category/subcategory. Each leaf opens the | ||
| Whitebox toolbox dialog preselected to that tool. Catalog data lives | ||
| in lib/whitebox-menu-catalog.ts; gated with the Whitebox item since | ||
| they share the same sidecar/WASM backend (hidden on mobile). */} | ||
| {!mobile && | ||
| show("processing.whitebox") && | ||
| in lib/whitebox-menu-catalog.ts; gated with the Whitebox item, which | ||
| runs in the browser via WebAssembly (so available on mobile too). */} | ||
| {showWhitebox && | ||
| WHITEBOX_MENU_CATALOG.map((cat) => ( | ||
| <DropdownMenuSub key={cat.key}> | ||
| <DropdownMenuSubTrigger>{t(cat.labelKey)}</DropdownMenuSubTrigger> | ||
|
|
@@ -512,7 +515,7 @@ export function ProcessingMenu({ | |
| )} | ||
| {/* Divide the tool-category submenus (Whitebox, GeoLibre) from the | ||
| workspaces and consoles below. Only when both sides are present. */} | ||
| {((!mobile && show("processing.whitebox")) || showGeolibre) && | ||
| {(showWhitebox || showGeolibre) && | ||
| showWorkspacesOrServices && <DropdownMenuSeparator />} | ||
| {show("processing.sqlWorkspace") && ( | ||
| <DropdownMenuItem onSelect={() => setSqlWorkspaceOpen(true)}> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug (medium-high confidence): Making the Whitebox toolbox reachable on mobile exposes a case
ProcessingDialog.tsxdoesn't handle: itsdesktopflag is justisTauri()(ProcessingDialog.tsx:446), which is alsotrueinside a Tauri Android/iOS webview — peris-mobile.ts's own comment, "the Tauri Android webview reports an Android UA."Every other sidecar-backed dialog (Conversion, Raster, Segmentation) avoids this because it stays behind
!mobile && show(...)here, so it's never opened on mobile at all. Whitebox is now the one exception, butProcessingDialog'srunLocalstill defaults to!desktop(i.e.false, sidecar mode) on a mobile Tauri build, and its "Start server" button is gated only ondesktop, not!mobile— so a mobile Tauri user opening this dialog lands in sidecar mode by default with a "Start server" button that callsstartGeoLibreSidecar(), which cannot succeed on Android/iOS. They'd have to discover and manually check "Run locally" to get a working WASM tool.Worth defaulting
runLocal/gating the server buttons offdesktop && !mobileinstead ofdesktopalone.