Skip to content

Fix layout issue of sidebar panel due to timeline plugin#12432

Open
subashtiwari1010 wants to merge 3 commits into
geosolutions-it:masterfrom
subashtiwari1010:fix/timeline-layout-11926
Open

Fix layout issue of sidebar panel due to timeline plugin#12432
subashtiwari1010 wants to merge 3 commits into
geosolutions-it:masterfrom
subashtiwari1010:fix/timeline-layout-11926

Conversation

@subashtiwari1010

Copy link
Copy Markdown
Contributor

Description

This PR updates the layout styling for the Sidebar panel i.e. Itinerary, Isochrone, Longitudinal profile and Geoprocessing when expanding the timeline plugin as mentioned in the #12332 (comment).

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix

Issue

What is the current behavior?
The sidebar panel shifts to the left whenever the timeline plugin is expanded/collapsed.

#11926

What is the new behavior?
The sidebar panel are all in their respective position even when the timeline plugin is expanded/collapsed.

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@subashtiwari1010 subashtiwari1010 added this to the 2026.02.00 milestone May 28, 2026
@cla-bot cla-bot Bot added the CLA Ready label May 28, 2026
@subashtiwari1010 subashtiwari1010 linked an issue May 28, 2026 that may be closed by this pull request
1 task
@subashtiwari1010 subashtiwari1010 marked this pull request as ready for review May 28, 2026 08:25
@allyoucanmap allyoucanmap requested review from stefanocudini and removed request for allyoucanmap June 10, 2026 15:20

@stefanocudini stefanocudini left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@subashtiwari1010 I saw you managed to fix the same problem on several plugins in the same way. Excellent fix.
But to ensure this solution remains more robust over time, I propose moving the replicated code in the plugins to a single point and then importing it in any plugins.
In particular, this one, which has a constant 40 pixels, in the calculation:
https://github.com/geosolutions-it/MapStore2/pull/12432/changes?show-viewed-files=false#diff-aab8635813be3f3fbb3dd7b03ecff52fa0ff2d5afeed87ea466f30bd423b71deR1062-R1065

Defining it as a new utils that accepts layout as a parameter from plugins.

This should prevent it from breaking with future changes to the plugins.
And let's reduce the replicated code for managing plugin layouts.
For example, a function getBoundingSidebarRect(layout) in the file: /web/client/utils/LayoutUtils.js

then in the plugins:

import {getBoundingSidebarRect} from "/web/client/utils/LayoutUtils.js"
...
...plugin specific code..
...

        .map(({layout}) => {
            const boundingSidebarRect = getBoundingSidebarRect(layout);
            const action = updateMapLayout({
            ...

...
...plugin specific code..
...

and new utils in /web/client/utils/LayoutUtils.js:

const = DEFAULT_RIGHT = 40;
export const getBoundingSidebarRect = (layout) => ({
    ...(layout?.boundingSidebarRect || {}),
    right: layout?.boundingSidebarRect?.right ?? DEFAULT_RIGHT
});

or smilar to this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review layout and location of timeline plugin

3 participants