Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions leafmap/maplibregl.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def __init__(
},
projection: str = "mercator",
use_message_queue: bool = None,
add_sidebar: bool = False,
add_floating_sidebar: bool = True,
add_sidebar: Optional[bool] = None,
add_floating_sidebar: Optional[bool] = None,
sidebar_visible: bool = False,
sidebar_width: int = 360,
sidebar_args: Optional[Dict] = None,
Expand Down Expand Up @@ -260,6 +260,17 @@ def __init__(
]
)

if add_sidebar is None and add_floating_sidebar is None:
add_sidebar = False
add_floating_sidebar = True
elif add_sidebar:
add_floating_sidebar = False
elif add_floating_sidebar:
add_sidebar = False
Comment on lines +266 to +269

Copilot AI Nov 15, 2025

Copy link

Choose a reason for hiding this comment

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

The conditional logic doesn't handle the case where both add_sidebar and add_floating_sidebar are explicitly set to True by the user. When both are True, both elif branches execute sequentially, resulting in both being set to False, which is likely unintended. Consider adding validation to prevent conflicting parameters or handle this case explicitly.

Copilot uses AI. Check for mistakes.
else:
add_sidebar = False
add_floating_sidebar = False

if sidebar_args is None:
sidebar_args = {}
if "sidebar_visible" not in sidebar_args:
Expand Down