mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-30 11:49:50 +02:00
[eric] stop tab clicks in browser cards from triggering card auto-focus (stopPropagation on tab click events), fix broken PostHog identify (SDK has no .identify(), use .set()), send referral_source to PostHog
This commit is contained in:
@@ -153,6 +153,8 @@ async def analytics_lifespan():
|
||||
id_props["name"] = settings.user_name
|
||||
if getattr(settings, "user_use_case", None):
|
||||
id_props["use_case"] = settings.user_use_case
|
||||
if getattr(settings, "user_referral_source", None):
|
||||
id_props["referral_source"] = settings.user_referral_source
|
||||
identify(id_props)
|
||||
except Exception as e:
|
||||
logger.debug(f"Analytics startup event failed (non-critical): {e}")
|
||||
|
||||
@@ -101,13 +101,13 @@ def record(
|
||||
|
||||
|
||||
def identify(extra_properties: dict | None = None):
|
||||
"""Identify the current installation with properties."""
|
||||
"""Set person properties on the current installation's PostHog profile."""
|
||||
if not _posthog:
|
||||
return
|
||||
|
||||
try:
|
||||
_posthog.identify(
|
||||
_get_installation_id(),
|
||||
_posthog.set(
|
||||
distinct_id=_get_installation_id(),
|
||||
properties={
|
||||
"os": platform.system(),
|
||||
"platform": platform.platform(),
|
||||
|
||||
@@ -96,6 +96,8 @@ async def update_settings(body: AppSettings):
|
||||
id_props["name"] = body.user_name
|
||||
if body.user_use_case:
|
||||
id_props["use_case"] = body.user_use_case
|
||||
if body.user_referral_source:
|
||||
id_props["referral_source"] = body.user_referral_source
|
||||
if id_props:
|
||||
_identify(id_props)
|
||||
|
||||
|
||||
@@ -726,6 +726,7 @@ const BrowserCard: React.FC<Props> = ({
|
||||
onPointerDown={handleTabPointerDown}
|
||||
onPointerMove={handleTabPointerMove}
|
||||
onPointerUp={handleTabPointerUp}
|
||||
onClick={(e: React.MouseEvent) => e.stopPropagation()}
|
||||
sx={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
|
||||
Reference in New Issue
Block a user