Skip to content

Fix horizontal scrollbar in MapLibre layer manager - #1417

Merged
giswqs merged 1 commit into
masterfrom
fix/maplibre-layer-manager-scrollbar
Nov 12, 2026
Merged

giswqs merged 1 commit into
masterfrom
fix/maplibre-layer-manager-scrollbar

Conversation

@giswqs

@giswqs giswqs commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The "All layers on/off" and group toggle checkboxes in the MapLibre layer manager used width="100%" plus the default 2px widget margin, making them 4px wider than the floating sidebar panel. JupyterLab showed a horizontal scrollbar at the bottom of the panel as a result.
  • Use width="auto" so the checkboxes still fill the row with the margin included.

Test plan

  • Opened the layer manager in JupyterLab: no element in the floating sidebar overflows horizontally (checkbox is now 334px in a 338px panel instead of 338px plus margins)
  • Confirm no horizontal scrollbar in JupyterLab with classic (non-overlay) scrollbars
  • pre-commit run --all-files passes

Summary by CodeRabbit

  • Style
    • The “All layers on/off” checkbox and group-layer toggles now use automatic width.

The layer toggle checkboxes used a 100% width plus a 2px margin, so they were
4px wider than the floating sidebar panel and JupyterLab showed a horizontal
scrollbar. Use an auto width so the margin fits inside the row.
Copilot AI balanced review requested due to automatic review settings November 12, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The master “All layers on/off” checkbox and group-layer toggles now use automatic width instead of 100%.

Changes: Layer toggle width adjustment

Layer / File(s) Summary
Layer toggle checkbox widths
leafmap/maplibregl.py
The master and group-layer toggle checkboxes now use width="auto" instead of width="100%". The master checkbox comment notes that full width could overflow the panel due to the checkbox margin.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Possibly related PRs

  • opengeos/leafmap#1410: Changes the same checkboxes and panel padding, which relates to the width adjustment.
Merge Risk: Minimal · up to 9330d

This is a small cosmetic fix that removes a horizontal scrollbar in the layer manager. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the actual fix: the horizontal scrollbar in the MapLibre layer manager. The raw summary and objectives confirm the change replaces width="100%" with width="auto" on the layer toggle ch…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the actual fix: the horizontal scrollbar in the MapLibre layer manager. The raw summary and objectives confirm the change replaces width="100%" with width="auto" on the layer toggle checkboxes, which removes the 4px overflow caused by the default widget margin. The title is specific and matches the main change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

A rabbit checks the layers in a row,
The master switch has room to go.
Group toggles fit without a squeeze,
Their widths now rest with greater ease.
I nibble clover, then hop away.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6e541150-3369-4dee-a92a-a7926d251e23
Commits

Reviewing files that changed from the base of the PR and between 7f03887 and 9330d9f.

Files selected for processing: 1

  • leafmap/maplibregl.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@github-actions

Copy link
Copy Markdown

Code review

I reviewed PR #1417, which changes leafmap/maplibregl.py (+4/−2). It replaces width="100%" with width="auto" on the master "All layers on/off" checkbox and on the per-group toggle checkboxes in the MapLibre layer manager. The goal is to remove the horizontal scrollbar caused by the checkbox's 2px margin overflowing a 100%-wide box.

I found nothing worth an inline comment. I did not run the widget, so the scrollbar fix itself is untested.

Bugs

  • None found. width="auto" is a valid ipywidgets Layout value. The change only affects sizing, and the observe callbacks and toggle logic are untouched. The Layout arguments for the master and group toggles are changed consistently.
  • Low-confidence visual note: the checkboxes now size to their label rather than filling the panel. Clicking is still handled by the checkbox itself, so I don't expect a functional regression. A long description could still wrap or overflow differently from before, so a quick check in JupyterLab and classic Notebook would be sensible.

Security

  • None. The change only touches widget layout.

Performance

  • None.

Quality

  • The inline comment explaining why auto is used is helpful. The group toggle at line ~10499 has no matching comment, and the explanation also applies there. A short "see above" comment would help, but this is a minor nit (confidence: low).

CLAUDE.md

  • No CLAUDE.md guidelines are violated by the changed lines.

@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request November 12, 2026 20:45 Inactive
@giswqs
giswqs merged commit 30ae4c8 into master Nov 12, 2026
20 checks passed
@giswqs
giswqs deleted the fix/maplibre-layer-manager-scrollbar branch November 12, 2026 20:46

This branch was previously deployed

1 inactive deployment
pull request — 9330d9fd Deployed Nov 12, 2026 by github-actions[bot]
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.

2 participants