Skip to content

PB-1432 migrate to floating UI#1248

Merged
pakb merged 39 commits intodevelopfrom
feat-pb-1432-migrate-to-floating-ui
Mar 17, 2025
Merged

PB-1432 migrate to floating UI#1248
pakb merged 39 commits intodevelopfrom
feat-pb-1432-migrate-to-floating-ui

Conversation

@schtibe
Copy link
Contributor

@schtibe schtibe commented Feb 18, 2025

Since tippy.js has been flagged deprecated, created a new component that uses floating-ui as the basis for tooltips.

I created a new component GeoadminTooltip that handles the uses cases we have. It wraps around elements that should have a tooltip. There are several advantages with that:

  • Easy and consistent to use (no need for several different cases of using the tooltip thing)
  • Really reactive: no need to make sure that translations are updated for instance
  • Embedded in the Vue DOM mechanism: there's never a need to manually garbage collect a tooltip. I also thing that the adding and removal of the tooltips works better than the way it was before.

In general I would say this is more lightweight, with the drawback that it's all custom (instead of using a pre-existing library). (Maybe the latter could've been a way to solve this problem, too, but when starting the endeavor I wasn't fully aware of the scope of it)

Some additional notes.

  • Translations need to be done outside of the component. This leads to less coupling of the tooltip component to other things
  • I intentionally didn't add the transition/animation. I found it felt way snappier and more responsive. But that's a personal thing, if they should be there, I could re-add them.

Test link

@schtibe schtibe force-pushed the feat-pb-1432-migrate-to-floating-ui branch 5 times, most recently from 5e000a6 to db9c797 Compare February 21, 2025 08:20
@cypress
Copy link

cypress bot commented Feb 21, 2025

web-mapviewer    Run #4798

Run Properties:  status check passed Passed #4798  •  git commit 27fb98eb56: Sort package.json files with
Project web-mapviewer
Branch Review feat-pb-1432-migrate-to-floating-ui
Run status status check passed Passed #4798
Run duration 04m 54s
Commit git commit 27fb98eb56: Sort package.json files with
Committer Stefan Heinemann
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 23
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 240
View all changes introduced in this branch ↗︎

@schtibe schtibe force-pushed the feat-pb-1432-migrate-to-floating-ui branch 15 times, most recently from 5c9d51a to 9d33def Compare February 25, 2025 13:52
@schtibe schtibe changed the title Feat pb 1432 migrate to floating UI PB-1432 migrate to floating UI Feb 25, 2025
@schtibe schtibe force-pushed the feat-pb-1432-migrate-to-floating-ui branch 4 times, most recently from a44ebbf to 8a18b4f Compare February 25, 2025 15:47
@schtibe schtibe requested a review from pakb February 25, 2025 15:56
@schtibe schtibe force-pushed the feat-pb-1432-migrate-to-floating-ui branch 2 times, most recently from ff0b18d to a121fd0 Compare February 25, 2025 16:31
schtibe added 27 commits March 17, 2025 10:04
Use input event and don't debounce the change in the slider
The transparency slider doesn't work correctly when there are more than
one layer with the same ID. The opacity will be changed on the first
layer that is found in the list instead of the one that it's applied on
The civil icon descriptions weren't appearing anymore, maybe due to a
refactoring mistake
Improve the geoadmin tooltip so that it can be specified to use the
padding even if the content slot is used. This removes the need for
adding the same padding in several places
This makes us ready for a future switch away from bootstrap
Due to the nature of GeoadminTooltip an element was wrapped with that
new component. This lead to the situation where cypress couldn't select
the correct element.
Now instead of working around this with a prop to the component lets
change the selector in cypress and add the attribute programmatically
just before creating the ol/Overlay
@schtibe schtibe force-pushed the feat-pb-1432-migrate-to-floating-ui branch from 4a5c8a8 to 27fb98e Compare March 17, 2025 09:05
@pakb pakb merged commit ea95658 into develop Mar 17, 2025
6 checks passed
@pakb pakb deleted the feat-pb-1432-migrate-to-floating-ui branch March 17, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants