Skip to content

Update sidebar flag#1265

Merged
giswqs merged 2 commits into
masterfrom
sidebar
Nov 15, 2025
Merged

Update sidebar flag#1265
giswqs merged 2 commits into
masterfrom
sidebar

Conversation

@giswqs

@giswqs giswqs commented Nov 15, 2025

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings November 15, 2025 15:08

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.

Pull Request Overview

This PR updates the sidebar flag parameters in the Map class to provide more flexible configuration of sidebar behavior. The changes allow both add_sidebar and add_floating_sidebar parameters to default to None, with logic to determine their values based on user input or use sensible defaults.

Key Changes:

  • Changed default values for add_sidebar and add_floating_sidebar from explicit booleans to None
  • Added conditional logic to handle parameter combinations and set appropriate values
  • Maintains backward compatibility by defaulting to the original behavior when both parameters are None

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread leafmap/maplibregl.py Outdated
Comment on lines +100 to +101
add_sidebar: bool = None,
add_floating_sidebar: bool = None,

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.

Type annotations should be Optional[bool] instead of bool since the default value is now None. This ensures type checkers correctly recognize that these parameters can accept None.

Copilot uses AI. Check for mistakes.
Comment thread leafmap/maplibregl.py
Comment on lines +266 to +269
elif add_sidebar:
add_floating_sidebar = False
elif add_floating_sidebar:
add_sidebar = False

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.
@github-actions

github-actions Bot commented Nov 15, 2025

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request November 15, 2025 15:14 Inactive
@github-actions github-actions Bot temporarily deployed to pull request November 15, 2025 15:23 Inactive
@giswqs giswqs merged commit 7700765 into master Nov 15, 2025
19 of 20 checks passed
@giswqs giswqs deleted the sidebar branch November 15, 2025 15:39
giswqs added a commit that referenced this pull request Dec 6, 2025
* Update sidebar flag

* Fix type hints
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