fix: make the Comments panel opt-in from Settings - #1638
Conversation
Comments opened itself on mount, which displaced the Browser panel because dockable right panels share one active registry slot. It now registers only, gains a Settings > Layout toggle, and shows a collapsed rail entry so enabling it never buries Style or Layers. Selecting a layer also re-expands Style.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe desktop layout now supports multiple visible replacement panels, positional dock rails, opt-in Comments controls, localized labels, and automatic Style panel expansion after non-empty layer selection changes. ChangesReplacement-panel rails
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant SettingsDialog
participant RightPanelRegistry
participant DesktopShell
participant SharedSidebar
User->>SettingsDialog: toggle Comments panel
SettingsDialog->>RightPanelRegistry: open, collapse, or close panel
RightPanelRegistry-->>DesktopShell: emit visible panel IDs and dock state
DesktopShell->>SharedSidebar: pass replacement panel IDs
SharedSidebar-->>User: render active panel and shared rail
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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
|
There was a problem hiding this comment.
Pull request overview
Makes the Comments right-side panel opt-in (so it no longer displaces other docked panels on startup), adds a Settings > Layout toggle for enabling it, and adjusts right-panel rail behavior so docked plugin panels remain reachable when they’re not the active panel.
Changes:
- Stop auto-opening the Comments panel on mount; add Settings toggles (dropdown + Layout section) to open/close it as a collapsed rail entry.
- Ensure plugin panels docked outside the shared rail render their own collapsed rail so they remain reachable when another panel becomes active elsewhere.
- Re-expand the Style panel when the selected layer changes.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/geolibre-desktop/src/hooks/useRegisterCommentsPanel.ts | Removes “open+collapse on mount” behavior for Comments; keeps it as a registered dockable panel. |
| apps/geolibre-desktop/src/components/layout/SettingsDialog.tsx | Adds Layout toggles to show/hide the Comments panel via the right-panel registry. |
| apps/geolibre-desktop/src/components/layout/DesktopShell.tsx | Tweaks shared-rail initial expansion behavior so enabling Comments doesn’t bury Style. |
| apps/geolibre-desktop/src/components/panels/PluginRightPanel.tsx | Adds a per-dock collapsed rail for non-shared docks, keeping docked plugin panels reachable. |
| apps/geolibre-desktop/src/components/panels/StylePanel.tsx | Expands Style panel when the selected layer changes. |
| apps/geolibre-desktop/src/i18n/locales/en.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/ar.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/de.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/es.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/fr.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/hi.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/id.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/it.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/ja.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/ka.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/ko.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/nl.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/pt.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/ru.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/tr.json | Adds translation for the new Layout toggle label. |
| apps/geolibre-desktop/src/i18n/locales/zh.json | Adds translation for the new Layout toggle label. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🔍 GitHub Pages PR preview
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/geolibre-desktop/src/hooks/useRegisterCommentsPanel.ts (1)
14-23: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winGate the Comments shared-rail entry behind the opt-in.
registerCommentsPanelregistersCOMMENTS_PANEL_IDwithreplace-style, so it becomesuseReplaceStylePanelId()and mountsSharedSidebar.SharedSidebarthen always renders that panel as a rail entry. Apply theshowCommentsPanelopt-in before rendering the shared-rail block and beforeopenRightPanel("comments"). Add fresh-load, enable, and disable tests.🤖 Prompt for 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. In `@apps/geolibre-desktop/src/hooks/useRegisterCommentsPanel.ts` around lines 14 - 23, Gate the Comments shared-rail entry on the showCommentsPanel opt-in so SharedSidebar does not render it when disabled. Update the logic around useRegisterCommentsPanel and the shared-rail rendering path to apply the same condition before calling openRightPanel("comments"). Add tests covering fresh load, enabling, and disabling the opt-in.
🤖 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.
Outside diff comments:
In `@apps/geolibre-desktop/src/hooks/useRegisterCommentsPanel.ts`:
- Around line 14-23: Gate the Comments shared-rail entry on the
showCommentsPanel opt-in so SharedSidebar does not render it when disabled.
Update the logic around useRegisterCommentsPanel and the shared-rail rendering
path to apply the same condition before calling openRightPanel("comments"). Add
tests covering fresh load, enabling, and disabling the opt-in.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b23371c3-442e-4573-aa57-b3142966ff2c
📒 Files selected for processing (21)
apps/geolibre-desktop/src/components/layout/DesktopShell.tsxapps/geolibre-desktop/src/components/layout/SettingsDialog.tsxapps/geolibre-desktop/src/components/panels/PluginRightPanel.tsxapps/geolibre-desktop/src/components/panels/StylePanel.tsxapps/geolibre-desktop/src/hooks/useRegisterCommentsPanel.tsapps/geolibre-desktop/src/i18n/locales/ar.jsonapps/geolibre-desktop/src/i18n/locales/de.jsonapps/geolibre-desktop/src/i18n/locales/en.jsonapps/geolibre-desktop/src/i18n/locales/es.jsonapps/geolibre-desktop/src/i18n/locales/fr.jsonapps/geolibre-desktop/src/i18n/locales/hi.jsonapps/geolibre-desktop/src/i18n/locales/id.jsonapps/geolibre-desktop/src/i18n/locales/it.jsonapps/geolibre-desktop/src/i18n/locales/ja.jsonapps/geolibre-desktop/src/i18n/locales/ka.jsonapps/geolibre-desktop/src/i18n/locales/ko.jsonapps/geolibre-desktop/src/i18n/locales/nl.jsonapps/geolibre-desktop/src/i18n/locales/pt.jsonapps/geolibre-desktop/src/i18n/locales/ru.jsonapps/geolibre-desktop/src/i18n/locales/tr.jsonapps/geolibre-desktop/src/i18n/locales/zh.json
|
All four inline comments are buffered. Here is the final summary comment. Code reviewBugs
Security
Performance
Quality
CLAUDE.md
|
| // Key by the active panel id so switching between two replace-style | ||
| // plugins remounts the sidebar, resetting its per-panel local state | ||
| // (the Style opt-in) rather than carrying the previous plugin over. | ||
| key={replaceStylePanelId} |
There was a problem hiding this comment.
Now that multiple panels can be simultaneously visible in the shared Style rail (Comments plus any of the many plugins now defaulting to replace-style), replaceStylePanelId — and therefore this key — changes on every click between two already-visible rail entries, not just on the rare merge/detach action the original comment describes. Each switch fully remounts SharedSidebar, including the wrapped <StylePanel> and SharedSidebar's own builtinOptedIn state.
That interacts badly with the new auto-expand effect in StylePanel.tsx (previousSelectedLayerId = useRef(selectedLayerId) + effect gating on a change from that ref): the ref reinitializes to the current selectedLayerId on every remount, so if a layer is already selected when the remount happens (the common case — a user had a layer selected, then merely clicked to a different panel in the shared rail), the effect sees no "change" and never expands Style. The panel lands collapsed even though a real layer is selected, defeating the "selecting a layer re-expands the Style panel" behavior this PR adds.
Confidence: medium — the remount mechanics and the ref's mount-time initialization are clear from the code; the perceived severity depends on how often users actually have two replace-style panels open at once (Comments + a Web Services plugin).
There was a problem hiding this comment.
Not changing this one — the remount is deliberate and the outcome it produces is the intended layout. Clicking a second shared-rail entry makes that panel the expanded surface, so pluginExpanded is true and Style is collapsed regardless of builtinOptedIn; the reset ref only matters once the user collapses the plugin again, and at that point Style being on the rail is the documented "both collapsed" resting state rather than a defeated auto-expand. Selecting any layer after that still expands Style, because the selection is a real change against the ref. Re-selecting the same layer is a no-op by design (the effect fires on change, not on click). Happy to revisit if the collapse-on-switch reads wrong in use.
|
All four inline comments posted. Final summary below. Code reviewBugs
Security
Performance
Quality
CLAUDE.md
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/geolibre-desktop/src/components/panels/StylePanel.tsx (1)
1013-1024: 🎯 Functional Correctness | 🟠 MajorDuplicate: prevent selection from overriding
autoCollapse.When
autoCollapseis true, this effect still callssetIsCollapsed(false)after a new layer selection. The transition-only effect below does not re-collapse Style while the flag remains true. A notebook, story map, or docked replacement panel can therefore lose its collapsed Style rail.Gate this expansion with
!autoCollapseand addautoCollapseto the dependency list. Keep the manual expand control unchanged.This repeats the supplied previous
StylePanelreview finding.Proposed fix
useEffect(() => { const previous = previousSelectedLayerId.current; previousSelectedLayerId.current = selectedLayerId; if ( + !autoCollapse && selectedLayerId && selectedLayerId !== previous && layers.some((candidate) => candidate.id === selectedLayerId) ) { setIsCollapsed(false); } - }, [layers, selectedLayerId, setIsCollapsed]); + }, [autoCollapse, layers, selectedLayerId, setIsCollapsed]);🤖 Prompt for 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. In `@apps/geolibre-desktop/src/components/panels/StylePanel.tsx` around lines 1013 - 1024, Update the selected-layer effect using previousSelectedLayerId to gate setIsCollapsed(false) with !autoCollapse, and include autoCollapse in the effect dependencies. Leave the manual expand control unchanged.apps/geolibre-desktop/src/components/panels/SharedSidebar.tsx (1)
116-140: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winFix
collapsePlugin/expandBuiltin: callcollapseRightPanelwith the currently active id.
collapseRightPanel(id)only collapses whenactiveId === idand the panel is expanded. SincepanelIdscan includeadditionalPanelIds, both rail toggles callcollapseRightPanel(pluginId)while the active shared-rail panel may have a different id. That makes the active panel fail to collapse and keeps the built-in panel from being able to expand.Use
activeId/the entry id for bothcollapsePluginandexpandBuiltin.🤖 Prompt for 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. In `@apps/geolibre-desktop/src/components/panels/SharedSidebar.tsx` around lines 116 - 140, Update collapsePlugin and expandBuiltin to pass the currently active panel id to collapseRightPanel instead of the captured pluginId. Ensure both toggles collapse the active shared-rail entry, including ids from additionalPanelIds, while preserving the existing expansion behavior.
🤖 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 2323-2383: Hoist the shared `PluginRightPanel` sections for
`dock="left-of-style"` and `dock="right-of-style"` out of the
`replaceStylePanelId` conditional, preserving their existing
`SectionErrorBoundary` wrappers and props. Keep only the middle content
conditional: `SharedSidebar` when `replaceStylePanelId` is active and the
standalone `StylePanel` otherwise, without changing either branch’s behavior.
In `@packages/plugins/src/right-panel-registry.ts`:
- Line 56: Update the documentation for GeoLibreRightPanelRegistration,
RightPanelSnapshot.dock, and the new-panel activation comment to match the
implementation: describe "replace-style" as the default dock, document that
later activations restore values from panelDocks, and state that activation
prefers panelDocks.get(id) before the panel’s declared dock.
In `@tests/right-panel-registry.test.ts`:
- Around line 109-136: Extend the existing tests to cover cleanup and
active-dock restoration: after closeRightPanel("browser") in the first test,
assert that panelDocks no longer contains "browser"; after
openRightPanel("comments") in the second test, assert getActiveRightPanelDock()
returns "replace-style".
---
Outside diff comments:
In `@apps/geolibre-desktop/src/components/panels/SharedSidebar.tsx`:
- Around line 116-140: Update collapsePlugin and expandBuiltin to pass the
currently active panel id to collapseRightPanel instead of the captured
pluginId. Ensure both toggles collapse the active shared-rail entry, including
ids from additionalPanelIds, while preserving the existing expansion behavior.
In `@apps/geolibre-desktop/src/components/panels/StylePanel.tsx`:
- Around line 1013-1024: Update the selected-layer effect using
previousSelectedLayerId to gate setIsCollapsed(false) with !autoCollapse, and
include autoCollapse in the effect dependencies. Leave the manual expand control
unchanged.
🪄 Autofix (Beta)
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: 6fc818e5-9d7e-4b04-81b5-177de03cb57b
📒 Files selected for processing (20)
apps/geolibre-desktop/src/components/layout/DesktopShell.tsxapps/geolibre-desktop/src/components/layout/SettingsDialog.tsxapps/geolibre-desktop/src/components/panels/PluginRightPanel.tsxapps/geolibre-desktop/src/components/panels/SharedSidebar.tsxapps/geolibre-desktop/src/components/panels/StylePanel.tsxapps/geolibre-desktop/src/hooks/useRightPanels.tspackages/plugins/src/index.tspackages/plugins/src/plugins/maplibre-annotations.tspackages/plugins/src/plugins/maplibre-arcgis-hub.tspackages/plugins/src/plugins/maplibre-earthdata-gis.tspackages/plugins/src/plugins/maplibre-geolens.tspackages/plugins/src/plugins/maplibre-graticule.tspackages/plugins/src/plugins/maplibre-h3.tspackages/plugins/src/plugins/maplibre-huggingface.tspackages/plugins/src/plugins/maplibre-open-data-catalogs.tspackages/plugins/src/plugins/maplibre-openaerialmap.tspackages/plugins/src/plugins/maplibre-source-coop.tspackages/plugins/src/plugins/maplibre-stac.tspackages/plugins/src/right-panel-registry.tstests/right-panel-registry.test.ts
- Register the Comments panel with an i18n title getter (`comments.title`, added to every locale) so its rail entry and ARIA labels localize, matching the Browser panel. - Skip the Style panel's select-a-layer expand while `autoCollapse` is on, so a selection cannot pop Style open over the notebook or a story-map presentation; the shared-rail Style panel now receives the same trigger. - Drop the now-unreachable collapsed branches in PluginRightPanel: the early return for a collapsed panel means everything below it renders expanded.
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/hooks/useRegisterCommentsPanel.ts`:
- Line 3: Update the Comments rail title flow in useRegisterCommentsPanel to use
the t() function from react-i18next for comments.title instead of the direct
i18n import. Preserve the dynamic registry getter by passing the current t
reference into the title callback, or re-register the entry whenever t changes.
🪄 Autofix (Beta)
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: 77cdc17d-7e89-425e-a7b9-3d68bc7783f9
📒 Files selected for processing (20)
apps/geolibre-desktop/src/components/layout/DesktopShell.tsxapps/geolibre-desktop/src/components/panels/PluginRightPanel.tsxapps/geolibre-desktop/src/components/panels/StylePanel.tsxapps/geolibre-desktop/src/hooks/useRegisterCommentsPanel.tsapps/geolibre-desktop/src/i18n/locales/ar.jsonapps/geolibre-desktop/src/i18n/locales/de.jsonapps/geolibre-desktop/src/i18n/locales/en.jsonapps/geolibre-desktop/src/i18n/locales/es.jsonapps/geolibre-desktop/src/i18n/locales/fr.jsonapps/geolibre-desktop/src/i18n/locales/hi.jsonapps/geolibre-desktop/src/i18n/locales/id.jsonapps/geolibre-desktop/src/i18n/locales/it.jsonapps/geolibre-desktop/src/i18n/locales/ja.jsonapps/geolibre-desktop/src/i18n/locales/ka.jsonapps/geolibre-desktop/src/i18n/locales/ko.jsonapps/geolibre-desktop/src/i18n/locales/nl.jsonapps/geolibre-desktop/src/i18n/locales/pt.jsonapps/geolibre-desktop/src/i18n/locales/ru.jsonapps/geolibre-desktop/src/i18n/locales/tr.jsonapps/geolibre-desktop/src/i18n/locales/zh.json
Code reviewBugs
Security
Performance
Quality
CLAUDE.md
|
- Render the left/right-of-layers plugin docks alongside the shared Layers rail. Browser opens there on nearly every load, so a panel moved to a layers-side position previously rendered nowhere at all. - Hoist both style-side positional docks out of the shared-rail ternary (and the layers-side ones likewise) so the two branches cannot diverge. - Drop the rail beside an expanded positional panel when it would list only that panel, which just repeated the header it already renders. - Correct the documented default dock (`replace-style`, not `right-of-style`) in the plugin types and docs/plugin-api.md, and the registry comments on restoring a panel's remembered dock. - Assert the dock cleanup on close and the dock restore on re-activation.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/plugins/src/right-panel-registry.ts (1)
80-83: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winModel
panelDocksas a sparse map.
panelDocksis emitted from an in-memory map and deleted when panels close or un-register, butReadonly<Record<string, RightPanelDock>>promises a dock for every string key. Consumers reading arbitrary snapshot entries can getundefined.Use
Readonly<Partial<Record<string, RightPanelDock>>>. Update consumers that read arbitrary IDs to handleundefined.🤖 Prompt for 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. In `@packages/plugins/src/right-panel-registry.ts` around lines 80 - 83, Change panelDocks in the right-panel state model to Readonly<Partial<Record<string, RightPanelDock>>> so absent or unregistered panel IDs are represented safely. Update consumers of panelDocks, especially arbitrary-ID lookups, to handle undefined while preserving existing behavior for entries that have a dock.
🤖 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 2105-2117: Update the shared left and right Sidebar render
conditions in DesktopShell to use replaceLayersPanelIds and
replaceStylePanelIds, keeping them mounted whenever visible shared-rail panels
exist rather than only when the active ID hook is non-null. Pass the
corresponding active ID to pluginId when available, while preserving the
existing shared-rail behavior and panel collections.
---
Outside diff comments:
In `@packages/plugins/src/right-panel-registry.ts`:
- Around line 80-83: Change panelDocks in the right-panel state model to
Readonly<Partial<Record<string, RightPanelDock>>> so absent or unregistered
panel IDs are represented safely. Update consumers of panelDocks, especially
arbitrary-ID lookups, to handle undefined while preserving existing behavior for
entries that have a dock.
🪄 Autofix (Beta)
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: c9636ddc-d2c4-4d08-82e0-a367750ad081
📒 Files selected for processing (6)
apps/geolibre-desktop/src/components/layout/DesktopShell.tsxapps/geolibre-desktop/src/components/panels/PluginRightPanel.tsxdocs/plugin-api.mdpackages/plugins/src/right-panel-registry.tspackages/plugins/src/types.tstests/right-panel-registry.test.ts
Exclude the expanded panel from a positional dock's rail rather than suppressing the whole rail when it holds only that panel. The rail is announced as a collapsed-panel strip, so listing an expanded panel both duplicated it and mislabeled it; entries now use the shared rail's "expand <panel>" wording.
| // Selecting a real layer expands the panel from its rail. Skipped while | ||
| // `autoCollapse` holds it closed (the notebook or a story-map presentation | ||
| // owns the workspace), so a selection made there cannot pop Style back open | ||
| // over them and defeat the auto-collapse below. | ||
| const previousSelectedLayerId = useRef(selectedLayerId); | ||
| useEffect(() => { | ||
| const previous = previousSelectedLayerId.current; | ||
| previousSelectedLayerId.current = selectedLayerId; | ||
| if ( | ||
| !autoCollapse && | ||
| selectedLayerId && | ||
| selectedLayerId !== previous && | ||
| layers.some((candidate) => candidate.id === selectedLayerId) | ||
| ) { | ||
| setIsCollapsed(false); | ||
| } | ||
| }, [autoCollapse, layers, selectedLayerId, setIsCollapsed]); |
There was a problem hiding this comment.
Minor: this new effect is correctly gated by !autoCollapse (and, in controlled mode, effectively no-ops when DesktopShell forces autoCollapse while the notebook/story-map is open). But the pre-existing comment a few lines below (around "Skipped entirely in controlled mode, where the parent (shared rail) owns collapse and never passes autoCollapse") is now stale — DesktopShell does pass autoCollapse to the controlled StylePanel now (that's what this new effect relies on). Worth a follow-up tweak to that comment so it doesn't mislead future readers; not a functional issue.
Confidence: high, severity: low (doc-only).
| /** Whether a registered panel is enabled in a dock rail. */ | ||
| export function isRightPanelVisible(id: string): boolean { | ||
| return visibleIds.has(id); | ||
| } |
There was a problem hiding this comment.
isRightPanelVisible is exported (and re-exported from packages/plugins/src/index.ts) but isn't consumed anywhere in this PR — SettingsDialog.tsx computes the same thing itself via rightPanelState.visibleIds.includes(BROWSER_PANEL_ID) / .includes(COMMENTS_PANEL_ID) instead of calling this helper. Not a bug, but consider either using this accessor from SettingsDialog (single source of truth) or dropping it if it's meant purely as future external-plugin API surface — as-is it's untested and unused.
Confidence: medium, severity: low (code quality / duplication).
Code reviewI did a deep pass on the core logic change — the right-panel registry's new Bugs: None found with reasonable confidence. Several plausible-looking races (e.g. Security: None found — no new user input handling, injection surface, or secret handling in this diff. Performance: None found — the added Quality:
CLAUDE.md: No violations found — i18n keys added via |
Summary
Test plan
npm run test:frontendpassespre-commit run --files <changed paths>passes (includes the full build)Summary by CodeRabbit
New Features
Localization