-
Notifications
You must be signed in to change notification settings - Fork 20
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
VizPanelRenderer: Emit SetPanelAttention event #716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tskarhed is it not better to have this logic in PanelChrome? Scenes support many layout options (not only GridLayout), would be nice to share the logic between them
True, it may be a bit more brittle though, causing multiple panels to have attention. But I can give it a go. |
Ah, yes, that was the reason. If you have one panel in focus and then move the mouse over another, they both have attention, so you need something above keeping track of the attention state. |
@tskarhed maybe GrafanaContext can have that? |
@torkelo If used with PanelChrome, wouldn't that be a dependency on core? And PanelChrome no knowledge of panel id :/ |
@tskarhed grid / items does not know panel id either , maybe VizPanelRenderer can set attention? Just a question where state should live |
Okay, for non-scenes I have it working with the state living in KeyboardSrv (which is accessible with the For Scenes, it seems like VizPanelRenderer is a good place. It can emit an event when it gets attention (preferably it would also be able to read the current attention state to determine if it has attention in order to avoid a ton of events being emitted on MouseMove). Just not sure how to read this possible parent state. At the moment I'm looking at storing the state in |
@tskarhed why not use Ah, plugins platform has not yet made useGrafana accessible to plugins :( Then I don't know, maybe we need a new context that plugins (ie scenes) can interact with? |
@torkelo Good point. At the moment there is also duplicate functionality for the keybindings, which I could consolidate. Maybe I'll look into exposing either |
I created a service this time around. There are still some typing issues with |
@torkelo I have updated the approach using a service instead. Please tell me what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry had this unpublished review comment from 1-2 days ago (done on mobile)
Will take a look more closely next week (traveling today)
It still has the |
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
🚀 PR was released in |
# v4.24.4 (Thu May 30 2024) #### 🐛 Bug Fix - `@grafana/scenes` - VizPanelRenderer: Emit SetPanelAttention event [#716](grafana/scenes#716) ([@tskarhed](https://github.com/tskarhed)) #### Authors: 1 - Tobias Skarhed ([@tskarhed](https://github.com/tskarhed)) --- # v4.24.3 (Thu May 30 2024) #### 🐛 Bug Fix - `@grafana/scenes` - Macros: Resolve browser timezone for `$__timezone` [#759](grafana/scenes#759) ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Variables: Prioritize showing adhoc variable key and operator [#750](grafana/scenes#750) ([@oscarkilhed](https://github.com/oscarkilhed)) #### Authors: 2 - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed)) --- # v4.24.2 (Wed May 29 2024) #### 🐛 Bug Fix - `@grafana/scenes` - MultiValueVariable: Fixes issue when value is all value but all value is not enabled [#757](grafana/scenes#757) ([@torkelo](https://github.com/torkelo) [@ivanortegaalba](https://github.com/ivanortegaalba)) #### Authors: 2 - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Torkel Ödegaard ([@torkelo](https://github.com/torkelo)) --- # v4.24.1 (Tue May 28 2024) #### 🐛 Bug Fix - Plugin.json: update schema reference URL in scenes-app [#754](grafana/scenes#754) ([@leventebalogh](https://github.com/leventebalogh)) - `@grafana/scenes` - Allow drag and dropping rows in valid states [#756](grafana/scenes#756) ([@mdvictor](https://github.com/mdvictor)) - fix: undefined check on RefreshPicker.autoOption [#751](grafana/scenes#751) ([@darrenjaneczek](https://github.com/darrenjaneczek)) #### Authors: 3 - Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Levente Balogh ([@leventebalogh](https://github.com/leventebalogh)) - Victor Marin ([@mdvictor](https://github.com/mdvictor)) --- # v4.24.0 (Mon May 27 2024) #### 🚀 Enhancement - `@grafana/scenes` - SceneFlexLayout: Min width/height option was ignored [#749](grafana/scenes#749) ([@edvard-falkskar](https://github.com/edvard-falkskar)) #### Authors: 1 - Edvard Falkskär ([@edvard-falkskar](https://github.com/edvard-falkskar)) ---
- `@grafana/scenes` - VizPanelRenderer: Emit SetPanelAttention event [#716](grafana/scenes#716) ([@tskarhed](https://github.com/tskarhed)) - Tobias Skarhed ([@tskarhed](https://github.com/tskarhed)) --- - `@grafana/scenes` - Macros: Resolve browser timezone for `$__timezone` [#759](grafana/scenes#759) ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Variables: Prioritize showing adhoc variable key and operator [#750](grafana/scenes#750) ([@oscarkilhed](https://github.com/oscarkilhed)) - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed)) --- - `@grafana/scenes` - MultiValueVariable: Fixes issue when value is all value but all value is not enabled [#757](grafana/scenes#757) ([@torkelo](https://github.com/torkelo) [@ivanortegaalba](https://github.com/ivanortegaalba)) - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Torkel Ödegaard ([@torkelo](https://github.com/torkelo)) --- - Plugin.json: update schema reference URL in scenes-app [#754](grafana/scenes#754) ([@leventebalogh](https://github.com/leventebalogh)) - `@grafana/scenes` - Allow drag and dropping rows in valid states [#756](grafana/scenes#756) ([@mdvictor](https://github.com/mdvictor)) - fix: undefined check on RefreshPicker.autoOption [#751](grafana/scenes#751) ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Levente Balogh ([@leventebalogh](https://github.com/leventebalogh)) - Victor Marin ([@mdvictor](https://github.com/mdvictor)) --- - `@grafana/scenes` - SceneFlexLayout: Min width/height option was ignored [#749](grafana/scenes#749) ([@edvard-falkskar](https://github.com/edvard-falkskar)) - Edvard Falkskär ([@edvard-falkskar](https://github.com/edvard-falkskar)) --- (cherry picked from commit c5ae0bb)
# v4.24.4 (Thu May 30 2024) #### 🐛 Bug Fix - `@grafana/scenes` - VizPanelRenderer: Emit SetPanelAttention event [grafana#716](grafana/scenes#716) ([@tskarhed](https://github.com/tskarhed)) #### Authors: 1 - Tobias Skarhed ([@tskarhed](https://github.com/tskarhed)) --- # v4.24.3 (Thu May 30 2024) #### 🐛 Bug Fix - `@grafana/scenes` - Macros: Resolve browser timezone for `$__timezone` [grafana#759](grafana/scenes#759) ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Variables: Prioritize showing adhoc variable key and operator [grafana#750](grafana/scenes#750) ([@oscarkilhed](https://github.com/oscarkilhed)) #### Authors: 2 - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed)) --- # v4.24.2 (Wed May 29 2024) #### 🐛 Bug Fix - `@grafana/scenes` - MultiValueVariable: Fixes issue when value is all value but all value is not enabled [grafana#757](grafana/scenes#757) ([@torkelo](https://github.com/torkelo) [@ivanortegaalba](https://github.com/ivanortegaalba)) #### Authors: 2 - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Torkel Ödegaard ([@torkelo](https://github.com/torkelo)) --- # v4.24.1 (Tue May 28 2024) #### 🐛 Bug Fix - Plugin.json: update schema reference URL in scenes-app [grafana#754](grafana/scenes#754) ([@leventebalogh](https://github.com/leventebalogh)) - `@grafana/scenes` - Allow drag and dropping rows in valid states [grafana#756](grafana/scenes#756) ([@mdvictor](https://github.com/mdvictor)) - fix: undefined check on RefreshPicker.autoOption [grafana#751](grafana/scenes#751) ([@darrenjaneczek](https://github.com/darrenjaneczek)) #### Authors: 3 - Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Levente Balogh ([@leventebalogh](https://github.com/leventebalogh)) - Victor Marin ([@mdvictor](https://github.com/mdvictor)) --- # v4.24.0 (Mon May 27 2024) #### 🚀 Enhancement - `@grafana/scenes` - SceneFlexLayout: Min width/height option was ignored [grafana#749](grafana/scenes#749) ([@edvard-falkskar](https://github.com/edvard-falkskar)) #### Authors: 1 - Edvard Falkskär ([@edvard-falkskar](https://github.com/edvard-falkskar)) ---
Scenes: Update to latest 4.23.1 -> 4.24.4 (#88485) - `@grafana/scenes` - VizPanelRenderer: Emit SetPanelAttention event [#716](grafana/scenes#716) ([@tskarhed](https://github.com/tskarhed)) - Tobias Skarhed ([@tskarhed](https://github.com/tskarhed)) --- - `@grafana/scenes` - Macros: Resolve browser timezone for `$__timezone` [#759](grafana/scenes#759) ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Variables: Prioritize showing adhoc variable key and operator [#750](grafana/scenes#750) ([@oscarkilhed](https://github.com/oscarkilhed)) - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed)) --- - `@grafana/scenes` - MultiValueVariable: Fixes issue when value is all value but all value is not enabled [#757](grafana/scenes#757) ([@torkelo](https://github.com/torkelo) [@ivanortegaalba](https://github.com/ivanortegaalba)) - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Torkel Ödegaard ([@torkelo](https://github.com/torkelo)) --- - Plugin.json: update schema reference URL in scenes-app [#754](grafana/scenes#754) ([@leventebalogh](https://github.com/leventebalogh)) - `@grafana/scenes` - Allow drag and dropping rows in valid states [#756](grafana/scenes#756) ([@mdvictor](https://github.com/mdvictor)) - fix: undefined check on RefreshPicker.autoOption [#751](grafana/scenes#751) ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Levente Balogh ([@leventebalogh](https://github.com/leventebalogh)) - Victor Marin ([@mdvictor](https://github.com/mdvictor)) --- - `@grafana/scenes` - SceneFlexLayout: Min width/height option was ignored [#749](grafana/scenes#749) ([@edvard-falkskar](https://github.com/edvard-falkskar)) - Edvard Falkskär ([@edvard-falkskar](https://github.com/edvard-falkskar)) --- (cherry picked from commit c5ae0bb)
Addresses this issue grafana/grafana#47005 (comment)
Related PR in the Grafana repo: grafana/grafana#87317
Is this a good place to add this? Also, are there some drawbacks that may cause performance issues?
📦 Published PR as canary version:
4.24.4--canary.716.9300035734.0
✨ Test out this PR locally via:
npm install @grafana/scenes@4.24.4--canary.716.9300035734.0 # or yarn add @grafana/scenes@4.24.4--canary.716.9300035734.0