Skip to content

feat: add a panels=collapsed embed layout option - #1774

Merged
giswqs merged 1 commit into
mainfrom
feat/embed-panels-collapsed
Aug 8, 2026
Merged

feat: add a panels=collapsed embed layout option#1774
giswqs merged 1 commit into
mainfrom
feat/embed-panels-collapsed

Conversation

@giswqs

@giswqs giswqs commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Add panels=collapsed as an embed query option: the Layers and Style icon rails stay visible and reachable, but both panels start collapsed, giving embeds a middle ground between fully open panels and panels=none.
  • Thread the new panelsCollapsed flag from useLayoutOptions into DesktopShell so it feeds the Layers browser initial-expanded state and the Layers/Style autoCollapse inputs.
  • Document the option in the embedding query-parameter table and the docs landing page.

Test plan

  • node --import tsx --test tests/layout-options.test.ts (new case asserts panels=collapsed leaves the panels visible with panelsCollapsed true and panelsHidden false)
  • pre-commit run --files <changed files> (oxfmt, eslint, npm build all pass)
  • Load a web build with ?panels=collapsed and confirm the Layers and Style rails are present with both panels collapsed
  • Confirm panels=none and maponly still hide panels entirely, and no query param still opens panels as before

Summary by CodeRabbit

  • New Features

    • Added support for the panels=collapsed embed option.
    • Layers and Style panels now start collapsed while their icon rails remain visible.
    • Collapsed-panel behavior is applied consistently across shared and standalone sidebars.
    • panels=none continues to hide all panels.
  • Documentation

    • Updated embedding documentation with the new parameter and panel behavior.
  • Tests

    • Added coverage for collapsed and default panel layouts.

Embeds could either show the side panels open or hide them entirely.
This adds a middle ground that keeps the Layers and Style icon rails
reachable while starting both panels collapsed, so an embed can lead
with the map without giving up access to the panels.
Copilot AI lite review requested due to automatic review settings August 8, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The embed layout now supports panels=collapsed. This keeps panel rails visible while initially collapsing Layers and Style. The option parser, desktop shell behavior, documentation, and tests were updated.

Changes

Collapsed panel layout

Layer / File(s) Summary
Layout option parsing and coverage
apps/geolibre-desktop/src/hooks/useLayoutOptions.ts, tests/layout-options.test.ts, docs/index.md, docs/user-guide/embedding.md
Adds panelsCollapsed, parses panels=collapsed, preserves hidden-panel precedence, and documents the parameter.
Desktop panel initialization
apps/geolibre-desktop/src/components/layout/DesktopShell.tsx
Keeps shared Layers collapsed and initializes standalone Layers and Style panels on their rails when panelsCollapsed is enabled.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EmbedURL
  participant useLayoutOptions
  participant DesktopShell
  participant LayersAndStylePanels
  EmbedURL->>useLayoutOptions: panels=collapsed
  useLayoutOptions->>DesktopShell: panelsCollapsed=true, panelsHidden=false
  DesktopShell->>LayersAndStylePanels: initialize panels on icon rails
Loading

Possibly related PRs

Poem

I’m a rabbit with rails in the sun,
Layers and Style now fold when begun.
The panels stay near,
Their icons stay clear,
collapsed makes setup a run! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the new panels=collapsed embed layout option, which is the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/embed-panels-collapsed

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🔍 Cloudflare PR preview

Item Value
Site https://d7520ce6.geolibre-preview.pages.dev
Demo app https://d7520ce6.geolibre-preview.pages.dev/demo/
Commit 5610e1d

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🔍 GitHub Pages PR preview

Item Value
Site https://opengeos.org/pages-preview/GeoLibre/pr-1774/
Demo app https://opengeos.org/pages-preview/GeoLibre/pr-1774/demo/
Commit 5610e1d

Note

GitHub Pages built this preview successfully, but its serving edge returned HTTP 403 when checked. The links may still be propagating.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Code review

Bugs: None found. The new panelsCollapsed flag is threaded correctly through useLayoutOptions and into the standalone LayerPanel/StylePanel autoCollapse props. I specifically checked the trickier shared-rail case (a replace-layers plugin, e.g. the Browser panel, sharing the Layers rail): the initialBuiltinExpanded change correctly makes the built-in Layers panel not auto-expand when panelsCollapsed is true, and since the Browser panel already opens-then-immediately-collapses on mount (useRegisterBrowserPanel.ts), both end up collapsed as intended — no regression there. The Style-side shared rail (replaceStylePanelId) wasn't given the same panelsCollapsed treatment, but that's correct as-is: its built-in panel already defaults to collapsed in SharedSidebar (initialBuiltinExpanded defaults to false), so there was nothing to change.

Security: None found. Purely client-side URL query parsing via existing Set-based normalization; no injection surface.

Performance: None found. Trivial boolean logic, no new renders or effects beyond what already existed for storymapPresenting/autoCollapsedPanel.

Quality: None found. Naming (panelsCollapsed), JSDoc, and formatting match the surrounding conventions (mirrors panelsHidden). Test coverage for the new flag is added and consistent with existing test style.

CLAUDE.md: No relevant guidelines triggered — no i18n strings added, no touched files under the special-mirrored-constant rules, and docs were updated alongside the behavior change as expected.

One minor, non-blocking observation (not filed as an inline comment since it's speculative and out of scope per the PR's stated intent): combining layout=viewer with panels=collapsed is a silent no-op for the Layers side, since ViewerLayerPanel has no rail/collapse concept at all. This is pre-existing viewer-mode behavior, not something this PR changes, and the PR doesn't claim to support that combination.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/geolibre-desktop/src/components/layout/DesktopShell.tsx`:
- Around line 2517-2520: Update the shared Style sidebar branch in DesktopShell
so both its forceBuiltinCollapsed and controlled autoCollapse conditions also
include layoutOptions.panelsCollapsed, matching the standalone branch behavior
when replaceStylePanelId is set. Add a regression test covering panels=collapsed
with a Style-replacing plugin and verify the shared built-in StylePanel remains
collapsed.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 01a43cca-c072-40e7-8660-f82f73dc244c

📥 Commits

Reviewing files that changed from the base of the PR and between 1196333 and 5610e1d.

📒 Files selected for processing (5)
  • apps/geolibre-desktop/src/components/layout/DesktopShell.tsx
  • apps/geolibre-desktop/src/hooks/useLayoutOptions.ts
  • docs/index.md
  • docs/user-guide/embedding.md
  • tests/layout-options.test.ts

Comment thread apps/geolibre-desktop/src/components/layout/DesktopShell.tsx
@giswqs
giswqs merged commit 1578884 into main Aug 8, 2026
26 checks passed
@giswqs
giswqs deleted the feat/embed-panels-collapsed branch August 8, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants