Skip to content

feat: add plugin store watcher#585

Merged
jedi-of-the-sea merged 36 commits intonextfrom
vue3/add-plugin-store-watcher
Apr 9, 2026
Merged

feat: add plugin store watcher#585
jedi-of-the-sea merged 36 commits intonextfrom
vue3/add-plugin-store-watcher

Conversation

@jedi-of-the-sea
Copy link
Copy Markdown
Contributor

@jedi-of-the-sea jedi-of-the-sea commented Mar 6, 2026

Summary

This PR should solve the problem of the dependency of plugin orders by adding a reusable plugin store watcher. It can be used within plugins to manahge watchers for stores from other plugins.

Within this PR, plugin store watchers where added to geoLocation plugin and pins plugin.

⚠️ Please note: to test the new plugin watchers, the order of the plugins geolocation, addressSearch, attributions, layerChooser and pins within the snowbox client was changed.

Instructions for local reproduction and review

  • Start the snowbox client

  • click in the map (stay in the vicinity of Hamburg)
  • check if the address of the place that was clicked on the map is displayed in the search result input field.

  • search for address
  • check if map zooms to search result and a pin is put on the map

  • open the attributions
  • change layer visibiliity in layer chooser
  • check if the attributions change accordingly

Pull Request Checklist (for Assignee)

  • Changelogs are maintained
  • Functionality has been tested in Firefox, Chrome, Safari
  • Functionality has been tested on a smartphone
  • Functionality has been tested with 200% screen zoom
  • Screenreader functionality has been manually tested with NVDA

UI has been tested in the following tools regarding accessibility (only regarding functionality affected in this PR)

  • Chrome Lighthouse
  • Firefox Accessibility

Relevant tickets, issues, et cetera

closes #484

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

PR Preview Action v1.8.0

QR code for preview link

🚀 View preview at
https://Dataport.github.io/polar/pr-preview/pr-585/

Built to branch gh-pages at 2026-04-08 10:15 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@jedi-of-the-sea jedi-of-the-sea force-pushed the vue3/add-plugin-store-watcher branch from a0a2c76 to be3377b Compare March 9, 2026 08:37
@jedi-of-the-sea jedi-of-the-sea self-assigned this Mar 9, 2026
@jedi-of-the-sea jedi-of-the-sea added the enhancement New feature or request label Mar 9, 2026
@jedi-of-the-sea jedi-of-the-sea marked this pull request as ready for review March 9, 2026 09:15
@jedi-of-the-sea jedi-of-the-sea changed the title Vue3/add plugin store watcher feat: add plugin store watcher Mar 9, 2026
@dopenguin dopenguin linked an issue Mar 9, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Member

@dopenguin dopenguin left a comment

Choose a reason for hiding this comment

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

Attributions also need this new composable.

🏓 @jedi-of-the-sea

Comment thread src/architecture.spec.ts Outdated
Comment thread src/core/composables/usePluginStoreWatcher.ts Outdated
Comment thread src/core/composables/usePluginStoreWatcher.ts Outdated
Comment thread src/core/composables/usePluginStoreWatcher.ts Outdated
Comment thread src/core/composables/usePluginStoreWatcher.ts Outdated
Comment thread src/core/composables/usePluginStoreWatcher.ts Outdated
Comment thread src/composables/usePluginStoreWatcher.ts
Comment thread src/composables/usePluginStoreWatcher.ts
Comment thread src/plugins/pins/store.ts Outdated
Comment thread src/plugins/reverseGeocoder/store.ts Outdated
@jedi-of-the-sea
Copy link
Copy Markdown
Contributor Author

jedi-of-the-sea commented Mar 12, 2026

Attributions also need this new composable.

fecfba8

🏓 @dopenguin

(i also updated the description / instructions)

Comment thread src/composables/usePluginStoreWatcher.ts Outdated
@jedi-of-the-sea
Copy link
Copy Markdown
Contributor Author

I noticed an inconsistency within the attributions plugin when a layer is selected but not visible in the current zoom level (can be tested in client "snowbox"). While selecting / deselecting layers, the layer "Ausgleichsflächen" is sometimes listed in the attributions and sometimes not. This seems to be already a problem within the next branch, so I suggest I ignore it in this branch and it gets a separate issue. Would you aggree?

@dopenguin
Copy link
Copy Markdown
Member

dopenguin commented Apr 7, 2026

I noticed an inconsistency within the attributions plugin when a layer is selected but not visible in the current zoom level (can be tested in client "snowbox"). While selecting / deselecting layers, the layer "Ausgleichsflächen" is sometimes listed in the attributions and sometimes not. This seems to be already a problem within the next branch, so I suggest I ignore it in this branch and it gets a separate issue. Would you aggree?

This either seems to have already been fixed on next or I can not reproduce this bug at least for iceberg.
Please update the branch so we may see if this is the case for this PR as well.

However, this does not seem to work at all for iceberg whereas it works for snowbox without any problems.

Copy link
Copy Markdown
Member

@dopenguin dopenguin left a comment

Choose a reason for hiding this comment

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

🏓 @jedi-of-the-sea

Please also rebase the branch / merge the changes from next onto this branch

Comment thread src/plugins/reverseGeocoder/store.ts
Comment thread src/plugins/attributions/store.ts Outdated
Comment thread src/plugins/attributions/store.ts
@jedi-of-the-sea
Copy link
Copy Markdown
Contributor Author

jedi-of-the-sea commented Apr 8, 2026

I noticed an inconsistency within the attributions plugin when a layer is selected but not visible in the current zoom level (can be tested in client "snowbox"). While selecting / deselecting layers, the layer "Ausgleichsflächen" is sometimes listed in the attributions and sometimes not. This seems to be already a problem within the next branch, so I suggest I ignore it in this branch and it gets a separate issue. Would you aggree?

This either seems to have already been fixed on next or I can not reproduce this bug at least for iceberg. Please update the branch so we may see if this is the case for this PR as well.

However, this does not seem to work at all for iceberg whereas it works for snowbox without any problems.

I can still reproduce the bug in the updated next branch for the snowbox client. But in iceberg, the listener for the attributions does not seem to work at all? The videos are from my tests with the next branch

snowbox:
https://github.com/user-attachments/assets/d3254647-924f-42d7-9d88-035fec4f5272

iceberg:
https://github.com/user-attachments/assets/0631aace-2021-4c01-9923-a8b03953da8b

EDIT: i just checked the config and iceberg has no listenToChanges config parameter, so this is why it won't work there. So iceberg is not suited to test the plugin watcher in the attributions plugin.

@dopenguin
Copy link
Copy Markdown
Member

I noticed an inconsistency within the attributions plugin when a layer is selected but not visible in the current zoom level (can be tested in client "snowbox"). While selecting / deselecting layers, the layer "Ausgleichsflächen" is sometimes listed in the attributions and sometimes not. This seems to be already a problem within the next branch, so I suggest I ignore it in this branch and it gets a separate issue. Would you aggree?

This either seems to have already been fixed on next or I can not reproduce this bug at least for iceberg. Please update the branch so we may see if this is the case for this PR as well.
However, this does not seem to work at all for iceberg whereas it works for snowbox without any problems.

I can still reproduce the bug in the updated next branch for the snowbox client. But in iceberg, the listener for the attributions does not seem to work at all? The videos are from my tests with the next branch

snowbox: https://github.com/user-attachments/assets/d3254647-924f-42d7-9d88-035fec4f5272

iceberg: https://github.com/user-attachments/assets/0631aace-2021-4c01-9923-a8b03953da8b

EDIT: i just checked the config and iceberg has no listenToChanges config parameter, so this is why it won't work there. So iceberg is not suited to test the plugin watcher in the attributions plugin.

The config has been updated in 6cfe0dc.

I'll take a closer look regarding the inconsistencies of the attributions

@jedi-of-the-sea
Copy link
Copy Markdown
Contributor Author

jedi-of-the-sea commented Apr 8, 2026

The config has been updated in [6cfe0dc]

Ah ok. I found the same bug here now, too.

I'll take a closer look regarding the inconsistencies of the attributions

it seems to be a bug in getVisibleLayers - sometimes, layer.getVisible() returns true when the layer is selected but invisible due to to zoom level (e.g. when starting the client), sometimes it returns false (e.g. after zooming out again after the layer was visible in a zoom level and is not anymore in the next). Don't know why

🏓 @dopenguin

Copy link
Copy Markdown
Member

@dopenguin dopenguin left a comment

Choose a reason for hiding this comment

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

@jedi-of-the-sea jedi-of-the-sea merged commit be0dda4 into next Apr 9, 2026
4 checks passed
@jedi-of-the-sea jedi-of-the-sea deleted the vue3/add-plugin-store-watcher branch April 9, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin watchers don't work if another plugin is added later on

3 participants