Skip to content

Support ipyvuetify 3 in MapLibre widgets - #1414

Merged
giswqs merged 1 commit into
masterfrom
fix/ipyvuetify-3-compat
Nov 12, 2026
Merged

giswqs merged 1 commit into
masterfrom
fix/ipyvuetify-3-compat

Conversation

@giswqs

@giswqs giswqs commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • With ipyvuetify 3 (Vuetify 3), displaying a MapLibre map failed with AttributeError: module 'ipyvuetify' has no attribute 'ExpansionPanelHeader'. A new leafmap/vuetify_compat.py maps the components and props leafmap uses so the widgets work with both ipyvuetify 1.x and 3.x:
    • ExpansionPanelHeader/ExpansionPanelContent to ExpansionPanelTitle/ExpansionPanelText, and TabsItems/TabItem to TabsWindow/TabsWindowItem.
    • small, left, dense, dark, bottom and background_color to size, start, density, theme, location and bg_color.
    • Text and icon buttons use variant="text". In Vuetify 3, text=True renders the word "true" and icon buttons are raised by default.
    • The layer manager padding rule targets the Vuetify 3 panel wrapper class.
  • Container keeps min_width and max_width as Python-only properties. ipyvuetify 3 adds synced traits with these names to v.Container, which clamped the whole container to the sidebar width and hid the map.
  • With Vuetify 3, the panel header uses Vuetify's own expand and collapse icons, which follow the header text color. The custom chevron slot did not flip when the panel opened.

Test plan

  • In JupyterLab with ipyvuetify 3.1.1, light and dark themes: the floating sidebar, the container sidebar (add_sidebar=True) and TabWidget render. Expand/collapse, sidebar toggle and tab switching work, and the selected tab syncs back to Python.
  • Same notebook with ipyvuetify 1.12.0: the widgets render and behave as before.
  • pytest tests: no new failures. The test_plot_raster_issue_1381.py failures also happen on master.
  • pre-commit run --all-files passes.

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility with Vuetify 2 and 3 so map controls render and behave consistently across supported versions.
    • Updated tabs, expansion panels, buttons, icons, toolbars, snackbars, floating sidebars, and layer-management widgets to use layouts and styling appropriate to each version.

ipyvuetify 3 wraps Vuetify 3, which renamed expansion panel and tab
components and replaced boolean size and style props, so the MapLibre map
failed to display. Add a small compatibility module so the widgets work with
both ipyvuetify 1.x and 3.x.
Copilot AI balanced review requested due to automatic review settings November 12, 2026 19:36

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 change adds version-aware Vuetify compatibility helpers. Tab and map widgets use the helpers for component names and props, and Container adds Python-backed minimum and maximum width properties.

Changes: Vuetify Compatibility

Layer / File(s) Summary
Compatibility helpers and tab widgets
leafmap/vuetify_compat.py, leafmap/map_widgets.py
Version detection selects Vuetify component aliases and prop mappings. TabWidget uses the helpers and tab-window components for its controls and panels.
Map widget compatibility
leafmap/maplibregl.py
Map widgets use compatibility props and expansion-panel components. Container defines Python-backed min_width and max_width properties.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: Minimal · up to 23282

This change adds ipyvuetify 3 support for MapLibre widgets while keeping ipyvuetify 1.x behavior. No actionable merge-blocking risk was identified.

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 "Support ipyvuetify 3 in MapLibre widgets" matches the main change. The PR adds leafmap/vuetify_compat.py, which maps renamed Vuetify 3 components and properties in the MapLibre and map widg…
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 "Support ipyvuetify 3 in MapLibre widgets" matches the main change. The PR adds leafmap/vuetify_compat.py, which maps renamed Vuetify 3 components and properties in the MapLibre and map widget code. The change keeps support for ipyvuetify 1.x. The title names the ipyvuetify version and the affected MapLibre widgets, so a reviewer can identify the primary change from the title alone.

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 each tab in place,
Then swaps the props to match the case.
The panels shift, the icons align,
Two versions share a clearer line.
The sidebar keeps its measured width,
And hops away, content with both.

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: e82d7156-1fbe-42c5-81a2-99e718dc9f5e
Commits

Reviewing files that changed from the base of the PR and between c0948a2 and 2328248.

Files selected for processing: 3

  • leafmap/map_widgets.py
  • leafmap/maplibregl.py
  • leafmap/vuetify_compat.py

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

@github-actions

Copy link
Copy Markdown

Code review

I reviewed the Vuetify 2/3 compatibility layer (vuetify_compat.py) and its call sites in map_widgets.py and maplibregl.py. I found no blocking bugs. I tried to post one inline comment, but the line could not be resolved, so I've put it under Quality below.

Bugs

  • None found. The Container.min_width and max_width property shadows work, because __init__ assigns them before use and every reader goes through the property. Confidence: medium. I couldn't run this against ipyvuetify 3.
  • Minor: the property getters raise AttributeError if read before the setter runs. That is currently safe because __init__ sets both first. Confidence: low.

Security

  • None. The changes are UI prop mapping only.

Performance

  • None.

Quality

  • vuetify_compat.py:330-332: VUETIFY3 is detected by parsing v.__version__, with a hasattr fallback. A direct feature check (hasattr(v, "ExpansionPanelTitle")) would be simpler and more robust. Confidence: low, non-blocking.
  • vuetify_compat.py:346: v-expansion-panel-text__wrapper is a hard-coded Vuetify 3 internal class name used in injected CSS. If the name is wrong, the padding override fails silently. Please confirm it against a rendered ipyvuetify 3 DOM. Confidence: low to medium.
  • map_widgets.py: tooltip="Refresh" and tooltip="Help" on v.Btn are not Vuetify props in either version. They were already there, so I'm not raising them as new.
  • There are no tests for vuetify_compat. A small parametrized test of the helper return values under both VUETIFY3 states would guard against regressions. Confidence: medium.

CLAUDE.md

  • No CLAUDE.md violations found in the changed files.

@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request November 12, 2026 19:37 Inactive
@giswqs
giswqs merged commit aa4901f into master Nov 12, 2026
20 checks passed
@giswqs
giswqs deleted the fix/ipyvuetify-3-compat branch November 12, 2026 20:21

This branch was previously deployed

1 inactive deployment
pull request — 23282488 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