-
-
Notifications
You must be signed in to change notification settings - Fork 579
fix: make the Comments panel opt-in from Settings #1638
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 3 commits
e67af60
453e726
2ab7b1c
ef78f30
870653f
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 |
|---|---|---|
|
|
@@ -703,7 +703,14 @@ | |
| el.className = "contents"; | ||
| return el; | ||
| }); | ||
| const activePanelId = useRightPanelState().activeId; | ||
| const rightPanelState = useRightPanelState(); | ||
| const activePanelId = rightPanelState.activeId; | ||
| const replaceStylePanelIds = rightPanelState.visibleIds.filter( | ||
| (id) => rightPanelState.panelDocks[id] === "replace-style", | ||
| ); | ||
| const replaceLayersPanelIds = rightPanelState.visibleIds.filter( | ||
| (id) => rightPanelState.panelDocks[id] === "replace-layers", | ||
| ); | ||
| const activePanel = activePanelId ? getRightPanel(activePanelId) : undefined; | ||
| // The plugins in VIEWER_BLOCKED_PLUGIN_IDS paint drawing and editing controls | ||
| // onto the map, which the read-only viewer preset cannot hide the way it | ||
|
|
@@ -1374,7 +1381,7 @@ | |
| } | ||
| }); | ||
| return () => setKmlFileImportHandler(null); | ||
| }, [addImportedVectorLayers, confirmLargeVectorDataset, t]); | ||
|
Check warning on line 1384 in apps/geolibre-desktop/src/components/layout/DesktopShell.tsx
|
||
|
|
||
| const addDroppedPhotos = useCallback( | ||
| (result: GeotaggedPhotoResult | null): number => { | ||
|
|
@@ -1650,7 +1657,7 @@ | |
| disposed = true; | ||
| unlisten?.(); | ||
| }; | ||
| }, [ | ||
| clearDropMessageLater, | ||
| finishDrop, | ||
| addDroppedRasters, | ||
|
|
@@ -1794,7 +1801,7 @@ | |
| clearDropMessageLater(); | ||
| } | ||
| }, | ||
| [ | ||
| clearDropMessageLater, | ||
| finishDrop, | ||
| addDroppedRasters, | ||
|
|
@@ -2087,6 +2094,7 @@ | |
| key={replaceLayersPanelId} | ||
| side="layers" | ||
| pluginId={replaceLayersPanelId} | ||
| additionalPanelIds={replaceLayersPanelIds} | ||
| pluginContentEl={dockContentEl} | ||
| pluginWidth={pluginPanelWidth} | ||
| onPluginWidthChange={setPluginPanelWidth} | ||
|
|
@@ -2312,42 +2320,71 @@ | |
| {/* Same as the left dock: a map-only / hidden-panels embed skips the | ||
| entire right side-dock (Style, plugin panels, and their shared rail). */} | ||
| {layoutOptions.panelsHidden || layoutOptions.viewer ? null : replaceStylePanelId ? ( | ||
| // Shared-rail mode (issue #765): the plugin panel shares the Style | ||
| // sidebar surface, so a single rail lists both the workbench and Style | ||
| // instead of the two positional plugin slots flanking the Style panel. | ||
| <SectionErrorBoundary | ||
| label="Shared right sidebar" | ||
| displayName={t("shell.section.sharedRightSidebar")} | ||
| > | ||
| <SharedSidebar | ||
| // 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} | ||
| side="style" | ||
| pluginId={replaceStylePanelId} | ||
| pluginContentEl={dockContentEl} | ||
| pluginWidth={pluginPanelWidth} | ||
| onPluginWidthChange={setPluginPanelWidth} | ||
| builtinVisible={layoutOptions.stylePanelVisible} | ||
| builtinTitle={t("sharedRail.style")} | ||
| builtinIcon={<SlidersHorizontal className="h-4 w-4" />} | ||
| // Mirror the standalone Style panel's autoCollapse triggers so the | ||
| // notebook / story-map presentation collapses Style here too. | ||
| // `autoCollapsedPanel` is omitted because it is always null in a | ||
| // shared-rail mode (the panel is the sole active one). | ||
| forceBuiltinCollapsed={notebookOpen || storymapPresenting} | ||
| renderBuiltin={({ collapsed, onCollapsedChange }) => ( | ||
| <StylePanel | ||
| mapControllerRef={mapControllerRef} | ||
| onResizeStart={startStylePanelResize} | ||
| collapsed={collapsed} | ||
| onCollapsedChange={onCollapsedChange} | ||
| hideOwnRail | ||
| /> | ||
| )} | ||
| /> | ||
| </SectionErrorBoundary> | ||
| <> | ||
| {/* Shared-rail panels such as Comments must not remove the ordinary | ||
| positional docks: enabled Web Services panels still live in | ||
| left/right-of-style and need their vertical rail entries. */} | ||
| <SectionErrorBoundary | ||
| label="Plugin panel (left of Style)" | ||
| displayName={t("shell.section.pluginPanelLeftOfStyle")} | ||
| > | ||
| <PluginRightPanel | ||
| dock="left-of-style" | ||
| contentEl={dockContentEl} | ||
| width={pluginPanelWidth} | ||
| onWidthChange={setPluginPanelWidth} | ||
| /> | ||
| </SectionErrorBoundary> | ||
| <SectionErrorBoundary | ||
| label="Shared right sidebar" | ||
| displayName={t("shell.section.sharedRightSidebar")} | ||
| > | ||
| <SharedSidebar | ||
| // 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} | ||
|
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. Now that multiple panels can be simultaneously visible in the shared Style rail (Comments plus any of the many plugins now defaulting to That interacts badly with the new auto-expand effect in 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
Member
Author
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. 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 |
||
| side="style" | ||
| pluginId={replaceStylePanelId} | ||
| additionalPanelIds={replaceStylePanelIds} | ||
| pluginContentEl={dockContentEl} | ||
| pluginWidth={pluginPanelWidth} | ||
| onPluginWidthChange={setPluginPanelWidth} | ||
| builtinVisible={layoutOptions.stylePanelVisible} | ||
| builtinTitle={t("sharedRail.style")} | ||
| builtinIcon={<SlidersHorizontal className="h-4 w-4" />} | ||
| // Mirror the standalone Style panel's autoCollapse triggers so the | ||
| // notebook / story-map presentation collapses Style here too. | ||
| // `autoCollapsedPanel` is omitted because it is always null in a | ||
| // shared-rail mode (the panel is the sole active one). | ||
| forceBuiltinCollapsed={notebookOpen || storymapPresenting} | ||
| renderBuiltin={({ collapsed, onCollapsedChange }) => ( | ||
| <StylePanel | ||
| mapControllerRef={mapControllerRef} | ||
| onResizeStart={startStylePanelResize} | ||
| collapsed={collapsed} | ||
| onCollapsedChange={onCollapsedChange} | ||
| // Controlled mode ignores autoCollapse for collapsing (the | ||
| // rail owns that via forceBuiltinCollapsed); it is passed so | ||
| // a layer selection cannot expand Style over the notebook. | ||
| autoCollapse={notebookOpen || storymapPresenting} | ||
| hideOwnRail | ||
| /> | ||
| )} | ||
| /> | ||
| </SectionErrorBoundary> | ||
| <SectionErrorBoundary | ||
| label="Plugin panel (right of Style)" | ||
| displayName={t("shell.section.pluginPanelRightOfStyle")} | ||
| > | ||
| <PluginRightPanel | ||
| dock="right-of-style" | ||
| contentEl={dockContentEl} | ||
| width={pluginPanelWidth} | ||
| onWidthChange={setPluginPanelWidth} | ||
| /> | ||
| </SectionErrorBoundary> | ||
| </> | ||
| ) : ( | ||
| <> | ||
| <SectionErrorBoundary | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.