Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace more usage of deprecated APIs in map-layers #1177

Merged
merged 12 commits into from
Feb 11, 2025
Merged

Conversation

hl662
Copy link
Contributor

@hl662 hl662 commented Feb 3, 2025

  • Replace use of Popup in transparency popup

  • AttachMapLayerPopup is also refactored, but needs more investigation into why the modal opens then closes immediately (event.stopPropagation isn't working well...). Relevant SO question

    Update: The issue was when the modal opens from within the Popover's content, it's triggering state changes that affected the Popover's visibility. Fix- modified the state management to keep the Popover open while the MapUrlDialog modal is active - @pachhaibipin

TODOs:

  • Run pnpm test, make sure to fix all tests
  • Refactor SubLayersPopupButton to use iTwinUI's Popover.

pr

DISCUSSION:
if you look into the attached gif below, the attached map layer list does not get updated once we delete or edit the custom layer definitions. It didn't seem very intuitive. However, diving into the implementation, the code flow suggests once the layer is attached, it won't be updated with delete/edit action. Only way seems to be detaching it. Do we want to keep it that way? Should it detach/update the map layer list once we delete/edit the added definitions? wanted to confirm if that’s the intended flow @mdastous-bentley

flow

@hl662 hl662 self-assigned this Feb 3, 2025
@CLAassistant
Copy link

CLAassistant commented Feb 7, 2025

CLA assistant check
All committers have signed the CLA.

@pachhaibipin pachhaibipin marked this pull request as ready for review February 11, 2025 16:34
@hl662
Copy link
Contributor Author

hl662 commented Feb 11, 2025

@mdastous-bentley please check the PR description and confirm that's the intended behavior

@aruniverse
Copy link
Member

@mdastous-bentley please check the PR description and confirm that's the intended behavior

add a gif of your changes in dark mode, which often makes it easier to find bugs

@pachhaibipin
Copy link
Contributor

@mdastous-bentley please check the PR description and confirm that's the intended behavior

add a gif of your changes in dark mode, which often makes it easier to find bugs

Added gif to the description. couldn't find a way to turn dark mode on test-viewer app. Haven't made any changes yet to that. wanted to confirm if that's the intended flow first.
Are you asking to add gif for the changes made in this PR though? @aruniverse

@aruniverse
Copy link
Member

Are you asking to add gif for the changes made in this PR though?

yes

you should just need to pass in the theme prop to the viewer

@pachhaibipin
Copy link
Contributor

Are you asking to add gif for the changes made in this PR though?

yes

you should just need to pass in the theme prop to the viewer

updated with gifs

@mdastous-bentley
Copy link
Contributor

mdastous-bentley commented Feb 11, 2025

@hl662
There are two concepts two understand:

  1. The list of predefined map layer sources. (Which is later used to attach a map-layer to a viewport)
  2. Lists of currently attached map-layers in the active viewport.

You can delete a map layer source from list #1, and keep the "associated" map-layers attached in the viewport, no problem. All it means is that you won't be able to re-add by using the same map layer source later on.

I don't think we want to mess with this actual design at this point.

@hl662
Copy link
Contributor Author

hl662 commented Feb 11, 2025

I don't think we want to mess with this actual design at this point.

Got it. The design has been reverted back to this a couple commits ago

@hl662 hl662 enabled auto-merge (squash) February 11, 2025 21:21
@hl662 hl662 merged commit 6efc511 into master Feb 11, 2025
13 checks passed
@hl662 hl662 deleted the nam/fix-popover branch February 11, 2025 21:48
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.

5 participants