personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

convey: pairing-UI banners for localhost and no-LAN states

Surface the new pairing-state warnings directly in the pairing UI so users see when localhost-only bind or LAN detection prevents remote devices from connecting. The view now passes explicit render flags instead of relying on a separate status endpoint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+35 -3
+21 -3
convey/pairing.py
··· 14 14 from werkzeug.exceptions import BadRequest 15 15 16 16 from convey.auth import is_owner_authed, require_paired_device, resolve_paired_device 17 - from think.pairing.config import get_host_url, get_owner_identity 17 + from think.pairing.config import _detect_lan_ipv4, get_host_url, get_owner_identity 18 18 from think.pairing.devices import ( 19 19 Device, 20 20 load_devices, ··· 31 31 ) 32 32 from think.pairing.tokens import consume_token, peek_token 33 33 from think.pairing.tokens import create_token as mint_pairing_token 34 - from think.utils import get_journal 34 + from think.utils import get_config, get_journal 35 35 36 36 logger = logging.getLogger(__name__) 37 37 ··· 224 224 225 225 @pairing_ui_bp.get("/") 226 226 def index(): 227 - return render_template("pairing.html") 227 + from convey import copy as convey_copy 228 + 229 + config = get_config() 230 + convey_config = config.get("convey", {}) 231 + allow_network_access = convey_config.get("allow_network_access", False) 232 + pairing_host_override = config.get("pairing", {}).get("host_url") 233 + has_override = isinstance(pairing_host_override, str) and bool( 234 + pairing_host_override.strip() 235 + ) 236 + pairing_network_off = not allow_network_access 237 + pairing_lan_detect_failed = ( 238 + allow_network_access and not has_override and _detect_lan_ipv4() is None 239 + ) 240 + return render_template( 241 + "pairing.html", 242 + convey_copy=convey_copy, 243 + pairing_lan_detect_failed=pairing_lan_detect_failed, 244 + pairing_network_off=pairing_network_off, 245 + ) 228 246 229 247 230 248 __all__ = ["pairing_bp", "pairing_ui_bp"]
+14
convey/templates/pairing.html
··· 24 24 <p id="pairing-feedback" class="pairing-feedback" aria-live="polite"></p> 25 25 </div> 26 26 27 + {% if pairing_network_off %} 28 + <section class="pairing-banner pairing-banner-warning"> 29 + <h2>{{ convey_copy.PAIRING_LOCALHOST_BANNER_TITLE }}</h2> 30 + <p>{{ convey_copy.PAIRING_LOCALHOST_BANNER_BODY_1 }}</p> 31 + <p>{{ convey_copy.PAIRING_LOCALHOST_BANNER_BODY_2 }}</p> 32 + <p><a href="/app/settings/#section-security">{{ convey_copy.PAIRING_LOCALHOST_BANNER_ACTION }}</a></p> 33 + </section> 34 + {% elif pairing_lan_detect_failed %} 35 + <section class="pairing-banner pairing-banner-warning"> 36 + <h2>{{ convey_copy.PAIRING_NO_LAN_BANNER_TITLE }}</h2> 37 + <p>{{ convey_copy.PAIRING_NO_LAN_BANNER_BODY }}</p> 38 + </section> 39 + {% endif %} 40 + 27 41 <section id="pairing-minted" class="pairing-minted" hidden> 28 42 <div class="pairing-qr-wrap"> 29 43 <div id="pairing-qr" class="pairing-qr" aria-live="polite"></div>