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

PB-985: Make Layer Info Movable #1079

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from

Conversation

ismailsunni
Copy link
Contributor

@ismailsunni ismailsunni commented Sep 26, 2024

Update screencast:

Peek 2024-10-08 15-16 - layer description movable

I'm not super expert in CSS, so any suggestions are welcome :)

Test link

Copy link

cypress bot commented Sep 26, 2024

web-mapviewer    Run #3597

Run Properties:  status check passed Passed #3597  •  git commit a72d5edc6a: PB-985: Fix failed unit test.
Project web-mapviewer
Run status status check passed Passed #3597
Run duration 05m 12s
Commit git commit a72d5edc6a: PB-985: Fix failed unit test.
Committer Ismail Sunni
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 211

@ismailsunni ismailsunni requested review from p1d1d1 and removed request for pakb, ltkum and p1d1d1 September 26, 2024 22:32
@ismailsunni ismailsunni marked this pull request as draft September 26, 2024 22:32
@ismailsunni
Copy link
Contributor Author

Need to fix the test first, it seems the approach is wrong :)

@ismailsunni ismailsunni marked this pull request as ready for review September 30, 2024 06:22
Copy link
Contributor

@ltkum ltkum left a comment

Choose a reason for hiding this comment

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

In the ticket, there was also the idea of adding a 'minimize' button if this did not take too much effort. In the mapPopoverComponent, this is handled with this button :

<button
class="btn btn-sm btn-light d-flex align-items-center"
data-cy="map-popover-close-button"
@click="showContent = !showContent"
@mousedown.stop=""
>
<FontAwesomeIcon :icon="`caret-${showContent ? 'up' : 'down'}`" />
</button>
, which toggles a boolean telling us if we should show the content or not. If it's not too much effort, this could be a good idea to add it now.

Copy link
Contributor

@pakb pakb left a comment

Choose a reason for hiding this comment

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

As stated by Martin, it would make more sense to share the "movable" part of the MapPopover.vue here (through some composable or component hierarchy) instead of recreating it.

src/modules/menu/components/LayerDescriptionPopup.vue Outdated Show resolved Hide resolved
@pakb
Copy link
Contributor

pakb commented Oct 2, 2024

I would also shrink the width of the container to fit its content, but not to go further anymore.
You can also get rid of the black backdrop as soon as this is movable (that's the end goal, have the legend visible, but still be able to manipulate the map)

@ismailsunni ismailsunni force-pushed the pb-985-floating-layer-info branch 2 times, most recently from 247b507 to 5a85545 Compare October 8, 2024 07:19
Copy link
Contributor

@pakb pakb left a comment

Choose a reason for hiding this comment

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

If possible, I'd lower the width of the movable layer info to somewhat similar width as the feature tooltip

@ismailsunni
Copy link
Contributor Author

Hi @ltkum @pakb

I have updated my works, now it contains:

  • The usage of useMovableComponent (add new prop to handle initial position)
  • Add button to minimize
  • Reduce the width, now it's more or less similar as the info box
  • Remove the black backdrop (add some new props)

I have updated the screencast in the first comment

Feel free to test and suggestions are welcomed.

@ismailsunni ismailsunni requested review from pakb and ltkum October 8, 2024 08:54
@ismailsunni ismailsunni requested a review from pakb October 8, 2024 09:57
Copy link
Contributor

@pakb pakb left a comment

Choose a reason for hiding this comment

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

works well on desktop, but still needs a bit of work on smaller screen (I think some max-width are messing with the size of the element)

You might want to try out with your "Device toolbar" on and play a bit with a phone sized screen

@ismailsunni
Copy link
Contributor Author

hi @pakb
could you show me tje issue in a smaller screen? I have tried different device size, and it seems all works well. The only difference is the width of the layer description (now it sets to $overlay-width)

@ismailsunni ismailsunni requested a review from pakb October 14, 2024 09:54
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

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

It breaks the normal modal windows like the third party disclaimer and the import file window. In this case the black drop is removed and the close function when clicking outside of the window don't work anymore.
For the import file window, it might also good to make it movable by adding the movable option to it. For the disclaimer the modal with backdrop should be kept.
But to be honest I would not add the movable to the ModalWithBackdrop, to me a modal window should not be movable.

Can you not replace the ModalWithBackrop by the MapPopover component for the layer description ? Or even better use the SimpleWindow component like for the report a problem and add the movable to it. This component is used by the report a problem window which is not movable but would be surely nice to have it movable as well.

@ismailsunni
Copy link
Contributor Author

@ltshb I have used SimpleWindow for the LayerDescription, add movable to it, and make the report window movable.

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.

4 participants