# HG changeset patch # User Goffi # Date 1750950757 -7200 # Node ID 8400d3b5851506836d8389f8c7ca6e5d5899cb1d # Parent d4dd4c94463c2b31a73c415cc84c0a3cac4b1660 browser (chat): Show Data Policy Panel on badge hover/touch. If data policy and its score are set, add the event listener to show the panel when the badge is hovered or touched. rel 460 diff -r d4dd4c94463c -r 8400d3b58515 libervia/web/pages/chat/_browser/__init__.py --- a/libervia/web/pages/chat/_browser/__init__.py Thu Jun 26 17:10:41 2025 +0200 +++ b/libervia/web/pages/chat/_browser/__init__.py Thu Jun 26 17:12:37 2025 +0200 @@ -1,4 +1,3 @@ -from html import escape import json import re from typing import Callable @@ -336,6 +335,28 @@ ) document["direct-messages"] <= direct_messages_elt + # data policy + try: + data_policy = window.data_policy + except AttributeError: + pass + else: + data_policy_score = window.data_policy_score + data_policy_panel_tpl = Template("components/data_policy_panel.html") + data_policy_panel_elt = data_policy_panel_tpl.get_elt({ + "detail": data_policy["score"]["detail"], + "score": data_policy_score, + }) + tippy( + ".data-policy-badge", + { + "content": data_policy_panel_elt, + "appendTo": document.body, + "placement": "bottom", + "theme": "light", + } + ) + async def post_init(self) -> None: if chat_type == "group": occupants = await bridge.muc_occupants_get(