feat: add a panels=collapsed embed layout option - #1774
Conversation
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.
📝 WalkthroughWalkthroughThe embed layout now supports ChangesCollapsed panel layout
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
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
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. Comment |
🔍 Cloudflare PR preview
|
🔍 GitHub Pages PR preview
Note GitHub Pages built this preview successfully, but its serving edge returned HTTP 403 when checked. The links may still be propagating. |
Code reviewBugs: None found. The new Security: None found. Purely client-side URL query parsing via existing Performance: None found. Trivial boolean logic, no new renders or effects beyond what already existed for Quality: None found. Naming ( 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 |
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
apps/geolibre-desktop/src/components/layout/DesktopShell.tsxapps/geolibre-desktop/src/hooks/useLayoutOptions.tsdocs/index.mddocs/user-guide/embedding.mdtests/layout-options.test.ts
Summary
panels=collapsedas 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 andpanels=none.panelsCollapsedflag fromuseLayoutOptionsintoDesktopShellso it feeds the Layers browser initial-expanded state and the Layers/StyleautoCollapseinputs.Test plan
node --import tsx --test tests/layout-options.test.ts(new case assertspanels=collapsedleaves the panels visible withpanelsCollapsedtrue andpanelsHiddenfalse)pre-commit run --files <changed files>(oxfmt, eslint, npm build all pass)?panels=collapsedand confirm the Layers and Style rails are present with both panels collapsedpanels=noneandmaponlystill hide panels entirely, and no query param still opens panels as beforeSummary by CodeRabbit
New Features
panels=collapsedembed option.panels=nonecontinues to hide all panels.Documentation
Tests