Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions apps/geolibre-desktop/src/components/layout/DesktopShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@
disposed = true;
unlisten?.();
};
}, [

Check warning on line 1710 in apps/geolibre-desktop/src/components/layout/DesktopShell.tsx

View workflow job for this annotation

GitHub Actions / Build and test

React Hook useEffect has a missing dependency: 't'. Either include it or remove the dependency array
clearDropMessageLater,
finishDrop,
addDroppedRasters,
Expand Down Expand Up @@ -1855,7 +1855,7 @@
clearDropMessageLater();
}
},
[

Check warning on line 1858 in apps/geolibre-desktop/src/components/layout/DesktopShell.tsx

View workflow job for this annotation

GitHub Actions / Build and test

React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array
clearDropMessageLater,
finishDrop,
addDroppedRasters,
Expand Down Expand Up @@ -2227,7 +2227,9 @@
// On a phone-width viewport both start collapsed (panels overlay
// there), matching the mobile "panels default collapsed" behavior.
initialBuiltinExpanded={
replaceLayersPanelId === BROWSER_PANEL_ID && !getIsMobileViewport()
replaceLayersPanelId === BROWSER_PANEL_ID &&
!getIsMobileViewport() &&
!layoutOptions.panelsCollapsed
}
// The story-map presentation is the only standalone Layers
// autoCollapse trigger (the notebook collapses Style, not Layers).
Expand Down Expand Up @@ -2267,7 +2269,11 @@
openRasterLayerPanel(createAppAPI(mapControllerRef))
}
onOpenRasterSubset={setRasterSubsetLayer}
autoCollapse={storymapPresenting || autoCollapsedPanel === "layers"}
autoCollapse={
storymapPresenting ||
layoutOptions.panelsCollapsed ||
autoCollapsedPanel === "layers"
}
/>
)}
</SectionErrorBoundary>
Expand Down Expand Up @@ -2508,7 +2514,10 @@
mapControllerRef={mapControllerRef}
onResizeStart={startStylePanelResize}
autoCollapse={
notebookOpen || storymapPresenting || autoCollapsedPanel === "style"
notebookOpen ||
storymapPresenting ||
layoutOptions.panelsCollapsed ||
autoCollapsedPanel === "style"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
/>
</SectionErrorBoundary>
Expand Down
5 changes: 5 additions & 0 deletions apps/geolibre-desktop/src/hooks/useLayoutOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export interface LayoutOptions {
* shared rail — so a map-only embed shows nothing but the map.
*/
panelsHidden: boolean;
/** Start the Layers and Style panels on their rails without hiding them. */
panelsCollapsed: boolean;
showProjectInfo: boolean;
statusBarVisible: boolean;
stylePanelVisible: boolean;
Expand Down Expand Up @@ -41,6 +43,7 @@ export function layoutOptionsFromLocation(layoutSettings: DesktopLayoutSettings)
attributePanelVisible: true,
compact: false,
panelsHidden: false,
panelsCollapsed: false,
statusBarVisible: true,
toolbarVisible: true,
viewer: false,
Expand All @@ -67,6 +70,7 @@ export function layoutOptionsFromLocation(layoutSettings: DesktopLayoutSettings)
mapOnly ||
HIDDEN_PANEL_VALUES.has(panels) ||
normalizedParam(params.get("hidePanels")) === "true";
const panelsCollapsed = !panelsHidden && panels === "collapsed";
const toolbarLabels =
!compact && !ICON_TOOLBAR_VALUES.has(toolbar) ? layoutSettings.toolbarLabels : false;
const showProjectInfo = compact ? false : layoutSettings.showProjectInfo;
Expand All @@ -82,6 +86,7 @@ export function layoutOptionsFromLocation(layoutSettings: DesktopLayoutSettings)
compact,
layerPanelVisible,
panelsHidden,
panelsCollapsed,
showProjectInfo,
statusBarVisible: !mapOnly,
stylePanelVisible,
Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ https://web.geolibre.app/?url=https://share.geolibre.app/giswqs/3d-tiles.geolibr

Use `toolbar=icons` when you only want icon-only toolbar buttons. `panels=hidden`, `panels=hide`, `panels=off`, and `hidePanels=true` are accepted aliases for hiding panels.

Use `panels=collapsed` to keep the Layers and Style icon rails visible while
starting both panels collapsed.

For a fully chrome-free, map-only embed, add `&maponly` to hide the toolbar menu, all panels, and the status bar:

```text
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ A chrome-free `maponly` embed shows only the map, as in this shared 3D Tiles pro
| `url` | `url=https://share.geolibre.app/you/project.geolibre.json` | Loads a `.geolibre.json` project from a public URL. |
| `layout` | `layout=viewer` | `viewer` provides read-only chrome: Layers, View, Controls, basemaps, search/identify, and Help, with authoring UI hidden. `compact` is the icon-only full-app layout; `embed` and `iframe` are aliases. |
| `toolbar` | `toolbar=icons` | Icon-only toolbar buttons without the full compact layout. `icon` and `icon-only` are aliases. |
| `panels` | `panels=none` | Hides the Layers, Style, and Attribute table panels. `hidden`, `hide`, and `off` are aliases. |
| `panels` | `panels=collapsed` | Starts Layers and Style collapsed to their icon rails. Use `none` to hide all panels; `hidden`, `hide`, and `off` are aliases. |
| `hidePanels` | `hidePanels=true` | Alternative way to hide those panels. |
| `maponly` | `maponly` | Hides all chrome (toolbar, panels, and status bar), leaving only the map. The bare flag or `true`, `1`, `yes`, `on` enable it. |
| `welcome` | `welcome=0` | Hides the first-launch welcome wizard. Accepts `0`, `false`, `off`, or `no`. A `url=` deep link already suppresses it automatically. |
Expand Down
12 changes: 12 additions & 0 deletions tests/layout-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe("layoutOptionsFromLocation", () => {
assert.equal(options.stylePanelVisible, true);
assert.equal(options.attributePanelVisible, true);
assert.equal(options.panelsHidden, false);
assert.equal(options.panelsCollapsed, false);
});

it("hides every chrome element when maponly is set as a bare flag", () => {
Expand Down Expand Up @@ -88,6 +89,17 @@ describe("layoutOptionsFromLocation", () => {
assert.equal(options.panelsHidden, true);
});

it("starts side panels collapsed without hiding their rails", () => {
withSearch("?panels=collapsed");
const options = layoutOptionsFromLocation(DEFAULT_DESKTOP_LAYOUT_SETTINGS);
assert.equal(options.toolbarVisible, true);
assert.equal(options.layerPanelVisible, true);
assert.equal(options.stylePanelVisible, true);
assert.equal(options.attributePanelVisible, true);
assert.equal(options.panelsHidden, false);
assert.equal(options.panelsCollapsed, true);
});

it("provides read-only viewer chrome between the full app and maponly", () => {
withSearch("?layout=viewer");
const options = layoutOptionsFromLocation(DEFAULT_DESKTOP_LAYOUT_SETTINGS);
Expand Down
Loading