Skip to content

Sidebar resize react panels#1870

Open
KanishJebaMathewM wants to merge 14 commits into
maplibre:mainfrom
KanishJebaMathewM:sidebar-resize-react-panels
Open

Sidebar resize react panels#1870
KanishJebaMathewM wants to merge 14 commits into
maplibre:mainfrom
KanishJebaMathewM:sidebar-resize-react-panels

Conversation

@KanishJebaMathewM
Copy link
Copy Markdown
Contributor

Implements adjustable sidebar resizing using react-resizable-panels as a cleaner alternative to the custom implementation proposed in #1682.

This implementation:

  • adds resizable sidebar width
  • adds resizable split between layer list and properties drawer
  • replaces custom resize logic with library-based panels
  • simplifies resize handling and accessibility

The original PR #1682 was mainly used as UX/reference inspiration, but this implementation is rebuilt around react-resizable-panels for maintainability.

sank64 and others added 5 commits March 2, 2026 18:58
- Convert AppLayout from class to functional component
- Add outer resize handle between sidebar and map (drag to resize)
- Add inner resize handle between layer list and properties drawer
- Use CSS custom properties for dynamic sidebar/panel widths
- Persist both sidebar width and list/drawer ratio to localStorage
- Fix layer click selection: clicking layer name text now opens properties
- Extract sidebar helpers to src/libs/sidebar.ts
- Add unit tests for sidebar helpers
- Add Cypress e2e test for resize handles
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.45%. Comparing base (00b20af) to head (167977e).
⚠️ Report is 23 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (00b20af) and HEAD (167977e). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (00b20af) HEAD (167977e)
3 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1870       +/-   ##
===========================================
- Coverage   71.57%   46.45%   -25.13%     
===========================================
  Files         102        3       -99     
  Lines        7037      127     -6910     
  Branches     2123       35     -2088     
===========================================
- Hits         5037       59     -4978     
+ Misses       1998       55     -1943     
- Partials        2       13       +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/locales/zh/translation.json Outdated
Comment thread src/locales/fr/translation.json Outdated
@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented May 12, 2026

This looks good overall, Besides the translation I think this can be merged.

@KanishJebaMathewM
Copy link
Copy Markdown
Contributor Author

So do I need to make any changes here?

@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented May 12, 2026

Yes, Fix the translation files.

@KanishJebaMathewM
Copy link
Copy Markdown
Contributor Author

Yeahh made those translations

@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented May 12, 2026

Please fill the others as well.

@KanishJebaMathewM
Copy link
Copy Markdown
Contributor Author

Please fill the others as well.

Sorry didn't notice

@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented May 12, 2026

Are you sure the e2e tests are passing?

@KanishJebaMathewM
Copy link
Copy Markdown
Contributor Author

Yeah it passes

@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented May 13, 2026

Looks like the tests you added are failing in the CI:

2 failing

  1) sidebar resize
       dragging the handle changes sidebar width:

      Timed out retrying after 4000ms
      + expected - actual


      at Context.eval (webpack://maputnik/./cypress/e2e/sidebar-resize.cy.ts:30:31)
      at <unknown> (http://localhost:8888/__cypress/runner/cypress_runner.js:122365:17)
      at tryCatcher (http://localhost:8888/__cypress/runner/cypress_runner.js:1777:23)
      at Promise.attempt.Promise.try (http://localhost:8888/__cypress/runner/cypress_runner.js:4285:29)
      at Context.shouldFnWithCallback (http://localhost:8888/__cypress/runner/cypress_runner.js:122362:66)
      at Context.shouldFn (http://localhost:8888/__cypress/runner/cypress_runner.js:122405:37)

  2) sidebar resize
       dragging inner handle changes list/drawer split:

      Timed out retrying after 4000ms
      + expected - actual

So you'll need to investigate as to why.
You can use codespaces to simulate a similar environment to how the CI is running, to some extent...

Comment thread cypress/e2e/maputnik-driver.ts Outdated
@KanishJebaMathewM
Copy link
Copy Markdown
Contributor Author

@HarelM can you review this

Comment thread cypress/e2e/sidebar-resize.cy.ts Outdated
@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented May 18, 2026

I keep repeating the same code review comments, this is frustrating. If this is generated by AI please make sure to review this before you ask me to review it.
This is a final warning.

@KanishJebaMathewM
Copy link
Copy Markdown
Contributor Author

Apologies for the frustration. I reviewed this carefully — moved all cy.document().trigger calls into the pointerDrag helper. Tested the sidebar resize on the frontend and everything works smoothly, so I committed the changes.

@HarelM HarelM enabled auto-merge (squash) June 3, 2026 09:27
@HarelM
Copy link
Copy Markdown
Collaborator

HarelM commented Jun 3, 2026

CI is failing, I think some of the buttons and maybe the map is covered by the panel after the tests.
I ran them a few times and they still fail...

auto-merge was automatically disabled June 3, 2026 17:08

Head branch was pushed to by a user without write access

Comment thread CHANGELOG.md
- Fixed headers in left panes (Layers list and Layer editor) to remain visible when scrolling
- Fix error when using a source from localhost
- Fix an issue with scrolling when using the code editor
- Fix Cypress E2E test failures caused by resizable panel sizes persisting in localStorage.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No need to add this, this is part of the feature...

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.

4 participants